classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] [Patch] java.net.InetAddress


From: Michael Koch
Subject: [cp-patches] [Patch] java.net.InetAddress
Date: Wed, 13 Oct 2004 09:21:16 +0200
User-agent: Mutt/1.5.6+20040722i

Hi list,


I wrote the attached patch to add the missing method
java.net.InetAddress.getCanonicalHostName(). This evolved into a little
rewrite of InetAddress class itself and friends. The old "getHostName()"
method were wrong because it did lookups when its not supposed to do so.
I simplified InetAddress a bit too.

I have checked this with jamvm 1.2.0 but it would be nice if someone
could check it with another VM too. I added a mauve testcase for it and
with this patch applied mauve shows no new regressions.

Opinions about this ?


Michael


2004-10-13  Michael Koch  <address@hidden>

        * java/net/Inet4Address.java
        (writeReplace): Use two-argument constructor of InetAddress.
        (Inet4Address): Remove unused constructors. Use two-argument
        constructor of InetAddress in remaining constructor.
        * java/net/Inet6Address.java
        (Inet6Address): Use two-argument constructor of InetAddress.
        * java/net/InetAddress.java
        (LOCALHOST): New static field to store object for localhost.
        (static): Initialize LOCALHOST.
        (hostname_alias): Removed.
        (InetAdress): Removed hostname_alias argument.
        (getHostName): Don't handle alias anymore.
        (getCanonicalHostName): New method.
        (toString): Don't handle alias anymore.
        (getByName): Simply call getAllByName() and return its first result
        entry.
        (getAllByName): Handle null argument properly.

Attachment: net.diff
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]