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 39960] New: - NPE when trying to <copy> a custom resource
Date Tue, 04 Jul 2006 16:33:55 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=39960>.
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=39960

           Summary: NPE when trying to <copy> a custom resource
           Product: Ant
           Version: unspecified
          Platform: Other
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: stevel@apache.org


I'm trying to copy a datastream into a directory, and was curious about the
result. Its not good.

  <target name="create-file"
    xmlns:res="antlib:org.antbook.resources"
    depends="ready-to-run">
    <copy todir="build">
      <res:random size="8192"/>
    </copy>
  </target>

BUILD FAILED
C:\Personal\examples\sections\extending\ch18_extras\resources\build.xml:84: java
.lang.NullPointerException
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
a:114)
        at org.apache.tools.ant.Task.perform(Task.java:375)
        at org.apache.tools.ant.Target.execute(Target.java:356)
        at org.apache.tools.ant.Target.performTasks(Target.java:384)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1268)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1237)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
cutor.java:40)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1120)
        at org.apache.tools.ant.Main.runBuild(Main.java:685)
        at org.apache.tools.ant.Main.startAnt(Main.java:196)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:279)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:100)
Caused by: java.lang.NullPointerException
        at org.apache.tools.ant.util.ResourceUtils.selectOutOfDateSources(Resour
ceUtils.java:155)
        at org.apache.tools.ant.util.ResourceUtils.selectOutOfDateSources(Resour
ceUtils.java:123)
        at org.apache.tools.ant.taskdefs.Copy.buildMap(Copy.java:729)
        at org.apache.tools.ant.taskdefs.Copy.scan(Copy.java:661)
        at org.apache.tools.ant.taskdefs.Copy.execute(Copy.java:544)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
a:104)
        ... 11 more

If a resource must have a name for a copy, and that name may be null, there
should be a proper check and a meaningful exception.

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

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


Mime
View raw message