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 10875] New: - java.lang.NullPointerException in BaseFilterReader
Date Tue, 16 Jul 2002 17:55:57 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=10875>.
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=10875

java.lang.NullPointerException in BaseFilterReader

           Summary: java.lang.NullPointerException in BaseFilterReader
           Product: Ant
           Version: 1.6Alpha (nightly)
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Minor
          Priority: Other
         Component: Other
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: stchauvin@yahoo.com


Hi,
when running the following example (copied from the documentation):
<echo
  message="All these moments will be lost in time, like teardrops in the 
${weather}" file="loadfile1.tmp" />
<property name="weather" value="rain" />
<loadfile property="modifiedmessage" srcFile="loadfile1.tmp">
  <filterchain>
    <filterreader
classname="org.apache.tools.ant.filters.ExpandProperties"/>
  </filterchain>
</loadfile>

I have this exception:
project:
Property ${weather} has not been set
 [loadfile] loading C:\JavaLib\jakarta-ant-1.6alpha\test\loadfile1.tmp into prop
erty modifiedmessage

BUILD FAILED
java.lang.NullPointerException
        at org.apache.tools.ant.filters.ExpandProperties.read(ExpandProperties.j
ava:128)
        at org.apache.tools.ant.filters.BaseFilterReader.read(BaseFilterReader.j
ava:123)
        at java.io.Reader.read(Reader.java:102)
        at org.apache.tools.ant.util.FileUtils.readFully(FileUtils.java:793)
        at org.apache.tools.ant.filters.util.ChainReaderHelper.readFully(ChainRe
aderHelper.java:233)
        at org.apache.tools.ant.taskdefs.LoadFile.execute(LoadFile.java:194)
        at org.apache.tools.ant.Task.perform(Task.java:317)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:334)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
        at org.apache.tools.ant.Main.runBuild(Main.java:611)
        at org.apache.tools.ant.Main.start(Main.java:198)
        at org.apache.tools.ant.Main.main(Main.java:236)

Total time: 2 seconds
java.lang.NullPointerException
        at org.apache.tools.ant.filters.ExpandProperties.read(ExpandProperties.j
ava:128)
        at org.apache.tools.ant.filters.BaseFilterReader.read(BaseFilterReader.j
ava:123)
        at java.io.Reader.read(Reader.java:102)
        at org.apache.tools.ant.util.FileUtils.readFully(FileUtils.java:793)
        at org.apache.tools.ant.filters.util.ChainReaderHelper.readFully(ChainRe
aderHelper.java:233)
        at org.apache.tools.ant.taskdefs.LoadFile.execute(LoadFile.java:194)
        at org.apache.tools.ant.Task.perform(Task.java:317)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:334)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
        at org.apache.tools.ant.Main.runBuild(Main.java:611)
        at org.apache.tools.ant.Main.start(Main.java:198)
        at org.apache.tools.ant.Main.main(Main.java:236)

It looks that the project is not set when using the classname loading. 
It works fine with the built-in filter (convenience method).
It may be a problem for customized FilterReader.

Thanks,
Stephane

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


Mime
View raw message