ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Norris Boyd <nb...@atg.com>
Subject NPE in Project.resoveFile
Date Sat, 07 Oct 2000 18:43:38 GMT
The following erroneous buildfile:

<?xml version="1.0" encoding="utf-8"?>
<project name="Foo" default="package" basedir=".">
  <target name="copy-properties" depends="prepare">
    <copydir src="../../../../../../../../foo"
           dest="."
           includes="*.java" />
  </target>
</project>

causes a NPE in Ant (v 1.1):

build.xml:8: java.lang.NullPointerException
java.lang.NullPointerException
 at java.io.File.<init>(File.java:185)
 at org.apache.tools.ant.Project.resolveFile(Project.java:492)
 at org.apache.tools.ant.taskdefs.Copydir.setSrc(Copydir.java:77)
 at java.lang.reflect.Method.invoke(Native Method)
 at
org.apache.tools.ant.IntrospectionHelper$3.set(IntrospectionHelper.java:350)

 at
org.apache.tools.ant.IntrospectionHelper.setAttribute(IntrospectionHelper.java:225)

 at org.apache.tools.ant.ProjectHelper.configure(ProjectHelper.java:435)

 at org.apache.tools.ant.ProjectHelper.access$5(ProjectHelper.java:423)
 at
org.apache.tools.ant.ProjectHelper$TaskHandler.init(ProjectHelper.java:346)

 at
org.apache.tools.ant.ProjectHelper$TargetHandler.startElement(ProjectHelper.java:327)

 at
org.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1335)
 at
org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidator.java:705)

 at
org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentScanner.java:1852)

 at
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:1233)

 at
org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:380)

 at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:861)
 at org.apache.tools.ant.ProjectHelper.parse(ProjectHelper.java:102)
 at
org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:84)

 at org.apache.tools.ant.Main.runBuild(Main.java:264)
 at org.apache.tools.ant.Main.main(Main.java:107)
Total time: 0 seconds

I tried to come up with a patch, but I wasn't sure what the best way was
to report the error and stop the build.

--Norris


Mime
View raw message