From f059d7c461966766ad7fc4fee0d7dd124f9bc803 Mon Sep 17 00:00:00 2001 From: Marcono1234 Date: Sat, 23 Sep 2023 17:19:58 +0200 Subject: [PATCH] Remove obsolete Error Prone warning suppressions 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 bc9e8f06b6..86ea25d556 100644 --- a/gson/src/test/java/com/google/gson/functional/Java17RecordTest.java +++ b/gson/src/test/java/com/google/gson/functional/Java17RecordTest.java @@ -72,7 +72,6 @@ public void testMultipleNamesInTheSameString() { .isEqualTo("v3"); } - @SuppressWarnings("unused") private record RecordWithCustomNames( @SerializedName("name") String a, @SerializedName(value = "name1", alternate = {"name2", "name3"}) String b) {} @@ -256,7 +255,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) {} @@ -410,9 +408,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) {} /**