anonymous constructor extension

Nic Ferrier nferrier@tapsellferrier.co.uk
Wed Apr 3 15:56:00 GMT 2002


I'm trying to compile a Paperclips class which has an anonymous class
which extends a class.
GCJ seems to be getting itself into a mess over this, the constructor
for the class I'm extending looks like this:
 public WebApp (File warPtr, String path, Hashtable inits, LogWriter log)
 throws ServiceFailure
And the anonymous class gets created like this:
 WebApp webapp = new WebApp(docRoot, pattern, initParams, logger)
 {
	
	public void init (Host mgr)
	 throws ServiceFailure
	{
	 super.init(mgr);
	 super.ddInit(serverConfig);
	}
 };
The errors I get from the (latest) CVS are:
source/gnu/paperclips/paperclips.java: In class `gnu.paperclips.paperclips1ドル':
source/gnu/paperclips/paperclips.java: In constructor 
 `(gnu.paperclips.paperclips,
 gnu.paperclips.utils.XMElement,
 java.io.File,java.lang.String,
 java.util.Hashtable,
 gnu.paperclips.LogWriter)':
source/gnu/paperclips/paperclips.java:0: 
 Exception `gnu.paperclips.ServiceFailure' must be caught, or it must
 be declared in the `throws' clause of `gnu.paperclips.paperclips1ドル'.
 <<file too short - unexpected EOF>>
 ^ 
1 error 
I have tried wrapping the creation of the anonymous class with a
try/catch but that doesn't work.
Judging by the <<file too short>> suggestion it seems to me that GCJ
is just broken in this regard (in that it's not properly managing
anonymous constructors with exceptions in their signatures).
Should I submit a bug?
Nic


More information about the Java mailing list

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