DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=29499>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=29499

<presetdef> does not appear to work with both URI and nested elements





------- Additional Comments From [EMAIL PROTECTED]  2004-06-10 16:04 -------
The first problem is a consequence of the way
namespace handling is done in ant 1.6.0 and ant.6.1

One needs to do:

            <jar destfile="test-2.jar">
                <fileset dir="." xmlns="http://nowhere.net/";>
                    <include name="presetdef-test.xml"/>
                </fileset>
            </jar>
Since the <fileset> element tree is stored up and applied to
the <http://nowhere.net/:jar> task later.
The plan for ant 1.6.2 is that namespaced tasks will accept
nested elements from both the namespace of the task and the
default ant namespace.
In this case, your <presetdef> will work.

The second problem is due to the mechanism of reporting
the taskname. The code has an object which may be hidden
behind an adaptor. The code does a reverse lookup of this
in ComponentHelper#getElementName(), which looks like:

    public String getElementName(Object element) {
        //  PR: I do not know what to do if the object class
        //      has multiple defines
        //      but this is for logging only...
        Class elementClass = element.getClass();
        for (Iterator i = antTypeTable.values().iterator(); i.hasNext();) {
            AntTypeDefinition def = (AntTypeDefinition) i.next();
            if (elementClass == def.getExposedClass(project)) {
                return "The <" + def.getName() + "> type";
            }
        }
        return "Class " + elementClass.getName();
    }

In this case the object given is of the class org.apache.tools.ant.Jar
which is now in the anttypetable three times.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to