Skip to content

Commit

Permalink
Don't count synthetic and bridge methods in DynamicClass check methods
Browse files Browse the repository at this point in the history
  • Loading branch information
MaisiKoleni committed May 4, 2021
1 parent 71a83a6 commit 0a1bcb5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/de/tum/in/test/api/dynamic/DynamicClass.java
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ public int checkForPublicOrProtectedMethods(List<DynamicMethod<?>> exceptions) {
Set<String> publicMethods = Set.of(DynamicMethod.signatureOfAll(exceptions));
Set<String> objectMethods = Set.of(DynamicMethod.signatureOfAll(Object.class.getMethods()));
for (Method m : toClass().getDeclaredMethods()) {
checked++;
if (m.isSynthetic() || m.isBridge())
continue;
if (Modifier.isPublic(m.getModifiers())) {
Expand All @@ -186,6 +185,7 @@ public int checkForPublicOrProtectedMethods(List<DynamicMethod<?>> exceptions) {
if (!objectMethods.contains(sig))
fail("Methode " + sig + " ist protected, sollte sie aber nicht");
}
checked++;
}
return checked;
}
Expand Down

0 comments on commit 0a1bcb5

Please sign in to comment.