You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Peter Reilly <pe...@gmail.com> on 2009/09/15 14:12:51 UTC

Re: NPE in RuntimeConfigurable.maybeConfigure() via UnknownElement after upgrade to Ant 1.7

The ant api is very much a broken abstraction - i.e. it has not
been designed to used as an api.

One thing for sure is that if there is project field in any object,
it needs to be set. It will at some stage be used.



On Tue, Sep 15, 2009 at 11:30 AM, Wirth, Marc <ma...@sap.com> wrote:
> Hello,
>
> After upgrading our environment from Ant 1.6.4 to Ant 1.7.1 we ran into NullPointerExceptions with some of our custom tasks, something like:
>
> java.lang.NullPointerException
>        at org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfigurable.java:390)
>        at org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfigurable.java:349)
>        at org.apache.tools.ant.UnknownElement.handleChild(UnknownElement.java:568)
>        at org.apache.tools.ant.UnknownElement.handleChildren(UnknownElement.java:346)
>        at org.apache.tools.ant.UnknownElement.handleChild(UnknownElement.java:569)
>        at org.apache.tools.ant.UnknownElement.handleChildren(UnknownElement.java:346)
>        at org.apache.tools.ant.UnknownElement.configure(UnknownElement.java:198)
>
> Investigating the issue we found that we created nested UnknownElement instances in our implementation without explicitly setting the project except for the "root" element. If we explicitly set the project on each and every UnknownElement we create then the call to configure()succeeds.
>
> I'm not sure if this should be considered a bug, but at least I couldn't find anything in the documentation that this change was intentional. From the subversion repository this might be a side effect of change 450605 (http://svn.apache.org/viewvc?view=rev&revision=450605 ) but I didn't verify this in detail.
>
> Googling around for the exception I only found an older thread in the JetBrains Developer Community ( http://www.jetbrains.net/devnet/thread/265263 ) without a solution for the issue, though.
>
> Did anybody else experience problems with this? Should I open this as a bug?

I would say that this is not a bug, as the project field needs to be
set, the original code
had a latent bug that changes to internal ant usages exposed.

Peter

>
> Best regards,
> Marc
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

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