65 |
Inet6Address(byte[] addr, String host) |
Inet6Address(byte[] addr, String host) |
66 |
{ |
{ |
67 |
super(addr, host); |
super(addr, host); |
68 |
this.ipaddress = addr; |
// Super constructor clones the addr. Get a reference to the clone. |
69 |
|
this.ipaddress = this.addr; |
70 |
} |
} |
71 |
|
|
72 |
/** |
/** |
195 |
*/ |
*/ |
196 |
public byte[] getAddress() |
public byte[] getAddress() |
197 |
{ |
{ |
198 |
return ipaddress; |
return (byte[]) ipaddress.clone(); |
199 |
} |
} |
200 |
|
|
201 |
/** |
/** |
234 |
if (! (obj instanceof Inet6Address)) |
if (! (obj instanceof Inet6Address)) |
235 |
return false; |
return false; |
236 |
|
|
237 |
Inet6Address tmp = (Inet6Address) obj; |
// this.ipaddress is never set in this class except to |
238 |
|
// the value of the super class' addr. The super classes |
239 |
return super.equals(tmp) && this.ipaddress == tmp.ipaddress; |
// equals(Object) will do the compare. |
240 |
|
return super.equals(obj); |
241 |
} |
} |
242 |
|
|
243 |
/** |
/** |