Fix test / use new DataSource method / add space before keywords
This commit is contained in:
+1
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user