IDEMPIERE-4533 Problem when changing a plugin from AdempiereActivator to Incremental2PackActivator (#362)
This commit is contained in:
parent
e105ed3385
commit
e5a5f1233a
|
@ -40,10 +40,22 @@ public class Version implements Comparable<Version> {
|
||||||
String[] thatParts = that.get().split("\\.");
|
String[] thatParts = that.get().split("\\.");
|
||||||
int length = Math.max(thisParts.length, thatParts.length);
|
int length = Math.max(thisParts.length, thatParts.length);
|
||||||
for(int i = 0; i < length; i++) {
|
for(int i = 0; i < length; i++) {
|
||||||
int thisPart = i < thisParts.length ?
|
if (i < thisParts.length && i < thatParts.length && thisParts[i].equals(thatParts[i]))
|
||||||
Integer.parseInt(thisParts[i]) : 0;
|
continue;
|
||||||
int thatPart = i < thatParts.length ?
|
int thisPart;
|
||||||
Integer.parseInt(thatParts[i]) : 0;
|
try {
|
||||||
|
thisPart = i < thisParts.length ?
|
||||||
|
Integer.parseInt(thisParts[i]) : 0;
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
thisPart = -1;
|
||||||
|
}
|
||||||
|
int thatPart;
|
||||||
|
try {
|
||||||
|
thatPart = i < thatParts.length ?
|
||||||
|
Integer.parseInt(thatParts[i]) : 0;
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
thatPart = -2; // above was determined that both parts are different
|
||||||
|
}
|
||||||
if(thisPart < thatPart)
|
if(thisPart < thatPart)
|
||||||
return -1;
|
return -1;
|
||||||
if(thisPart > thatPart)
|
if(thisPart > thatPart)
|
||||||
|
|
Loading…
Reference in New Issue