This is the mail archive of the kawa@sourceware.org mailing list for the Kawa 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]

Re: KawaPageServlet save class problem.


On 09/29/2009 01:27 PM, Dan Stanger wrote:
If saveClass is set, the code at line 202:
     if (saveClass)
       comp.outputClass(context.getRealPath("WEB-INF/classes")+'/');
throws a null pointer exception.  I think this is because the array
classes is null in cleanupAfterCompilation, which is called by
evalModule1 at line 183.  Can this problem be corrected by moving the
outputClass before this, or is there some class processing that
evalModule1 does which would prevent this.

You need to call wait with outputClass until after loadByStages, which is called in evalClass. And evalToClass could be called multiple times, when there are dependent modules (as a brl-init file). So it could be a little tricky to cleanly and safely untangle this all.

Another minor complication is that outputClass calls
cleanupAfterCompilation.

The simplest "fix" for now is just remove/ignore the saveClass
functionality.  I don't think it's much use anymore - I'm not
sure it adds any performance benefit, so it's mainly useful
for debugging, and people may be mislead thinking it has any
other benefit.  (Of course we could work out a mechanism
so saved classes could speed up future loading; there are
some hooks for that, but they may need cleanup and testing.)

Another alternative is write the classes from the
ArrayClassLoader, though that is more work.

I suggest setting this issue aside for now, though it needs to be
resolved before we "release" the new BRL.
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/


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