mirror of
https://github.com/AppleDash/SaneEconomy.git
synced 2024-11-14 06:08:08 +01:00
0.12.7 - Fix version comparator AGAIN
This commit is contained in:
parent
31d311c229
commit
9a00cddf24
@ -9,7 +9,7 @@
|
||||
<version>0</version>
|
||||
</parent>
|
||||
<artifactId>SaneEconomyCore</artifactId>
|
||||
<version>0.12.6-SNAPSHOT</version>
|
||||
<version>0.12.7-SNAPSHOT</version>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
@ -17,15 +17,7 @@ public class VersionComparer {
|
||||
int[] firstParts = intifyParts(first);
|
||||
int[] secondParts = intifyParts(second);
|
||||
|
||||
if (secondParts[0] > firstParts[0]) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (secondParts[1] > firstParts[1]) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return secondParts[2] > firstParts[2];
|
||||
return computeInt(secondParts) > computeInt(firstParts);
|
||||
}
|
||||
|
||||
private static int[] intifyParts(String version) {
|
||||
@ -33,4 +25,8 @@ public class VersionComparer {
|
||||
|
||||
return new int[] { Integer.valueOf(firstParts[0]), Integer.valueOf(firstParts[1]), Integer.valueOf(firstParts[2]) };
|
||||
}
|
||||
|
||||
private static int computeInt(int[] parts) {
|
||||
return (parts[0] * 1000000) + (parts[1] * 1000) + parts[2];
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
name: SaneEconomy
|
||||
author: AppleDash
|
||||
main: org.appledash.saneeconomy.SaneEconomy
|
||||
version: 0.12.6
|
||||
version: 0.12.7
|
||||
load: STARTUP
|
||||
softdepend: [Vault]
|
||||
commands:
|
||||
|
@ -15,5 +15,6 @@ public class VersionComparerTest {
|
||||
Assert.assertFalse(VersionComparer.isSemVerGreaterThan("2.0.0", "1.0.0"));
|
||||
Assert.assertTrue(VersionComparer.isSemVerGreaterThan("0.1.0", "0.2.0"));
|
||||
Assert.assertTrue(VersionComparer.isSemVerGreaterThan("1.0.0", "2.0.0"));
|
||||
Assert.assertFalse(VersionComparer.isSemVerGreaterThan("0.12.6", "0.5.7"));
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,7 @@
|
||||
<dependency>
|
||||
<groupId>org.appledash</groupId>
|
||||
<artifactId>SaneEconomyCore</artifactId>
|
||||
<version>0.12.6-SNAPSHOT</version>
|
||||
<version>0.12.7-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
<dependency>
|
||||
<groupId>org.appledash</groupId>
|
||||
<artifactId>SaneEconomyCore</artifactId>
|
||||
<version>0.12.6-SNAPSHOT</version>
|
||||
<version>0.12.7-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
<dependency>
|
||||
<groupId>org.appledash</groupId>
|
||||
<artifactId>SaneEconomyCore</artifactId>
|
||||
<version>0.12.6-SNAPSHOT</version>
|
||||
<version>0.12.7-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user