You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2008/09/16 14:43:42 UTC

DO NOT REPLY [Bug 41647] ConditionBase and TaskContainer do not work together since ant 1.6.0

https://issues.apache.org/bugzilla/show_bug.cgi?id=41647





--- Comment #1 from Stefan Bodewig <bo...@apache.org>  2008-09-16 05:43:41 PST ---
ConditionBase has public void add(Condition) since Ant 1.6 and thus the related
IntrospectionHelper instance returns true in supportsNestedElement
(addTypeMethods.size() == 1).

This in turn makes UnknownElement's handleChild method assume a child by that
name must exist and invoke getElementCreator on IntrospectionHelper which does
a more thorough check in createAddTypeCreator and realizes that <echo> is not a
condition.

This again makes handleChild throw an exception instead of returning false
which would trigger the addTask logic in handleChildren.

I see two options: (1) make IntrospectionHelper#supportsNestedElement only
return true when getElementCreator would return something or (2) catch the
exception in UnknownElement#handleChild and return false.

(1) would probably be cleaner but I'm afraid the method doesn't get all the
context it would need to be able to tell the truth.  You, Peter, should be at
least as familiar as myself with the code so I'll wait for your input ;-)


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.