Bump com.google.errorprone:error_prone_core from 2.20.0 to 2.21.1 (#2463)
Suppress a couple of new Error Prone warnings.
This commit is contained in:
parent
e0cbbcc52b
commit
cdbbee4e72
|
@ -570,7 +570,11 @@ public final class TypeAdapters {
|
|||
return null;
|
||||
}
|
||||
// regrettably, this should have included both the host name and the host address
|
||||
return InetAddress.getByName(in.nextString());
|
||||
// For compatibility, we use InetAddress.getByName rather than the possibly-better
|
||||
// .getAllByName
|
||||
@SuppressWarnings("AddressSelection")
|
||||
InetAddress addr = InetAddress.getByName(in.nextString());
|
||||
return addr;
|
||||
}
|
||||
@Override
|
||||
public void write(JsonWriter out, InetAddress value) throws IOException {
|
||||
|
|
|
@ -37,6 +37,7 @@ public class DefaultInetAddressTypeAdapterTest {
|
|||
|
||||
@Test
|
||||
public void testInetAddressSerializationAndDeserialization() throws Exception {
|
||||
@SuppressWarnings("AddressSelection") // we really do want this method
|
||||
InetAddress address = InetAddress.getByName("8.8.8.8");
|
||||
String jsonAddress = gson.toJson(address);
|
||||
assertThat(jsonAddress).isEqualTo("\"8.8.8.8\"");
|
||||
|
|
Loading…
Reference in New Issue