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 8772] New: - project.setProperty(getName(), project.getProperty(someStuff)) can result in Nullpointer exceptions
Date Fri, 03 May 2002 12:03:05 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=8772>.
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=8772

project.setProperty(getName(), project.getProperty(someStuff)) can result in Nullpointer exceptions

           Summary: project.setProperty(getName(),
                    project.getProperty(someStuff)) can result in
                    Nullpointer exceptions
           Product: Ant
           Version: 1.5Beta1
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Core
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: ernst@xtramind.com


I had the following situation:

I wanted to access a property indirecly (another property hold the name
of the property I wanted to access) => something like ${${someProperty}}

I coded project.setProperty(getName(), project.getProperty(someProperty))

By a fault in my buildscript, content of someProperty was ' element'
instead of 'element' (and  ' element' was not a used property)

the result of this was the followin exception (evalProperty is the task 
containing the code above):

BUILD FAILED
java.lang.NullPointerException
        at java.util.Hashtable.put(Hashtable.java:375)
        at org.apache.tools.ant.Project.setProperty(Project.java:433)
        at EvalProperty.execute(EvalProperty.java:51)
        at org.apache.tools.ant.Task.perform(Task.java:313)
        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:1216)
        at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:357)
        at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:144)
        at ForEach_2.execute(ForEach_2.java:144)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:171)
        at org.apache.tools.ant.Task.perform(Task.java:313)
        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:1216)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1160)
        at org.apache.tools.ant.Main.runBuild(Main.java:605)
        at org.apache.tools.ant.Main.start(Main.java:195)
        at org.apache.tools.ant.Main.main(Main.java:234)

Total time: 1 second
java.lang.NullPointerException
        at java.util.Hashtable.put(Hashtable.java:375)
        at org.apache.tools.ant.Project.setProperty(Project.java:433)
        at EvalProperty.execute(EvalProperty.java:51)
        at org.apache.tools.ant.Task.perform(Task.java:313)
        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:1216)
        at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:357)
        at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:144)
        at ForEach_2.execute(ForEach_2.java:144)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:171)
        at org.apache.tools.ant.Task.perform(Task.java:313)
        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:1216)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1160)
        at org.apache.tools.ant.Main.runBuild(Main.java:605)
        at org.apache.tools.ant.Main.start(Main.java:195)
        at org.apache.tools.ant.Main.main(Main.java:234)
C:\ProjekteAufgaben\AntTasks>

--
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