Try to fix serialization bug

This commit is contained in:
Lennart Hensler committed 2012-01-18 11:15:03 +01:00
1 parent fc05cda6fa
commit 955ac3f436
1 file changed
+4 -5
@@ -33,10 +33,9 @@ public class SerializablePositionImpl implements SerializablePosition, Serializa
public int hashCode() {
final int prime = 31;
int result = 1;
long temp;
temp = Double.doubleToLongBits(latDeg);
int temp = (int) latDeg;
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits(lngDeg);
temp = (int) lngDeg;
result = prime * result + (int) (temp ^ (temp >>> 32));
return result;
}
@@ -50,9 +49,9 @@ public class SerializablePositionImpl implements SerializablePosition, Serializa
if (getClass() != obj.getClass())
return false;
SerializablePositionImpl other = (SerializablePositionImpl) obj;
if (Double.doubleToLongBits(latDeg) != Double.doubleToLongBits(other.latDeg))
if (new Double(latDeg).equals(other.latDeg))
return false;
if (Double.doubleToLongBits(lngDeg) != Double.doubleToLongBits(other.lngDeg))
if (new Double(lngDeg).equals(other.lngDeg))
return false;
return true;
}