diff options
author | Ilpo Ruotsalainen <ilpo.ruotsalainen@oath.com> | 2018-11-28 15:49:37 +0100 |
---|---|---|
committer | Ilpo Ruotsalainen <ilpo.ruotsalainen@oath.com> | 2018-11-28 15:54:45 +0100 |
commit | 48c554881cdeafc0c6e474da7171f9238fef8e5f (patch) | |
tree | 26e255bdfe3f4b7d73972a1b37d4a82694ca4c66 /abi-check-plugin/src/main/java/com/yahoo/abicheck/mojo/AbiCheck.java | |
parent | 54bf0d9de1f98a0e1e987d74c7af723ad7666e14 (diff) |
Fields, superclass and interfaces are part of ABI.
Diffstat (limited to 'abi-check-plugin/src/main/java/com/yahoo/abicheck/mojo/AbiCheck.java')
-rw-r--r-- | abi-check-plugin/src/main/java/com/yahoo/abicheck/mojo/AbiCheck.java | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/abi-check-plugin/src/main/java/com/yahoo/abicheck/mojo/AbiCheck.java b/abi-check-plugin/src/main/java/com/yahoo/abicheck/mojo/AbiCheck.java index 007d0ff6a51..6dae44c8aa9 100644 --- a/abi-check-plugin/src/main/java/com/yahoo/abicheck/mojo/AbiCheck.java +++ b/abi-check-plugin/src/main/java/com/yahoo/abicheck/mojo/AbiCheck.java @@ -128,15 +128,29 @@ public class AbiCheck extends AbstractMojo { private boolean matchingClasses(String className, JavaClassSignature expected, JavaClassSignature actual) { boolean match = true; - if (!matchingItemSets(new HashSet<>(expected.attributes), new HashSet<>(actual.attributes), - item -> true, (item, error) -> getLog().error(String - .format("Class %s: %s attribute %s", className, capitalizeFirst(error), item)))) { + if (!expected.superClass.equals(actual.superClass)) { match = false; + getLog().error(String + .format("Class %s: Expected superclass %s, found %s", className, expected.superClass, + actual.superClass)); + } + if (!matchingItemSets(expected.interfaces, actual.interfaces, item -> true, + (item, error) -> getLog().error( + String.format("Class %s: %s interface %s", className, capitalizeFirst(error), item)))) { + if (!matchingItemSets(new HashSet<>(expected.attributes), new HashSet<>(actual.attributes), + item -> true, (item, error) -> getLog().error(String + .format("Class %s: %s attribute %s", className, capitalizeFirst(error), item)))) { + match = false; + } } if (!matchingItemSets(expected.methods, actual.methods, item -> true, (item, error) -> getLog() .error(String.format("Class %s: %s method %s", className, capitalizeFirst(error), item)))) { match = false; } + if (!matchingItemSets(expected.fields, actual.fields, item -> true, (item, error) -> getLog() + .error(String.format("Class %s: %s field %s", className, capitalizeFirst(error), item)))) { + match = false; + } return match; } |