diff --git a/pom.xml b/pom.xml index 41cbeb7..ae33a46 100644 --- a/pom.xml +++ b/pom.xml @@ -63,7 +63,7 @@ -XDcompilePolicy=simple --should-stop=ifError=FLOW - -Xplugin:ErrorProne -XepExcludedPaths:.*/target/generated-(test-)?sources/.* + -Xplugin:ErrorProne @@ -71,11 +71,6 @@ error_prone_core 2.49.0 - - com.google.auto.value - auto-value - ${auto-value.version} - @@ -120,11 +115,6 @@ org.jacoco jacoco-maven-plugin ${jacoco.version} - - - **/AutoValue_* - - @@ -176,7 +166,6 @@ UTF-8 - 1.11.1 0.8.14 @@ -201,12 +190,6 @@ guice 6.0.0 - - com.google.auto.value - auto-value-annotations - ${auto-value.version} - provided - com.google.truth truth diff --git a/src/main/java/com/google/acai/GuiceberryCompatibilityModule.java b/src/main/java/com/google/acai/GuiceberryCompatibilityModule.java index 5543de3..dd21088 100644 --- a/src/main/java/com/google/acai/GuiceberryCompatibilityModule.java +++ b/src/main/java/com/google/acai/GuiceberryCompatibilityModule.java @@ -16,7 +16,6 @@ package com.google.acai; -import com.google.auto.value.AutoValue; import com.google.inject.AbstractModule; import com.google.inject.Inject; import com.google.inject.Injector; @@ -39,14 +38,14 @@ class GuiceberryCompatibilityModule extends AbstractModule { private static final String GUICEBRRY_TEST_SCOPED_ANNOTATION = "com.google.guiceberry.TestScoped"; private static final MethodReference GUICEBERRY_ENV_MAIN_RUN = - MethodReference.create("com.google.guiceberry.GuiceBerryEnvMain", "run"); + new MethodReference("com.google.guiceberry.GuiceBerryEnvMain", "run"); private static final MethodReference TEST_WRAPPER_RUN_BEFORE_TEST = - MethodReference.create("com.google.guiceberry.TestWrapper", "toRunBeforeTest"); + new MethodReference("com.google.guiceberry.TestWrapper", "toRunBeforeTest"); private static final MethodReference TEST_SCOPE_LISTENER_ENTERING_SCOPE = - MethodReference.create( + new MethodReference( "com.google.inject.testing.guiceberry.TestScopeListener", "enteringScope"); private static final MethodReference TEST_SCOPE_LISTENER_EXITING_SCOPE = - MethodReference.create( + new MethodReference( "com.google.inject.testing.guiceberry.TestScopeListener", "exitingScope"); @Override @@ -113,14 +112,5 @@ private static Optional> classForName(String className) { } } - @AutoValue - abstract static class MethodReference { - static MethodReference create(String className, String methodName) { - return new AutoValue_GuiceberryCompatibilityModule_MethodReference(className, methodName); - } - - abstract String className(); - - abstract String methodName(); - } + record MethodReference(String className, String methodName) {} } diff --git a/src/test/java/com/google/acai/AcaiTest.java b/src/test/java/com/google/acai/AcaiTest.java index fb9699f..270d154 100644 --- a/src/test/java/com/google/acai/AcaiTest.java +++ b/src/test/java/com/google/acai/AcaiTest.java @@ -22,7 +22,6 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -import com.google.auto.value.AutoValue; import com.google.common.testing.TearDownAccepter; import com.google.inject.AbstractModule; import com.google.inject.BindingAnnotation; @@ -283,20 +282,13 @@ private void afterTest() { } } - @AutoValue - abstract static class MethodCalls { - abstract int beforeSuite(); - - abstract int beforeTest(); - - abstract int afterTest(); - + record MethodCalls(int beforeSuite, int beforeTest, int afterTest) { static MethodCalls create() { - return new AutoValue_AcaiTest_MethodCalls(0, 0, 0); + return new MethodCalls(0, 0, 0); } static MethodCalls create(int beforeSuite, int beforeTest, int afterTest) { - return new AutoValue_AcaiTest_MethodCalls(beforeSuite, beforeTest, afterTest); + return new MethodCalls(beforeSuite, beforeTest, afterTest); } MethodCalls incrementBeforeSuite() {