I have the following compare function:
@Override
public int compareTo(OptimizedMatch another) {
long c = this.compareTime - another.compareTime;
if(c>0){
return 1;
} else if(c<0){
return -1;
}
return 0;
}
whereas compareTime is calculated in this way
this.compareTime = this.dateStamp + (LENGTH_OF_DAY - (this.dateTimeStamp - this.dateStamp));
Why am I getting this error?! I am comparing two long values, shouldnt that be just standard?
EDIT: I found the error, it was my IDE (Eclipse) being buggy. After cleaning my project and restarting it works.