removed deprecation warning for new Double()

pull/461/head
Michael Peter Christen 3 years ago
parent 96e44e11bb
commit 39e7bbac13

@ -66,7 +66,7 @@ public class IntegerGeoPoint implements GeoPoint {
return Math.abs(int2coord(1) - int2coord(2)); return Math.abs(int2coord(1) - int2coord(2));
} }
private static final double maxint = new Double(Integer.MAX_VALUE).doubleValue(); private static final double maxint = (double) Integer.MAX_VALUE;
private static final double upscale = maxint / 360.0d; private static final double upscale = maxint / 360.0d;
private static final int coord2int(double coord) { private static final int coord2int(double coord) {
@ -92,7 +92,7 @@ public class IntegerGeoPoint implements GeoPoint {
@Override @Override
public boolean equals(final Object o) { public boolean equals(final Object o) {
if (!(o instanceof IntegerGeoPoint)) return false; if (!(o instanceof IntegerGeoPoint)) return false;
IntegerGeoPoint oo = (IntegerGeoPoint) o; final IntegerGeoPoint oo = (IntegerGeoPoint) o;
return (this.latlon == oo.latlon); return (this.latlon == oo.latlon);
} }
@ -102,9 +102,9 @@ public class IntegerGeoPoint implements GeoPoint {
} }
public static void main(String[] args) { public static void main(String[] args) {
double lat = 13.419444d; final double lat = 13.419444d;
double lon = 52.548611d; final double lon = 52.548611d;
GeoPoint c = new IntegerGeoPoint(lat, lon); final GeoPoint c = new IntegerGeoPoint(lat, lon);
System.out.println(c.toString() + " #" + c.hashCode()); System.out.println(c.toString() + " #" + c.hashCode());
System.out.println("error: lat: " + (Math.abs(c.lat() - lat) / meter) + " meter; lon: " + (Math.abs(c.lon() - lon) / meter) + " meter"); System.out.println("error: lat: " + (Math.abs(c.lat() - lat) / meter) + " meter; lon: " + (Math.abs(c.lon() - lon) / meter) + " meter");
System.out.println("accuracyLat = " + c.accuracyLat() / meter + " meter, accuracyLon = " + c.accuracyLon() / meter + " meter"); System.out.println("accuracyLat = " + c.accuracyLat() / meter + " meter, accuracyLon = " + c.accuracyLon() / meter + " meter");

Loading…
Cancel
Save