This is the mail archive of the java@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]

anonymous constructor extension


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.paperclips$1':
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.paperclips$1'.
   <<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


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