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

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22705

ant 1.6alpha (and possibly earlier) requires JDK 1.4

           Summary: ant 1.6alpha (and possibly earlier) requires JDK 1.4
           Product: Ant
           Version: 1.6Alpha (nightly)
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Core tasks
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Contrary to the statement on the ant welcome page, there is a dependency on 
having JDK 1.4 or higher. The problem appears when I use the <description> tag 
to provide a project-wide description, and I also have several targets that use 
the description attribute. I run "ant -projecthelp" and get a NoSuchMethodError:

% ant -f customizations-build.xml -projecthelp
Buildfile: customizations-build.xml
java.lang.NoSuchMethodError
        at org.apache.tools.ant.types.Description.concatDescriptions 
(Description.java:123)
        at org.apache.tools.ant.types.Description.getDescription
(Description.java:104)
        at org.apache.tools.ant.Project.getDescription(Project.java:721)
        at org.apache.tools.ant.Main.printDescription(Main.java:823)
        at org.apache.tools.ant.Main.runBuild(Main.java:599)
        at org.apache.tools.ant.Main.start(Main.java:198)
        at org.apache.tools.ant.Main.main(Main.java:245)

I'm using ant 1.6alpha, but if my diagnosis of the problem is correct, this 
problem should show up with later versions of ant 1.5.x. In revision 1.9 of 
Description.java, the following snippet of code showed up:

    private static void concatDescriptions(Project project, Target t,
                                           StringBuffer description)
    {
        if( t==null ) return;
        Vector tasks= findElementInTarget(project, t, "description");
        if( tasks==null ) return;
        for( int i=0; i<tasks.size(); i++ ) {
            Task task=(Task)tasks.elementAt(i);
            if( ! ( task instanceof UnknownElement)) {
                continue;
            }
            UnknownElement ue=((UnknownElement)task);
            StringBuffer descComp=ue.getWrapper().getText();
            if( descComp != null ) {
*******************************************************
                description.append( descComp );
*******************************************************
            }
        }
    }

The offending line is the one surrounded by *'s. The problem is that the 
StringBuffer method "StringBuffer append(StringBuffer)" wasn't added until JDK 
1.4. Previously, there were many other variants of append(), but not that 
particular one.

This problem can easily be worked around by changing the line 
to "description.append( new String(descComp) );"

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

Reply via email to