Leon Messerschmidt wrote:
> 
> Hi Geir,
> 
> Your EventCartridge architecture looks cool to me - or it solves my problem
> at least :-).  I haven't done a full range of tests but I can happily
> replace XML entities.
> 
> Just one problem:  If you don't add NullReferenceEventHandlers the
> getNullReferenceHandlerArray() method returns null.  With a null reference
> you get a NPE in line 243...

That's not good.  I'll fix that.
> 
> I'm not exactly clued up with all this, so allow me one question.  Would it
> be better to instead of this:
> 
>             Object[] oarr = nrehList.toArray();
>             nrehArr = new NullReferenceEventHandler[ oarr.length ];
>             System.arraycopy( oarr, 0, nrehArr, 0, oarr.length);
> 
> do this?
> 
>             NullReferenceEventHandler[] dummy = new
> NullReferenceEventHandler[0];
>             nrehArr = nrehList.toArray(dummy);
>

I think it's fundamentally the same thing, but your solution may be
faster as it may save the internal conversion step.  I'll do some tests
(mainly because I am curious - Java performance is an interesting thing
to explore - diddle with the various String->Integer parsing
possiblities sometime...) and then use the faster one.

> I haven't tested it but my intuition says that the second would be faster
> that copying arrays around?

most likely.
 
> Will EventCartridge make its way into the main source tree?  What needs to
> be done before it can happen?

Well, I am going to do the 1.0.1-rc1 release this morning (ran out of
gas last night...).  I am hoping for some more feedback from Jose.  If
there is no serious opposition, we then tag the source tree and start
arguing about chaining, I guess.

I will fix and put a jar in whiteboard so you have a working jar to work
with.

geir

-- 
Geir Magnusson Jr.                               [EMAIL PROTECTED]
Developing for the web?  See http://jakarta.apache.org/velocity/

Reply via email to