From 06d316f1a0d01fc67373ce21a37c10f4df316027 Mon Sep 17 00:00:00 2001 From: Marcono1234 Date: Sat, 23 Sep 2023 17:33:09 +0200 Subject: [PATCH] Remove obsolete Error Prone warning suppressions (#2497) The latest Error Prone version fixed a bug which makes these suppressions obsolete. --- .../google/gson/native_test/Java17RecordReflectionTest.java | 1 - .../java/com/google/gson/functional/Java17RecordTest.java | 4 ---- 2 files changed, 5 deletions(-) diff --git a/graal-native-image-test/src/test/java/com/google/gson/native_test/Java17RecordReflectionTest.java b/graal-native-image-test/src/test/java/com/google/gson/native_test/Java17RecordReflectionTest.java index 3eb9634083..51ea11d199 100644 --- a/graal-native-image-test/src/test/java/com/google/gson/native_test/Java17RecordReflectionTest.java +++ b/graal-native-image-test/src/test/java/com/google/gson/native_test/Java17RecordReflectionTest.java @@ -27,7 +27,6 @@ import java.io.IOException; import org.junit.jupiter.api.Test; -@SuppressWarnings("UnusedVariable") // workaround for https://github.com/google/error-prone/issues/2713 class Java17RecordReflectionTest { public record PublicRecord(int i) { } diff --git a/gson/src/test/java/com/google/gson/functional/Java17RecordTest.java b/gson/src/test/java/com/google/gson/functional/Java17RecordTest.java index a707eafde5..49775c01c7 100644 --- a/gson/src/test/java/com/google/gson/functional/Java17RecordTest.java +++ b/gson/src/test/java/com/google/gson/functional/Java17RecordTest.java @@ -77,7 +77,6 @@ public void testMultipleNamesInTheSameString() { .isEqualTo("v3"); } - @SuppressWarnings("unused") private record RecordWithCustomNames( @SerializedName("name") String a, @SerializedName(value = "name1", alternate = {"name2", "name3"}) String b) {} @@ -263,7 +262,6 @@ public void testPrimitiveAdapterNullValue() { .isEqualTo("null is not allowed as value for record component 'aByte' of primitive type; at path $.aByte"); } - @SuppressWarnings("unused") private record RecordWithPrimitives( String aString, byte aByte, short aShort, int anInt, long aLong, float aFloat, double aDouble, char aChar, boolean aBoolean) {} @@ -418,9 +416,7 @@ public void testReflectionFilterBlockInaccessible() { assertThat(gson.fromJson("{\"i\":2}", PublicRecord.class)).isEqualTo(new PublicRecord(2)); } - @SuppressWarnings("unused") private record PrivateRecord(int i) {} - @SuppressWarnings("unused") public record PublicRecord(int i) {} /**