FYI: NetworkInterface.getInetAddresses() fix

Tom Tromey tromey@redhat.com
Thu Aug 24 18:19:00 GMT 2006


>>>>> "Gary" == Gary Benson <gbenson@redhat.com> writes:

Gary> This commit makes NetworkInterface.getInetAddresses() bracket IPv6
Gary> addresses before calling SecurityManager.checkConnect() with them.
Gary> This fixes http://gcc.gnu.org/ml/java/2006-08/msg00082.html.

I'm curious about one aspect of this patch...

Gary> +	    String hostAddress = addr.getHostAddress();
Gary> +	    if (addr instanceof Inet6Address)
Gary> +	      hostAddress = "[" + hostAddress + "]";

This is un-OO-like, which raises a warning flag for me.
I was wondering whether the brackets ought to be added in
Inet6Address.getHostAddress... ?

Tom



More information about the Java-patches mailing list