Fix bug in version comparison
This commit is contained in:
parent
518adf9826
commit
fada7b2f50
|
@ -88,9 +88,15 @@ public class TimeTracker {
|
|||
}
|
||||
|
||||
public String milestone() {
|
||||
long start = milestone == 0 ? globalStart : milestone ;
|
||||
long start = milestone == 0 ? globalStart : milestone;
|
||||
milestone = System.nanoTime();
|
||||
return DurationUtil.presentDuration(milestone - start);
|
||||
}
|
||||
|
||||
public boolean longerThan(int i) {
|
||||
long start = milestone == 0 ? globalStart : milestone;
|
||||
long diff = (System.nanoTime() - start)/ 1000000;
|
||||
return diff > i * 1000;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -334,7 +334,8 @@ public class VersionUtilities {
|
|||
if (pc!=null) {
|
||||
if (pt.contains("-") && !pc.contains("-")) {
|
||||
pt = pt.substring(0, pt.indexOf("-"));
|
||||
return pt.compareTo(pc) >= 0;
|
||||
int res = pc.compareTo(pt);
|
||||
return res >= 0;
|
||||
} else {
|
||||
return compareVersionPart(pt, pc);
|
||||
}
|
||||
|
|
|
@ -53,4 +53,8 @@ public class VersionUtilitiesTest {
|
|||
assertFalse(VersionUtilities.isThisOrLater("0.9.x", "0.8.1"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void bugFixTests() {
|
||||
assertTrue(VersionUtilities.isThisOrLater("1.0.0-ballot", "1.0.1"));
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue