ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Magesh Umasankar" <>
Subject Re: addXXX related question
Date Sun, 03 Mar 2002 17:25:39 GMT
From: "Peter Donald" <>

> On Sun, 3 Mar 2002 20:02, Magesh Umasankar wrote:
> > The problem seems to be in IntrospectionHelper/
> > ProjectHelper.  If the method name begins with
> > "add", IntrospectionHelper requires to be able to
> > create an instance of the argument, whether
> > it is used as an element in the build file or not.
> > If it does not find the class, it throws a
> > NoClassDefFoundError.
> It is a feature of classloading. When you define the FilterChain class you
> need to able to define all classes it uses -

I should be able to define all classes it uses, yes.  But
why should I be forced to be able to instantiate them?

> when you use reflection you
> force the class to be fully defined. Thus it will try to load BCEL anytime
> you perform reflection on FilterChain.

FilterChain uses ClassConstants - that is all.  It doesn't
know about bcel until it tries to instantiate ClassConstants...
Why should it be trying to instantiate elements that have
not been added in the build file.  From the code, I see that
each "add" method's element's constructor is obtained
and an object of the class created.  I still do not understand
the reason behind this...

> A way around this would to provide an interface+wrapper type system. Take
> look at how the mappers or regex objects behave to see what I mean.

Yes, seems like a wrapper would be needed...  But still,
why the extra layer?  Or am I totally missing something?

> Pete


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message