Inet4Address.java: Merged file header and javadocs.

2004-10-18  Michael Koch  <konqueror@gmx.de>

	* java/net/Inet4Address.java: Merged file header and javadocs.
	* java/net/Inet6Address.java: Likewise.
	* java/net/InetAddress.java
	(getCanonicalHostName): Create Inet4Address object instead of
	InetAddress and add comment regarding IPv6.
	(toString): Simplified.

From-SVN: r89211
This commit is contained in:
Michael Koch 2004-10-18 12:36:27 +00:00 committed by Michael Koch
parent 2c661756f4
commit df397ce2bd
4 changed files with 31 additions and 31 deletions

View file

@ -313,7 +313,7 @@ public class InetAddress implements Serializable
{
try
{
sm.checkConnect (hostName, -1);
sm.checkConnect(hostName, -1);
}
catch (SecurityException e)
{
@ -322,7 +322,8 @@ public class InetAddress implements Serializable
}
// Try to find the FDQN now
InetAddress address = new InetAddress (getAddress(), null);
// FIXME: This does not work with IPv6.
InetAddress address = new Inet4Address(getAddress(), null);
return address.getHostName();
}
@ -487,14 +488,8 @@ public class InetAddress implements Serializable
*/
public String toString()
{
String host;
String address = getHostAddress();
if (hostName != null)
host = hostName;
else
host = address;
String host = (hostName != null) ? hostName : address;
return host + "/" + address;
}