diff options
author | Martín Schonaker <[email protected]> | 2014-04-09 17:24:27 -0300 |
---|---|---|
committer | Martín Schonaker <[email protected]> | 2014-04-09 17:24:27 -0300 |
commit | 2ef19b55ae6913a289df68c3756a990f376354aa (patch) | |
tree | b3e434c1146190c0c262ad2a34258b6cf7be584b /api/src/main/java/org/semver/Delta.java | |
parent | 179643236fac79cc4bd02d5201674536ff636c11 (diff) |
Issue #25: @Deprecated should require a minor version bump instead of a major one.
Diffstat (limited to 'api/src/main/java/org/semver/Delta.java')
-rwxr-xr-x | api/src/main/java/org/semver/Delta.java | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/api/src/main/java/org/semver/Delta.java b/api/src/main/java/org/semver/Delta.java index 4af87d3..20d963c 100755 --- a/api/src/main/java/org/semver/Delta.java +++ b/api/src/main/java/org/semver/Delta.java @@ -107,6 +107,24 @@ public final class Delta { } @Immutable + public static class Deprecate extends Difference { + + private final AbstractInfo modifiedInfo; + + public Deprecate(@Nonnull final String className, + @Nonnull final AbstractInfo info, + @Nonnull final AbstractInfo modifiedInfo) { + super(className, info); + + this.modifiedInfo = modifiedInfo; + } + + public AbstractInfo getModifiedInfo() { + return this.modifiedInfo; + } + } + + @Immutable public static class Remove extends Difference { public Remove(@Nonnull final String className, @Nonnull final AbstractInfo info) { @@ -132,10 +150,12 @@ public final class Delta { */ @Nonnull public final CompatibilityType computeCompatibilityType() { + if (contains(this.differences, Change.class) || contains(this.differences, Remove.class)) { return CompatibilityType.NON_BACKWARD_COMPATIBLE; - } else if (contains(this.differences, Add.class)) { + } else if (contains(this.differences, Add.class) || + contains(this.differences, Deprecate.class)) { return CompatibilityType.BACKWARD_COMPATIBLE_USER; } else { return CompatibilityType.BACKWARD_COMPATIBLE_IMPLEMENTER; |