ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: nested types with ambiguous matches
Date Fri, 23 Sep 2011 09:30:18 GMT
On 2011-09-16, Jeffrey E Care wrote:

> I'm having an issue a nested type matching multiple "add" methods on a
> task; I've added a redacted trace below. The problem is that I *want* all
> of the matching add methods to be called but Ant seems to specifically
> check if multiple add methods match & if so it keels over.

In Ant's model of the world calling multiple add methods would mean a
single nested element was mapped to mutiple objects.  This is why it
doesn't work.

> I was able to make this work by having just a single add that takes Object
> as an argument but that seems like a terrible kludge as I'm giving up type
> safety. Is there any other way to make this work?

If all of your types share the same interface you could use add with the
interface type as argument.  Otherwise or one of its friends may help, but
then you'd have to create the object rather than have Ant inject one.


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

View raw message