bug-classpath
[Top][All Lists]
Advanced

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

[Bug classpath/28241] New: Question on InetAddress.getLocalHost()


From: listkim at gmail dot com
Subject: [Bug classpath/28241] New: Question on InetAddress.getLocalHost()
Date: 4 Jul 2006 05:56:23 -0000

The InetAddress class has a static variable that maintains local host's
InetAddress. (named LOCALHOST) 

In the current implementation, the getLocalHost method creates a new instance
of InetAddress, instead of returning the already-created static variable for
the local host's InetAddress.

On the other hand, InetAddress.getByName(null) returns the static variable for
local host's InetAddress

In my opinion, it would be a better choice to return the static variable in the
getLocalHost method, too.

This seems rather ambiguous or mistakable since the two closely-related methods
return two different objects!


-- 
           Summary: Question on InetAddress.getLocalHost()
           Product: classpath
           Version: 0.92
            Status: UNCONFIRMED
          Severity: trivial
          Priority: P3
         Component: classpath
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: listkim at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28241





reply via email to

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