Fix 1.7 and 1.8 compatibility

This commit is contained in:
sgdc3
2017-10-01 19:53:15 +02:00
parent d9399568a3
commit 843baa8e4a
3 changed files with 39 additions and 23 deletions
@@ -32,7 +32,7 @@ public final class ListenerConsistencyTest {
"PlayerListener#onPlayerQuit", "ServerListener#onPluginDisable",
"ServerListener#onServerPing", "ServerListener#onPluginEnable",
"PlayerListener#onJoinMessage", "PlayerListener#onAsyncPlayerPreLoginEvent",
"PlayerListener#onPlayerSpawn");
"PlayerListener19#onPlayerSpawn");
@BeforeClass
public static void collectListenerClasses() {
@@ -120,7 +120,9 @@ public final class ListenerConsistencyTest {
// 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
if (Modifier.isPrivate(method.getModifiers()) || method.getName().contains("$")) {
// Also exclude getters
String methodName = method.getName();
if (Modifier.isPrivate(method.getModifiers()) || methodName.contains("$") || methodName.startsWith("get") || methodName.startsWith("is")) {
return false;
}
// Skip reload() method (implementation of Reloadable interface)