Regression in GCJ 3.3 in parsing property files

Ranjit Mathew rmathew4lists@hotmail.com
Tue Feb 18 12:00:00 GMT 2003


> > I quickly tried gcj 3.3 and found some regression; it stops me from
> > testing gcj 3.3 on my app.
> > 
> > gcj --main=Test -o test.exe Test.java
> 
> This seems to work fine for me (i686-pc-linux-gnu, 3.4 20030217). Could
> you recompile with -g? Or does your version not yet support complete
> stacktraces?

I get the same error with Mohan's GCJ 3.3 build. 

A little bit of investigation reveals that it happens in a call 
to java.net.URLStreamHandler.parseURL( ) within the 
java.net.URL(URL, String, URLStreamHandler) constructor. 
The VMClassLoader has only "file:.\" as the base URL for 
searching the file "build.properties". 
(Note that File.separator is "\" on Windows.)

With that information, this code in URLStreamHandler.parseURL( )
looks suspect:
----------------------------- 8< -------------------------------
else if (start < end)
  {
    // Context is available, but only override it if there is a new file.
    file = file.substring(0, file.lastIndexOf('/'))
            + '/' + spec.substring(start, end);
    ref = null;
  }
----------------------------- 8< -------------------------------

This seems to assume that '/' is the file separator and this
might explain why you see it on Windows but not Linux.

Ranjit.



More information about the Java mailing list