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: URLStreamHandler.parseURL() (was RE: Patch: more protocol fun in URL)


Mohan Embar wrote:
> You have removed this block:
> 
> -if (lastSlash < 0 && File.separatorChar != sepChar
> -    && url.getProtocol().equals("file"))
> -  {
> -    // On Windows, even '\' is allowed in a "file" URL.
> -    sepChar = File.separatorChar;
> -    lastSlash = file.lastIndexOf(sepChar);
> -  }
> 
> ...and have replaced it with this:
> 
> +int lastSlash = file.lastIndexOf('/');
> 
> ...but nowhere in your patch have you changed the
> original contents of the file variable, which contains
> this backslash.

Thanks, I see what you mean now. I still disagree with it though ;-)
AFAIK, on Windows a '\' is not valid in a url, so URL.getFile() should
always return a '/' separated path. If it doesn't do that, then this
should be fixed, but I don't think the problem is here.

Regards,
Jeroen


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