From da6431b4fc8c679d3fda4a4875f422bb612ca0fc Mon Sep 17 00:00:00 2001 From: Gabriele C Date: Mon, 23 May 2016 23:16:40 +0200 Subject: [PATCH] Suppress injection test warnings --- .../java/fr/xephi/authme/initialization/FieldInjection.java | 1 + .../fr/xephi/authme/process/logout/AsynchronousLogout.java | 4 ---- .../fr/xephi/authme/initialization/FieldInjectionTest.java | 3 +++ .../authme/initialization/samples/InvalidPostConstruct.java | 2 ++ 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/fr/xephi/authme/initialization/FieldInjection.java b/src/main/java/fr/xephi/authme/initialization/FieldInjection.java index e9717b334..c74e7c279 100644 --- a/src/main/java/fr/xephi/authme/initialization/FieldInjection.java +++ b/src/main/java/fr/xephi/authme/initialization/FieldInjection.java @@ -114,6 +114,7 @@ public class FieldInjection implements Injection { return null; } + @SuppressWarnings("unchecked") private static Constructor getDefaultConstructor(Class clazz) { try { Constructor defaultConstructor = clazz.getDeclaredConstructor(); diff --git a/src/main/java/fr/xephi/authme/process/logout/AsynchronousLogout.java b/src/main/java/fr/xephi/authme/process/logout/AsynchronousLogout.java index 840ebfc9c..6cb7c77fa 100644 --- a/src/main/java/fr/xephi/authme/process/logout/AsynchronousLogout.java +++ b/src/main/java/fr/xephi/authme/process/logout/AsynchronousLogout.java @@ -1,6 +1,5 @@ package fr.xephi.authme.process.logout; -import fr.xephi.authme.AuthMe; import fr.xephi.authme.cache.auth.PlayerAuth; import fr.xephi.authme.cache.auth.PlayerCache; import fr.xephi.authme.cache.limbo.LimboCache; @@ -17,9 +16,6 @@ import javax.inject.Inject; public class AsynchronousLogout implements AsynchronousProcess { - @Inject - private AuthMe plugin; - @Inject private DataSource database; diff --git a/src/test/java/fr/xephi/authme/initialization/FieldInjectionTest.java b/src/test/java/fr/xephi/authme/initialization/FieldInjectionTest.java index 39675343e..89e460e5c 100644 --- a/src/test/java/fr/xephi/authme/initialization/FieldInjectionTest.java +++ b/src/test/java/fr/xephi/authme/initialization/FieldInjectionTest.java @@ -22,6 +22,7 @@ import static org.junit.Assert.assertThat; /** * Test for {@link FieldInjection}. */ + public class FieldInjectionTest { @SuppressWarnings("unchecked") @@ -114,6 +115,8 @@ public class FieldInjectionTest { assertThat(injection, nullValue()); } + + @SuppressWarnings("unused") private static class ThrowingConstructor { @Inject private ProvidedClass providedClass; diff --git a/src/test/java/fr/xephi/authme/initialization/samples/InvalidPostConstruct.java b/src/test/java/fr/xephi/authme/initialization/samples/InvalidPostConstruct.java index 501fad6af..1e8325495 100644 --- a/src/test/java/fr/xephi/authme/initialization/samples/InvalidPostConstruct.java +++ b/src/test/java/fr/xephi/authme/initialization/samples/InvalidPostConstruct.java @@ -6,6 +6,8 @@ import javax.inject.Inject; /** * Class with invalid @PostConstruct method. */ + +@SuppressWarnings("unused") public abstract class InvalidPostConstruct { public static final class WithParams {