You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Michele Vivoda (JIRA)" <ji...@apache.org> on 2014/01/30 00:56:12 UTC

[jira] [Reopened] (JXPATH-113) NullPointerException in ChildContext

     [ https://issues.apache.org/jira/browse/JXPATH-113?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michele Vivoda reopened JXPATH-113:
-----------------------------------


Hi,

I just compiled JXPath and got back the NPE, code was the same as when bug was opened. After a while I think I sorted it out:

Patch was applied with a typo, using [parent] instead than [actualParent] / [useParent].

then [~ebourg] removed the check that was actually useless, revision 652903 and bug is back

So I would apply the initial proposal, as written in the bug description.


 http://mail-archives.apache.org/mod_mbox/commons-commits/200805.mbox/%3C20080502204633.322742388A08@eris.apache.org%3E

> NullPointerException in ChildContext
> ------------------------------------
>
>                 Key: JXPATH-113
>                 URL: https://issues.apache.org/jira/browse/JXPATH-113
>             Project: Commons JXPath
>          Issue Type: Bug
>            Reporter: Michele Vivoda
>            Priority: Minor
>             Fix For: 1.3
>
>
> In ChildContext I get a NullPointerException, the error appears in method prepare()
>     iterator = (startFromParentLocation ? parent.getParent() : parent).childIterator(nodeTest,
>                 reverse, startFromParentLocation ? parent : null);
>     
> should be changed in my opinion to
> final NodePointer actualParent = startFromParentLocation ? parent.getParent() : parent;
>         iterator = actualParent==null ? null : actualParent.childIterator(nodeTest,
>                 reverse, startFromParentLocation ? parent : null);
> The tests triggering the error are testIssue172_CountFollowingSiblingNode and testIssue172_CountPrecedingSiblingNode



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)