Fix test / use new DataSource method / add space before keywords

This commit is contained in:
ljacqu
2017-11-03 19:57:40 +01:00
parent 273c318e96
commit c7ba06e2b9
5 changed files with 17 additions and 25 deletions
@@ -66,7 +66,7 @@ public abstract class AbstractSqlDataSourceResourceClosingTest extends AbstractR
private static List<Method> getDataSourceMethods() {
List<Method> publicMethods = new ArrayList<>();
for (Method method : DataSource.class.getDeclaredMethods()) {
if (!IGNORED_METHODS.contains(method.getName())) {
if (!IGNORED_METHODS.contains(method.getName()) && !method.isSynthetic()) {
publicMethods.add(method);
}
}
@@ -117,12 +117,9 @@ public final class ListenerConsistencyTest {
}
private static boolean isTestableMethod(Method method) {
// 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
// Also exclude getters
// Exclude getters and synthetic methods
String methodName = method.getName();
if (Modifier.isPrivate(method.getModifiers()) || methodName.contains("$") || methodName.startsWith("get") || methodName.startsWith("is")) {
if (Modifier.isPrivate(method.getModifiers()) || method.isSynthetic() || methodName.startsWith("get") || methodName.startsWith("is")) {
return false;
}
// Skip reload() method (implementation of Reloadable interface)