Update to latest Error Prone and fix some newly-flagged problems. (#2426)

This commit is contained in:
Éamonn McManus 2023-06-19 14:22:28 -07:00 committed by GitHub
parent 500ec501a7
commit 9cf0f8d302
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 6 deletions

View File

@ -33,6 +33,7 @@ public class NonNullElementWrapperList<E> extends AbstractList<E> implements Ran
// Explicitly specify ArrayList as type to guarantee that delegate implements RandomAccess
private final ArrayList<E> delegate;
@SuppressWarnings("NonApiType")
public NonNullElementWrapperList(ArrayList<E> delegate) {
this.delegate = Objects.requireNonNull(delegate);
}

View File

@ -691,6 +691,7 @@ public class DefaultTypeAdaptersTest {
assertThat(treeSet).contains("Value1");
}
@SuppressWarnings("UnnecessaryStringBuilder") // TODO: b/287969247 - remove when EP bug fixed
@Test
public void testStringBuilderSerialization() {
StringBuilder sb = new StringBuilder("abc");

View File

@ -60,11 +60,14 @@ public class ExposeFieldsTest {
ClassWithExposedFields[] objects = { object1, object2, object3 };
String json = gson.toJson(objects);
String expected = new StringBuilder()
.append('[').append(object1.getExpectedJson()).append(',')
.append(object2.getExpectedJson()).append(',')
.append(object3.getExpectedJson()).append(']')
.toString();
String expected =
'['
+ object1.getExpectedJson()
+ ','
+ object2.getExpectedJson()
+ ','
+ object3.getExpectedJson()
+ ']';
assertThat(json).isEqualTo(expected);
}

View File

@ -150,7 +150,7 @@
<path>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>2.19.1</version>
<version>2.20.0</version>
</path>
</annotationProcessorPaths>
</configuration>