You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Steele, Richard" <ri...@steelezone.net> on 2011/07/27 14:21:08 UTC
Bug 50894: Invoking multiple targets that share the same dependency
to augment a path causes NullPointerException
I keep bumping into the issue I documented in bug
50894<https://issues.apache.org/bugzilla/show_bug.cgi?id=50894>but
there's no feedback about it. Here's the description:
Using this build file:
<project>
<target name="foo" depends="aug">
<echo message="${toString:p}" />
</target>
<target name="bar" depends="aug">
<echo message="${toString:p}" />
</target>
<path id="p" />
<target name="aug">
<augment id="p">
<path>
<pathelement path="/" />
</path>
</augment>
</target>
</project>
I can invoke each target, foo and bar, independently; for example
ant foo
Buildfile:
C:\dev\projects\ant-playground\augment-with-multiple-target\build.xml
aug:
foo:
[echo] C:\
BUILD SUCCESSFUL
ant bar
Buildfile:
C:\dev\projects\ant-playground\augment-with-multiple-target\build.xml
aug:
bar:
[echo] C:\
BUILD SUCCESSFUL
However, invoking both on the same command line causes an error:
ant foo bar
Buildfile:
C:\dev\projects\ant-playground\augment-with-multiple-target\build.xml
aug:
foo:
[echo] C:\
aug:
BUILD FAILED
C:\dev\projects\ant-playground\augment-with-multiple-targets\build.xml:14:
java.lang.NullPointerException
at
org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfigurable.java:376)
at
org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfigurable.java:344)
at org.apache.tools.ant.Task.maybeConfigure(Task.java:202)
at org.apache.tools.ant.Task.perform(Task.java:347)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.Main.runBuild(Main.java:809)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
If foo and bar independently use augment, even for the same path (that is,
they
don't use depends on a shared target) like this:
<project>
<target name="foo">
<augment id="p">
<path>
<pathelement path="/" />
</path>
</augment>
<echo message="${toString:p}" />
</target>
<target name="bar">
<augment id="p">
<path>
<pathelement path="/" />
</path>
</augment>
<echo message="${toString:p}" />
</target>
<path id="p" />
</project>
the build works.
Any help getting this resolved would be much appreciated. I've tried
debugging it myself but I get lost somewhere in the deep, dark underbelly of
Ant.
Rich
Re: Bug 50894: Invoking multiple targets that share the same
dependency to augment a path causes NullPointerException
Posted by "Steele, Richard" <ri...@steelezone.net>.
Yikes, that was fast. Thanks!
Rich
On Wed, Jul 27, 2011 at 10:27 AM, Stefan Bodewig <bo...@apache.org> wrote:
> On 2011-07-27, Stefan Bodewig wrote:
>
> > On 2011-07-27, Stefan Bodewig wrote:
>
> >> On 2011-07-27, Steele, Richard wrote:
>
> >>> I keep bumping into the issue I documented in bug
> >>> 50894<https://issues.apache.org/bugzilla/show_bug.cgi?id=50894>but
> >>> there's no feedback about it.
>
> >> Sorry about that Rich. Sometimes we really need a nudge. I'm looking
> >> into it.
>
> > Working on a fix.
>
> Done
>
> Stefan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
Re: Bug 50894: Invoking multiple targets that share the same dependency to augment a path causes NullPointerException
Posted by Stefan Bodewig <bo...@apache.org>.
On 2011-07-27, Stefan Bodewig wrote:
> On 2011-07-27, Stefan Bodewig wrote:
>> On 2011-07-27, Steele, Richard wrote:
>>> I keep bumping into the issue I documented in bug
>>> 50894<https://issues.apache.org/bugzilla/show_bug.cgi?id=50894>but
>>> there's no feedback about it.
>> Sorry about that Rich. Sometimes we really need a nudge. I'm looking
>> into it.
> Working on a fix.
Done
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Bug 50894: Invoking multiple targets that share the same dependency to augment a path causes NullPointerException
Posted by Stefan Bodewig <bo...@apache.org>.
On 2011-07-27, Stefan Bodewig wrote:
> On 2011-07-27, Steele, Richard wrote:
>> I keep bumping into the issue I documented in bug
>> 50894<https://issues.apache.org/bugzilla/show_bug.cgi?id=50894>but
>> there's no feedback about it.
> Sorry about that Rich. Sometimes we really need a nudge. I'm looking
> into it.
I see what happens (it is the finally block in UnknownElement#execute
that clears the element even though it shouldn't - AugmentTask has
stolen its id so it becomes GC-eligible). Working on a fix.
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Bug 50894: Invoking multiple targets that share the same dependency to augment a path causes NullPointerException
Posted by Stefan Bodewig <bo...@apache.org>.
On 2011-07-27, Steele, Richard wrote:
> I keep bumping into the issue I documented in bug
> 50894<https://issues.apache.org/bugzilla/show_bug.cgi?id=50894>but
> there's no feedback about it.
Sorry about that Rich. Sometimes we really need a nudge. I'm looking
into it.
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org