aboutsummaryrefslogtreecommitdiffstats
path: root/api/src/main/java
diff options
context:
space:
mode:
authorNahuel Dalla Vecchia <[email protected]>2012-12-14 16:06:15 -0300
committerNahuel Dalla Vecchia <[email protected]>2012-12-14 16:06:15 -0300
commit19fa67e21962968aa8c9ea6fd70fe764079a5ff2 (patch)
tree24e0fceee1763af4bc35b32279fa2f9d1e8c8389 /api/src/main/java
parentbd8fcb032ea865c28af9dd5dcffdfa3d5ebb43cf (diff)
Fix greater than case when comparing patch
Diffstat (limited to 'api/src/main/java')
-rwxr-xr-xapi/src/main/java/org/semver/Version.java18
1 files changed, 10 insertions, 8 deletions
diff --git a/api/src/main/java/org/semver/Version.java b/api/src/main/java/org/semver/Version.java
index e5c1156..7629250 100755
--- a/api/src/main/java/org/semver/Version.java
+++ b/api/src/main/java/org/semver/Version.java
@@ -170,16 +170,18 @@ public final class Version implements Comparable<Version> {
} else if (this.minor == other.minor) {
if (this.patch < other.patch) {
return -1;
- } else if (this.special != null && other.special != null) {
- return this.special.compareTo(other.special);
- } else if (other.special != null) {
- return -1;
- } else if (this.special != null) {
- return 1;
- } // else handled by previous equals check
+ } else if (this.patch == other.patch) {
+ if (this.special != null && other.special != null) {
+ return this.special.compareTo(other.special);
+ } else if (other.special != null) {
+ return -1;
+ } else if (this.special != null) {
+ return 1;
+ } // else handled by previous equals check
+ }
}
}
- return 1;
+ return 1; //if this (major, minor or patch) is > than other
}
@Override