ItEr59S04ValidacionEProbasFuncionaisItEr58S04: [Bug #481] Fixing bug

Start time can be null so taking it into account.
This commit is contained in:
Óscar González Fernández 2010-06-07 13:30:43 +02:00
parent 5f3d6fe72d
commit 3fb6c09763

View file

@ -226,11 +226,18 @@ public class Gap implements Comparable<Gap> {
}
@Override
public int compareTo(Gap o) {
if (o == null) {
public int compareTo(Gap other) {
if (other == null) {
return 1;
}
return this.getStartTime().compareTo(o.getStartTime());
if (this.getStartTime() == null && other.getStartTime() == null) {
return 0;
} else if (this.getStartTime() == null) {
return -1;
} else if (other.getStartTime() == null) {
return 1;
}
return this.getStartTime().compareTo(other.getStartTime());
}
public boolean isBefore(Gap gap) {