Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Fix up compareTo method
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Eng committed Oct 15, 2013
1 parent 2f67456 commit fe11078
Showing 1 changed file with 11 additions and 2 deletions.
Expand Up @@ -59,7 +59,16 @@ public boolean equals(Object obj) {

@Override
public int compareTo(Object o) {
DocumentId compareTo = (DocumentId) o;
return this.getDocId().compareTo(compareTo.getDocId());
if (o == this) {
return 0;
}
if (o == null) {
return -1;
}
if (o instanceof DocumentId) {
DocumentId compareTo = (DocumentId) o;
return this.getDocId().compareTo(compareTo.getDocId());
}
return -1;
}
}

0 comments on commit fe11078

Please sign in to comment.