Exclude all methods containing '$' in ListenerConsistencyTest

This commit is contained in:
ljacqu 2015-12-28 13:56:35 +01:00
parent fc6c120f69
commit 48dce83892

View File

@ -103,9 +103,10 @@ public final class ListenerConsistencyTest {
}
private static boolean isTestableMethod(Method method) {
// A method like "access$000" is created by the compiler when a private member is being accessed by an inner
// class, so we need to ignore such methods
return !Modifier.isPrivate(method.getModifiers()) && !method.getName().startsWith("access$");
// Exclude any methods with "$" in it: jacoco creates a "$jacocoInit" method we want to ignore, and
// methods like "access$000" are created by the compiler when a private member is being accessed by an inner
// class, which is not of interest for us
return !Modifier.isPrivate(method.getModifiers()) && !method.getName().contains("$");
}
}