Changeset 5356 in josm
- Timestamp:
- 2012-07-22T22:36:44+02:00 (12 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/DatasetConsistencyTest.java
r5333 r5356 80 80 if (!n.isIncomplete() && !n.isDeleted()) { 81 81 LatLon c = n.getCoor(); 82 BBox box = new BBox(new LatLon(c.lat() - 0.0001, c.lon() - 0.0001), new LatLon(c.lat() + 0.0001, c.lon() + 0.0001)); 83 if (!dataSet.searchNodes(box).contains(n)) { 84 printError("SEARCH NODES", "%s not found using Dataset.searchNodes()", n); 82 if (c != null) { 83 BBox box = new BBox(new LatLon(c.lat() - 0.0001, c.lon() - 0.0001), new LatLon(c.lat() + 0.0001, c.lon() + 0.0001)); 84 if (!dataSet.searchNodes(box).contains(n)) { 85 printError("SEARCH NODES", "%s not found using Dataset.searchNodes()", n); 86 } 85 87 } 86 88 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java
r5287 r5356 44 44 double precision = Main.pref.getDouble("validator.duplicatenodes.precision", 0.); 45 45 46 private LatLon RoundCoord(Node o) {46 private LatLon roundCoord(LatLon coor) { 47 47 return new LatLon( 48 Math.round( o.getCoor().lat() / precision) * precision,49 Math.round( o.getCoor().lon() / precision) * precision48 Math.round(coor.lat() / precision) * precision, 49 Math.round(coor.lon() / precision) * precision 50 50 ); 51 51 } … … 54 54 private LatLon getLatLon(Object o) { 55 55 if (o instanceof Node) { 56 LatLon coor = ((Node) o).getCoor(); 57 if (coor == null) 58 return null; 56 59 if (precision==0) 57 return ((Node) o).getCoor().getRoundedToOsmPrecision();58 return RoundCoord((Node) o);60 return coor.getRoundedToOsmPrecision(); 61 return roundCoord(coor); 59 62 } else if (o instanceof List<?>) { 63 LatLon coor = ((List<Node>) o).get(0).getCoor(); 64 if (coor == null) 65 return null; 60 66 if (precision==0) 61 return ((List<Node>) o).get(0).getCoor().getRoundedToOsmPrecision();62 return RoundCoord(((List<Node>) o).get(0));67 return coor.getRoundedToOsmPrecision(); 68 return roundCoord(coor); 63 69 } else 64 70 throw new AssertionError(); … … 67 73 @Override 68 74 public boolean equals(Object k, Object t) { 69 return getLatLon(k).equals(getLatLon(t)); 75 LatLon coorK = getLatLon(k); 76 LatLon coorT = getLatLon(t); 77 return coorK == coorT || (coorK != null && coorT != null && coorK.equals(coorT)); 70 78 } 71 79 72 80 @Override 73 81 public int getHashCode(Object k) { 74 return getLatLon(k).hashCode(); 82 LatLon coorK = getLatLon(k); 83 return coorK == null ? 0 : coorK.hashCode(); 75 84 } 76 85 } -
trunk/src/org/openstreetmap/josm/gui/history/CoordinateInfoViewer.java
r5346 r5356 262 262 // display the coordinates 263 263 // 264 lblLat.setText(coord != null ? coord.latToString(CoordinateFormat.DECIMAL_DEGREES) : tr(" Deleted"));265 lblLon.setText(coord != null ? coord.lonToString(CoordinateFormat.DECIMAL_DEGREES) : tr(" Deleted"));264 lblLat.setText(coord != null ? coord.latToString(CoordinateFormat.DECIMAL_DEGREES) : tr("(none)")); 265 lblLon.setText(coord != null ? coord.lonToString(CoordinateFormat.DECIMAL_DEGREES) : tr("(none)")); 266 266 267 267 // update background color to reflect differences in the coordinates … … 342 342 } else { 343 343 lblDistance.setBackground(coord != oppositeCoord ? BGCOLOR_DIFFERENCE : Color.WHITE); 344 lblDistance.setText(tr(" Deleted"));344 lblDistance.setText(tr("(none)")); 345 345 } 346 346 }
Note:
See TracChangeset
for help on using the changeset viewer.