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 25982] New: - empty include task inside javac causes NullPointerException
Date Thu, 08 Jan 2004 12:43:50 GMT
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=25982>.
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=25982

empty include task inside javac causes NullPointerException

           Summary: empty include task inside javac causes
                    NullPointerException
           Product: Ant
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: Minor
          Priority: Other
         Component: Core tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: dawid.weiss@cs.put.poznan.pl


An empty include task inside a javac causes ANT to throw NullPointerException 
when attempting to create a StringBuffer. A sample script that causes this bug 
to show up (tested in ant 1.5.3 and 1.6.0):

<project name="cw1" basedir="." default="compile">

  <target name="compile">
     <mkdir dir="src" />
     <mkdir dir="tmp/build" />
     <javac srcdir="src" destdir="tmp/build">
            <include/>
     </javac>
  </target>
  
</project>

Stack trace:

java.lang.NullPointerException
        at java.lang.StringBuffer.<init>(StringBuffer.java:129)
        at org.apache.tools.ant.types.PatternSet$NameEntry.toString(PatternSet.j
ava:126)
        at java.lang.String.valueOf(String.java:2173)
        at java.util.AbstractCollection.toString(AbstractCollection.java:451)
        at java.util.Vector.toString(Vector.java:955)
        at java.lang.String.valueOf(String.java:2173)
        at java.lang.StringBuffer.append(StringBuffer.java:369)
        at org.apache.tools.ant.types.PatternSet.toString(PatternSet.java:476)
        at java.lang.String.valueOf(String.java:2173)
        at java.lang.StringBuffer.append(StringBuffer.java:369)
        at org.apache.tools.ant.types.AbstractFileSet.setupDirectoryScanner(Abst
ractFileSet.java:419)
        at org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(Abstra
ctFileSet.java:395)
        at org.apache.tools.ant.taskdefs.MatchingTask.getDirectoryScanner(Matchi
ngTask.java:231)
        at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:793)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:306)
        at org.apache.tools.ant.Task.perform(Task.java:401)
        at org.apache.tools.ant.Target.execute(Target.java:338)
        at org.apache.tools.ant.Target.performTasks(Target.java:365)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1237)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1094)
        at org.apache.tools.ant.Main.runBuild(Main.java:669)
        at org.apache.tools.ant.Main.startAnt(Main.java:220)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:215)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:90)


The bug is probably trivial, but still a nice thing to know your program is 
fool-proof ;)

Cheers,
Dawid

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


Mime
View raw message