Skip to content

Commit

Permalink
Bump com.google.errorprone:error_prone_core from 2.20.0 to 2.21.1 (#2463
Browse files Browse the repository at this point in the history
)

Suppress a couple of new Error Prone warnings.
  • Loading branch information
eamonnmcmanus committed Aug 8, 2023
1 parent e0cbbcc commit cdbbee4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,11 @@ public InetAddress read(JsonReader in) throws IOException {
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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public void setUp() throws Exception {

@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\"");
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit cdbbee4

Please sign in to comment.