Re: RFR 8004675: Inet6Address.getHostAddress should use string scope identifier where available
On 12/10/2012 07:37 PM, Kurchi Hazra wrote: Looks good to me. Thanks Kurchi. Not related to this bug, but do we need scope_id_set then? From what I infer, scope_id_set is being set in native code, only when scope_id is not 0, and so a check with scope_id == 0 can serve the purpose of scope_id_set too. You are right. 'scope_id_set' seems to be used in a similar manner. Unfortunately, there seems to be at least on path where a scope_id of 0 is allowable, the package private construction "Inet6Address(String,byte[],int). For now, I'd like to leave this. It will require further careful analysis to determine if there is a possible visible impact of making such a change. Thanks for the detailed review. -Chris. Thanks, Kurchi On 10.12.2012 08:01, Chris Hegarty wrote: Inet6Address.getHostAddress() is specified to return the IP address string in textual presentation, followed by a '%' character and the scope identifier. This scope identifier can be either a numeric value or a string, depending on how the instance was created (if it was created with a scoped interface). This change proposes to remove the boolean field, 'scope_ifname_set', since it is not always correctly set when the instance contains a valid scoped interface. For example, when iterating over the NetworkInterface's on the system. 'scope_ifname_set' was never accessed from native code, so it can simply be removed. http://cr.openjdk.java.net/~chegar/8004675/webrev.00/webrev/ -Chris.
Re: RFR 8004675: Inet6Address.getHostAddress should use string scope identifier where available
On 10/12/12 16:01, Chris Hegarty wrote: Inet6Address.getHostAddress() is specified to return the IP address string in textual presentation, followed by a '%' character and the scope identifier. This scope identifier can be either a numeric value or a string, depending on how the instance was created (if it was created with a scoped interface). This change proposes to remove the boolean field, 'scope_ifname_set', since it is not always correctly set when the instance contains a valid scoped interface. For example, when iterating over the NetworkInterface's on the system. 'scope_ifname_set' was never accessed from native code, so it can simply be removed. http://cr.openjdk.java.net/~chegar/8004675/webrev.00/webrev/ -Chris. Looks fine. Michael
Re: RFR 8004675: Inet6Address.getHostAddress should use string scope identifier where available
On 12/10/2012 09:06 PM, Dmitry Samersoff wrote: Chris, Looks good for me. Thank you Dmitry, PS: Inet6Address.java: It's not necessary to remove explicit initializations - compiler do it perfectly for you. This is a pet peeve of mine. I don't like to see them in code. javac generates extra bytecodes to initialize these fields, and in most cases it is completely unnecessary. Just take a look at the output of a simple test. -Chris. -Dmitry On 2012-12-10 20:01, Chris Hegarty wrote: Inet6Address.getHostAddress() is specified to return the IP address string in textual presentation, followed by a '%' character and the scope identifier. This scope identifier can be either a numeric value or a string, depending on how the instance was created (if it was created with a scoped interface). This change proposes to remove the boolean field, 'scope_ifname_set', since it is not always correctly set when the instance contains a valid scoped interface. For example, when iterating over the NetworkInterface's on the system. 'scope_ifname_set' was never accessed from native code, so it can simply be removed. http://cr.openjdk.java.net/~chegar/8004675/webrev.00/webrev/ -Chris.
Re: RFR 8004675: Inet6Address.getHostAddress should use string scope identifier where available
Chris, Looks good for me. PS: Inet6Address.java: It's not necessary to remove explicit initializations - compiler do it perfectly for you. -Dmitry On 2012-12-10 20:01, Chris Hegarty wrote: > > Inet6Address.getHostAddress() is specified to return the IP address > string in textual presentation, followed by a '%' character and the > scope identifier. This scope identifier can be either a numeric value or > a string, depending on how the instance was created (if it was created > with a scoped interface). > > This change proposes to remove the boolean field, 'scope_ifname_set', > since it is not always correctly set when the instance contains a valid > scoped interface. For example, when iterating over the > NetworkInterface's on the system. 'scope_ifname_set' was never accessed > from native code, so it can simply be removed. > > http://cr.openjdk.java.net/~chegar/8004675/webrev.00/webrev/ > > -Chris. -- Dmitry Samersoff Oracle Java development team, Saint Petersburg, Russia * Give Rabbit time, and he'll always get the answer
Re: RFR 8004675: Inet6Address.getHostAddress should use string scope identifier where available
Looks good to me. Not related to this bug, but do we need scope_id_set then? From what I infer, scope_id_set is being set in native code, only when scope_id is not 0, and so a check with scope_id == 0 can serve the purpose of scope_id_set too. Thanks, Kurchi On 10.12.2012 08:01, Chris Hegarty wrote: Inet6Address.getHostAddress() is specified to return the IP address string in textual presentation, followed by a '%' character and the scope identifier. This scope identifier can be either a numeric value or a string, depending on how the instance was created (if it was created with a scoped interface). This change proposes to remove the boolean field, 'scope_ifname_set', since it is not always correctly set when the instance contains a valid scoped interface. For example, when iterating over the NetworkInterface's on the system. 'scope_ifname_set' was never accessed from native code, so it can simply be removed. http://cr.openjdk.java.net/~chegar/8004675/webrev.00/webrev/ -Chris. -- -Kurchi