InetAddress.java, URL.java: Reformated.

2003-09-29  Michael Koch  <konqueror@gmx.de>

	* java/net/InetAddress.java,
	java/net/URL.java: Reformated.

From-SVN: r71897
This commit is contained in:
Michael Koch 2003-09-29 11:24:28 +00:00 committed by Michael Koch
parent 6cd6aed790
commit 7da1da8352
3 changed files with 64 additions and 51 deletions

View file

@ -1,3 +1,8 @@
2003-09-29 Michael Koch <konqueror@gmx.de>
* java/net/InetAddress.java,
java/net/URL.java: Reformated.
2003-09-29 Bryce McKinlay <bryce@mckinlay.net.nz>
* boehm.cc (_Jv_BuildGCDescr): Put first word of object in most

View file

@ -374,48 +374,55 @@ public class InetAddress implements Serializable
*/
public String getHostAddress()
{
StringBuffer sbuf = new StringBuffer (40);
StringBuffer sb = new StringBuffer (40);
int len = addr.length;
int i = 0;
if (len == 16)
{ // An IPv6 address.
for ( ; ; i += 2)
{
if (i >= 16)
return sbuf.toString ();
return sb.toString();
int x = ((addr [i] & 0xFF) << 8) | (addr [i + 1] & 0xFF);
boolean empty = sbuf.length () == 0;
boolean empty = sb.length() == 0;
if (empty)
{
if (i == 10 && x == 0xFFFF)
{ // IPv4-mapped IPv6 address.
sbuf.append (":FFFF:");
sb.append (":FFFF:");
break; // Continue as IPv4 address;
}
else if (i == 12)
{ // IPv4-compatible IPv6 address.
sbuf.append (':');
sb.append (':');
break; // Continue as IPv4 address.
}
else if (i > 0)
sbuf.append ("::");
sb.append ("::");
}
else
sbuf.append (':');
sb.append (':');
if (x != 0 || i >= 14)
sbuf.append (Integer.toHexString (x).toUpperCase ());
sb.append (Integer.toHexString (x).toUpperCase());
}
}
for ( ; ; )
{
sbuf.append (addr[i] & 0xFF);
i++;
if (i == len)
break;
sbuf.append ('.');
}
return sbuf.toString();
for ( ; ; )
{
sb.append (addr [i] & 0xff);
i++;
if (i == len)
break;
sb.append ('.');
}
return sb.toString();
}
/**
@ -610,7 +617,7 @@ public class InetAddress implements Serializable
private static native String getLocalHostname();
/**
* Returns the local host
* Returns the local host address.
*
* @exception UnknownHostException If no IP address for the host could
* be found

View file

@ -184,6 +184,7 @@ public final class URL implements Serializable
static
{
String s = System.getProperty ("gnu.java.net.nocache_protocol_handlers");
if (s == null)
cache_handlers = true;
else