diff options
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; } |