This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch: java.net.InetAddress


On Sat, 29 Nov 2003, Michael Koch wrote:
> > I'm questioning though if you've found the root of the implementation
> > difference.
>
> my test is:
>
>
> import java.net.InetSocketAddress;
>
> public class T
> {
>   public static void main(String[] args) throws exception
>   {
>     InetSocketAddress addr = new InetSocketAddress(0);
>   }
> }

Ah yes... I wasn't looking at InetSocketAddress.

Your test relies on resolving ANY_IF, which happens at most once since
ANY_IF is a static member.  Doesn't the following simpler patch accomplish
the same thing?

Jeff

Index: InetAddress.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/net/InetAddress.java,v
retrieving revision 1.25
diff -u -p -r1.25 InetAddress.java
--- InetAddress.java    28 Nov 2003 22:01:29 -0000      1.25
+++ InetAddress.java    29 Nov 2003 14:44:57 -0000
@@ -82,7 +82,7 @@ public class InetAddress implements Seri
       }

     byte[] zeros = { 0, 0, 0, 0 };
-    ANY_IF = new InetAddress (zeros, null);
+    ANY_IF = new InetAddress (zeros, "0.0.0.0");
   }

   /**



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]