Skip to content

Commit

Permalink
Corrected Neighbor to support (de)serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
tdebatty committed Nov 20, 2016
1 parent 6969e2f commit fbd9007
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/info/debatty/java/graphs/Neighbor.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ public int hashCode() {

@Override
public int compareTo(Object other) {
if (other == null) {
return 1;
}

if (!other.getClass().isInstance(this)) {
throw new InvalidParameterException();
}
Expand Down

0 comments on commit fbd9007

Please sign in to comment.