Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change InetAddress-String conversion methods to preserve the scope ID. #7231

Closed
wants to merge 0 commits into from

Conversation

copybara-service[bot]
Copy link
Contributor

Change InetAddress-String conversion methods to preserve the scope ID.

This matches the behavior in https://bugs.openjdk.org/browse/JDK-8272215 (except still not supporting brackets [])

RELNOTES=net: Changed InetAddress-String conversion methods to preserve the scope ID. This may lead to two kinds of problems: First, callers of those methods may be relying on the returned values not to include the scope ID. For example, they might compensate for the old behavior of the methods by appending the scope ID to a returned string themselves. (If so, you can update your code to stop doing so at the same time as you upgrade Guava. Of, if your code might run against multiple versions of Guava, you can check whether Guava included a scope ID before adding one yourself.) Or they may pass the returned string to another system that does not understand scope IDs. (If so, you can strip the scope ID off, whether by truncating the string form at a % character (leaving behind any trailing ] character in the case of forUriString) or by replacing the returned InetAddress with a new instance constructed by calling InetAddress.getByAddress(addr). The other possible cause for problems is that java.net.InetAddress validates any provided scope ID against the interfaces available on the machine. As a result, methods in InetAddresses may now fail if the scope ID fails validation, including if the code runs in an Android app without networking permission. If this is not the behavior that you want, then you can strip off the scope ID from the input string before passing it to Guava, as discussed above.

@copybara-service copybara-service bot force-pushed the test_630457079 branch 7 times, most recently from a05c5c3 to 1b310a6 Compare May 24, 2024 15:34
@copybara-service copybara-service bot closed this May 24, 2024
@copybara-service copybara-service bot deleted the test_630457079 branch May 24, 2024 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

0 participants