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:
Éamonn McManus 2023-08-08 14:21:06 -07:00 committed by GitHub
parent e0cbbcc52b
commit cdbbee4e72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 2 deletions

View File

@ -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 {

View File

@ -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\"");

View File

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