diff options
author | Sven Gothel <[email protected]> | 2015-04-03 05:54:12 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2015-04-03 05:54:12 +0200 |
commit | 45e18a543f7f11bf5e701f898e7c1221bd2f2672 (patch) | |
tree | 5d57d9e31fd109986650873f7b01f2a6395703a3 /api/src/main/java/org/semver/jardiff/DifferenceAccumulatingHandler.java | |
parent | c714666c0f4e19bb9db163f576e28d36cad7df74 (diff) |
Expose 'fieldCompatChanged', allowing user to fail if fields have changed (binary compatible)
Diffstat (limited to 'api/src/main/java/org/semver/jardiff/DifferenceAccumulatingHandler.java')
-rwxr-xr-x | api/src/main/java/org/semver/jardiff/DifferenceAccumulatingHandler.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/api/src/main/java/org/semver/jardiff/DifferenceAccumulatingHandler.java b/api/src/main/java/org/semver/jardiff/DifferenceAccumulatingHandler.java index 8f7fb22..f697ef4 100755 --- a/api/src/main/java/org/semver/jardiff/DifferenceAccumulatingHandler.java +++ b/api/src/main/java/org/semver/jardiff/DifferenceAccumulatingHandler.java @@ -49,6 +49,7 @@ public final class DifferenceAccumulatingHandler extends AbstractDiffHandler { private final Set<String> excludes; private final boolean excludesAreRegExp; private final Set<Difference> differences = new HashSet<Difference>(); + private boolean fieldCompatChanged; public DifferenceAccumulatingHandler() { this(Collections.<String>emptySet(), Collections.<String>emptySet()); @@ -63,6 +64,7 @@ public final class DifferenceAccumulatingHandler extends AbstractDiffHandler { this.includesAreRegExp = includesAreRegExp; this.excludes = excludes; this.excludesAreRegExp = excludesAreRegExp; + this.fieldCompatChanged = false; } public String getCurrentClassName() { @@ -173,7 +175,7 @@ public final class DifferenceAccumulatingHandler extends AbstractDiffHandler { if (!isClassConsidered(getCurrentClassName())) { return; } - + this.fieldCompatChanged = true; this.differences.add(new CompatChange(getCurrentClassName(), oldFieldInfo, newFieldInfo)); } @@ -354,7 +356,7 @@ public final class DifferenceAccumulatingHandler extends AbstractDiffHandler { } public Delta getDelta() { - return new Delta(this.differences); + return new Delta(this.differences, this.fieldCompatChanged); } } |