success building jetty 5 w/ gcj 4.0.2?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

success building jetty 5 w/ gcj 4.0.2?

Nelson Sproul

success building jetty 5 w/ gcj 4.0.2?

 

Whether building from source or from class files, gcj produces fatal errors which make me wonder whether it is possible to build jetty 5 w/ gcj 4.0.2.

 

When building from source, gcj is confused by statically initialized code blocks, and ends up making spurious complaints about duplicate variable definitions:

 

org\mortbay\http\handler\ProxyHandler.java:93: error: Variable 'o' is already defined in this method and was declared 'Object o' at line 75.

           Object o = new Object();

                  ^

org\mortbay\http\handler\ProxyHandler.java:105: error: Variable 'o' is already defined in this method and was declared 'Object o' at line 75.

           Object o = new Object();

                  ^

2 errors

 

But this is false, as the variable 'o' which is already defined what is in a statically initialized code block, which should be considered a separate scope.

 

Here is the relevant code, from ProxyHandler.java:

 

/* ------------------------------------------------------------ */

    /**

     * Map of leg by leg headers (not end to end). Should be a set, but more efficient string map is

     * used instead.

     */

    protected StringMap _DontProxyHeaders = new StringMap();

    {

        Object o = new Object();

        _DontProxyHeaders.setIgnoreCase(true);

        _DontProxyHeaders.put(HttpFields.__ProxyConnection, o);

        _DontProxyHeaders.put(HttpFields.__Connection, o);

        _DontProxyHeaders.put(HttpFields.__KeepAlive, o);

        _DontProxyHeaders.put(HttpFields.__TransferEncoding, o);

        _DontProxyHeaders.put(HttpFields.__TE, o);

        _DontProxyHeaders.put(HttpFields.__Trailer, o);

        _DontProxyHeaders.put(HttpFields.__Upgrade, o);

    }

 

    /* ------------------------------------------------------------ */

    /**

     * Map of leg by leg headers (not end to end). Should be a set, but more efficient string map is

     * used instead.

     */

    protected StringMap _ProxyAuthHeaders = new StringMap();

    {

        Object o = new Object();

        _ProxyAuthHeaders.put(HttpFields.__ProxyAuthorization, o);

        _ProxyAuthHeaders.put(HttpFields.__ProxyAuthenticate, o);

    }

 

Compiling from class files seems to avoid this category of problem, but yields another fatal error which I don't know what to do with. 

 

org/mortbay/util/LineInput.java: In class 'org.mortbay.http.HttpConnection':

org/mortbay/util/LineInput.java: In method 'org.mortbay.http.HttpConnection.handleNext()':

org/mortbay/util/LineInput.java:884: error: verification error at PC=1242

org/mortbay/util/LineInput.java:884: error: types could not be merged

 

(Interestingly, LineInput.java has significantly < 884 lines -- what is going on here?)

 

So at this stage, I'm not sure whether the project is simply infeasible, or if there is some clever workaround.  Any advice would be welcomed.

 

 

Nelson Sproul
Sr. Software Engineer
Phone: 415.399.7125
[hidden email]

BEA Systems, Inc.
500 Sansome St.
San Francisco, CA 94111
www.bea.com