This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Patch: Account for possible null laddr in Socket.java
- From: Michael Koch <konqueror at gmx dot de>
- To: gnustuff at thisiscool dot com
- Cc: GCJ Patches <java-patches at gcc dot gnu dot org>
- Date: Tue, 17 Jun 2003 14:19:21 +0200
- Subject: Re: Patch: Account for possible null laddr in Socket.java
- References: <QP197A6A8E0WRXSB0HFURDCB9LB7.3eee94c5@d7500>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Am Dienstag, 17. Juni 2003 06:10 schrieb Mohan Embar:
> Hi Michael,
>
> >> I'm reading the J2SE 1.4.0 documentation and don't see anywhere
> >> that raddr is allowed to be null. In fact, the documentation for
> >> Socket(InetAddress, int, boolean) seems to imply the contrary
> >> (cf. "If there is a security manager, its checkConnect method is
> >> called with host.getHostAddress() and port as its arguments.").
> >>
> >> Nor do I see that we are explicitly passing an raddr==null from
> >> one constructor call to another.
> >>
> >> Am I missing something?
> >
> >Well, I should better explane this.
> >
> >The currect version is like this:
> >
> >connect (new InetSocketAddress (raddr, rport));
> >
> >If raddr is null then InetSocketAddress will assign the wildcard
> >address.
> >
> >connect cannot connect to a wildcard address. IOException.
>
> No, if raddr is null then a NullPointerException gets thrown
> in the InetSocketAddress constructor via addr.getHostName()
Then there is a bug too, null means wildcard address. I will fis this.
Michael
- --
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQE+7wdJWSOgCCdjSDsRArQ8AJoCJ7LTe08kus10uZ+o22Pi+00hYwCghhZi
Pqn25mgAxkUWg3L8RRnt2eY=
=9FO1
-----END PGP SIGNATURE-----