[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cp-patches] RFC: java.net.InetAddress.toString() returns wrong addr
From: |
Mark Wielaard |
Subject: |
Re: [cp-patches] RFC: java.net.InetAddress.toString() returns wrong address |
Date: |
Sun, 01 Jan 2006 15:46:23 +0100 |
Hi Christian,
On Thu, 2005-12-29 at 19:37 +0100, Christian Thalinger wrote:
> While checking some FAILs in tgolem i stumbled across this common fail:
>
> FAIL: gnu.testlet.java.net.InetSocketAddress.InetSocketAddressTest:
> Error : test_Constructors failed - 1 No wildcard address returned
> (number 1)
>
> I searched a bit and i think toString() returns the wrong value. Is
> this correct?
>
> 2005-12-29 Christian Thalinger <address@hidden>
>
> * java/net/InetAddress.java (toString): Return
> 0.0.0.0 for null hostname.
I don't think this is correct. null as hostname just means the hostname
has not yet been looked up, and toString() is explicitly lazy and
doesn't do lookups itself.
I actually think the Mauve test is incorrect since it assumes 0.0.0.0 is
always the INADDR_ANY used and that the hostName for such an address is
automagically resolved.
I would propose to either change the Mauve test to be less strict in
checking. Or if you feel IF_ANY should always have a resolved hostname
to eagerly resolve it by adding something like this to
InetAddress.getInaddrAny: inaddr_any.hostName = naddr_any.getHostName();
Cheers,
Mark
signature.asc
Description: This is a digitally signed message part
- Re: [cp-patches] RFC: java.net.InetAddress.toString() returns wrong address,
Mark Wielaard <=