diff options
Diffstat (limited to 'api/src/main/java/org/semver/Delta.java')
-rwxr-xr-x | api/src/main/java/org/semver/Delta.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/api/src/main/java/org/semver/Delta.java b/api/src/main/java/org/semver/Delta.java index e856bb2..ebb6b57 100755 --- a/api/src/main/java/org/semver/Delta.java +++ b/api/src/main/java/org/semver/Delta.java @@ -213,7 +213,7 @@ public final class Delta { if (current == null) { throw new IllegalArgumentException("null current"); } - if (previous.compareTo(current) <= 0) { + if (current.compareTo(previous) <= 0) { throw new IllegalArgumentException("Current version <"+previous+"> must be more recent than previous version <"+current+">."); } //When in development public API is not considered stable @@ -223,7 +223,7 @@ public final class Delta { //Current version must be superior or equals to inferred version final Version inferredVersion = infer(previous); - return inferredVersion.compareTo(current) >= 0; + return current.compareTo(inferredVersion) >= 0; } } |