Update to latest Error Prone and fix some newly-flagged problems. (#2426)
This commit is contained in:
parent
500ec501a7
commit
9cf0f8d302
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue