Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions modules/core/src/main/java/org/locationtech/jts/math/DD.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
*
*/
public strictfp final class DD
implements Serializable, Comparable, Cloneable
implements Serializable, Comparable<DD>, Cloneable
{
/**
* The value nearest to the constant Pi.
Expand Down Expand Up @@ -985,9 +985,12 @@ public boolean isPositive()
* @param y a DoubleDouble value
* @return true if this value = y
*/
public boolean equals(DD y)
public boolean equals(Object o)
{
return hi == y.hi && lo == y.lo;
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
DD dd = (DD) o;
return hi == dd.hi && lo == dd.lo;
}

/**
Expand Down Expand Up @@ -1030,13 +1033,12 @@ public boolean le(DD y)
/**
* Compares two DoubleDouble objects numerically.
*
* @param other a DD value to compare to
* @return -1,0 or 1 depending on whether this value is less than, equal to
* or greater than the value of <tt>o</tt>
*/
public int compareTo(Object o)
public int compareTo(DD other)
{
DD other = (DD) o;

if (hi < other.hi) return -1;
if (hi > other.hi) return 1;
if (lo < other.lo) return -1;
Expand Down