InetAddress.java (InetAddress): Make a private copy of the address.

2005-02-02  David Daney  <ddaney@avtrex.com>

	* java/net/InetAddress.java (InetAddress): Make a private copy of
	the address.
	* java/net/Inet4Address.java (getAddress): Return a copy of the
	address.
	* java/net/Inet6Address.java (Inet6Address): Use private copy of
	the address
	(getAddress): Return a copy of the address.
	(equals): Rewrote.

From-SVN: r94664
This commit is contained in:
David Daney
2005-02-03 17:44:20 +00:00
committed by David Daney
parent 773af5d0df
commit 4dc2f71b90
4 changed files with 20 additions and 7 deletions

View File

@@ -123,7 +123,7 @@ public class InetAddress implements Serializable
*/
InetAddress(byte[] ipaddr, String hostname)
{
addr = ipaddr;
addr = (null == ipaddr) ? null : (byte[]) ipaddr.clone();
hostName = hostname;
if (ipaddr != null)