This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: FYI: NetworkInterface.getInetAddresses() fix


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]