mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-23 15:01:17 +08:00
Inet6Address.java (getHostAddress): Fix textual representation of IPv6 address with embedded zeroes to conform to...
2004-11-18 Mattias Rehnberg <Mattias.Rehnberg@home.se> * java/net/Inet6Address.java (getHostAddress): Fix textual representation of IPv6 address with embedded zeroes to conform to RFC 2373. From-SVN: r90874
This commit is contained in:
parent
3d8532aa2a
commit
4fdb8244ae
@ -1,3 +1,9 @@
|
||||
2004-11-18 Mattias Rehnberg <Mattias.Rehnberg@home.se>
|
||||
|
||||
* java/net/Inet6Address.java (getHostAddress): Fix textual
|
||||
representation of IPv6 address with embedded zeroes
|
||||
to conform to RFC 2373.
|
||||
|
||||
2004-11-18 Jeroen Frijters <address@bogus.example.com>
|
||||
|
||||
* java/lang/StackTraceElement.java: Made final.
|
||||
|
@ -207,18 +207,11 @@ public final class Inet6Address extends InetAddress
|
||||
for (int i = 0; i < 16; i += 2)
|
||||
{
|
||||
int x = ((ipaddress[i] & 0xFF) << 8) | (ipaddress[i + 1] & 0xFF);
|
||||
boolean empty = sbuf.length() == 0;
|
||||
|
||||
if (empty)
|
||||
{
|
||||
if (i > 0)
|
||||
sbuf.append("::");
|
||||
}
|
||||
else
|
||||
if (i > 0)
|
||||
sbuf.append(':');
|
||||
|
||||
if (x != 0 || i >= 14)
|
||||
sbuf.append(Integer.toHexString(x));
|
||||
sbuf.append(Integer.toHexString(x));
|
||||
}
|
||||
|
||||
return sbuf.toString();
|
||||
|
Loading…
x
Reference in New Issue
Block a user