Ignore:
Timestamp:
2016-08-27T17:23:05+02:00 (8 years ago)
Author:
Don-vip
Message:

add more non-regression NMEA unit tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/gpx/WayPoint.java

    r10467 r10906  
    159159        return new ArrayList<>(attr.keySet());
    160160    }
     161
     162    @Override
     163    public int hashCode() {
     164        final int prime = 31;
     165        int result = super.hashCode();
     166        long temp = Double.doubleToLongBits(lat);
     167        result = prime * result + (int) (temp ^ (temp >>> 32));
     168        temp = Double.doubleToLongBits(lon);
     169        result = prime * result + (int) (temp ^ (temp >>> 32));
     170        temp = Double.doubleToLongBits(time);
     171        result = prime * result + (int) (temp ^ (temp >>> 32));
     172        return result;
     173    }
     174
     175    @Override
     176    public boolean equals(Object obj) {
     177        if (this == obj)
     178            return true;
     179        if (!super.equals(obj))
     180            return false;
     181        if (getClass() != obj.getClass())
     182            return false;
     183        WayPoint other = (WayPoint) obj;
     184        if (Double.doubleToLongBits(lat) != Double.doubleToLongBits(other.lat))
     185            return false;
     186        if (Double.doubleToLongBits(lon) != Double.doubleToLongBits(other.lon))
     187            return false;
     188        if (Double.doubleToLongBits(time) != Double.doubleToLongBits(other.time))
     189            return false;
     190        return true;
     191    }
    161192}
Note: See TracChangeset for help on using the changeset viewer.