You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Adam Murdoch <ad...@yahoo.com> on 2001/12/18 02:27:59 UTC

[PATCH] IntrospectionHelper

Hi,

A tiny patch to IntrospectionHelper.  This fixes the case where a class has
an 'addConfigured' method and an 'add' or 'create' method for the same
element.  Depending on the order that Class.getMethods() returns the class'
methods, Ant will sometimes call both methods, and sometimes call only one
of them.

This patch fixes this so that Ant will only ever call one of the
'addConfigured', 'add' or 'create' methods for a nested element.


Adam

Re: [PATCH] IntrospectionHelper

Posted by Stefan Bodewig <bo...@apache.org>.
On Wed, 19 Dec 2001, Adam Murdoch <ad...@yahoo.com> wrote:

> The plan (for the patch) was to treat them all equally and just pick
> up the last one it finds.

And it does, sorry.

> Making addConfigured the preferred method (over create and add)
> seems like a good thing.  Could just be a recommendation in the doc.

At least that would be a start 8-)

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: [PATCH] IntrospectionHelper

Posted by Adam Murdoch <ad...@yahoo.com>.

> From: Stefan Bodewig [mailto:bodewig@apache.org]
>
> > This patch fixes this so that Ant will only ever call one of the
> > 'addConfigured', 'add' or 'create' methods for a nested element.
>
> It does so in a way that addConfigured will always be ignored if one
> of the other two methods is present.  addConfigured seems to be the
> "higher level" of add, so I'd like to see it take precedence if it is
> present.
>

The plan (for the patch) was to treat them all equally and just pick up the
last one it finds.  IntrospectionHelper was almost doing that, it just
wasn't cleaning out nestedStorers if it got a create or add method *after*
an addConfigured.  Which meant you'd end up with the create/add method in
nestedCreators, and the addConfigured in nestedStorers.

> Conor, any opinion here?  You've invented addConfigured.
>
> Others?
>

Making addConfigured the preferred method (over create and add) seems like a
good thing.  Could just be a recommendation in the doc.


Adam


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [PATCH] IntrospectionHelper

Posted by Stefan Bodewig <bo...@apache.org>.
I didn't realize that this could happen, so thanks for the heads up.

On Tue, 18 Dec 2001, Adam Murdoch <ad...@yahoo.com> wrote:

> This patch fixes this so that Ant will only ever call one of the
> 'addConfigured', 'add' or 'create' methods for a nested element.

It does so in a way that addConfigured will always be ignored if one
of the other two methods is present.  addConfigured seems to be the
"higher level" of add, so I'd like to see it take precedence if it is
present.

Conor, any opinion here?  You've invented addConfigured.

Others?

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>