ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 41058] New: - [PATCH] Support JDK 5 enumerations for attribute values
Date Tue, 28 Nov 2006 18:31:06 GMT
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=41058>.
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=41058

           Summary: [PATCH] Support JDK 5 enumerations for attribute values
           Product: Ant
           Version: 1.7.0RC1
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Core
        AssignedTo: jglick@netbeans.org
        ReportedBy: jglick@netbeans.org
                CC: dev@ant.apache.org


I have a working patch to let you use enums in place of EnumeratedAttribute,
which is more convenient and intuitive if you are using JDK 5 anyway. Example:

<project default="x">
    <target name="x">
        <echo file="T.java">
            public class T extends org.apache.tools.ant.Task {
                public enum E {
                    first,
                    second,
                    third
                }
                private E thing;
                public void setThing(E e) {
                    thing = e;
                }
                public void execute() {
                    log("thing=" + thing);
                }
            }
        </echo>
        <javac srcdir="." destdir="." includes="T.java"/>
        <taskdef name="twaddle" classname="T" classpath="."/>
        <twaddle thing="third"/>
        <antstructure output="ant.dtd"/>
        <loadfile srcfile="ant.dtd" property="ant.dtd"/>
        <echo>${ant.dtd}</echo>
    </target>
</project>

I would commit it right now but there does not seem to be a branch for 1.7 yet
and I am reluctant to add features to a release in the RC phase.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message