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: FYI: Patch: java.net.URLStreamHandler


On Thu, Oct 30, 2003 at 01:13:14PM +0100, Michael Koch wrote:
> On Thu, Oct 30, 2003 at 01:13:07PM +1300, Bryce McKinlay wrote:
> > On Oct 30, 2003, at 11:54 AM, Mark Wielaard wrote:
> > 
> > >BTW. The above example should also make the comment (that your new 
> > >patch
> > >now also removes) more clear. Another solution would be to not print 
> > >the
> > >port number when the host field is null, but we choose not to do this
> > >since we think that is not according to spec (even though some
> > >implementations seem to do it that way).
> > 
> > If we print the port number without a host name, then (I suspect) it 
> > would not be a valid URL. The best solution IMO would be to change it 
> > to something like:
> > 
> > if (hostName.length() == 0)
> >   {
> >     .. print hostname ...
> >     if (port >= 0)
> >       {
> >          ... print port
> >       }
> >   }
> > 
> > This way we can get rid of the comment, and match the JDK behaviour.
> > 
> > (0 actually is a valid TCP port number, iirc, so I guess we should be 
> > able to print it)
> 
> What about the attached patch ? Does everyone agree with it ?

The patch has a little bug, it didnt accept valid port number 0.
Here is a revised patch.


Michael

Attachment: url.diff
Description: Text document


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