success building jetty 5 w/ gcj 4.0.2?

Nelson Sproul nelson.sproul@gmail.com
Thu Mar 2 21:12:00 GMT 2006


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. 
(Interestingly, LineInput.java has significantly < 884 lines -- what
is going on here?)
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
So at this stage, I'm not sure whether the project is simply in
feasible, or if there is some clever workaround. Any advice would be
welcomed.
--
Nelson


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /