You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
PiperOrigin-RevId: 636947430
0 commit comments