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/04/11 18:46:19 UTC

[jira] [Comment Edited] (JXPATH-113) NullPointerException in ChildContext

    [ https://issues.apache.org/jira/browse/JXPATH-113?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13914421#comment-13914421 ] 

Michele Vivoda edited comment on JXPATH-113 at 4/11/14 4:44 PM:
----------------------------------------------------------------

Hi [~ebourg] , I did the pull request some time ago but is still there. 

https://github.com/apache/commons-jxpath/pulls


was (Author: vivodamichele@hotmail.com):
Hi [~ebourg] , I did the pull request some time ago but is still there. 

https://github.com/apache/commons-jxpath/pull/

> 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.2#6252)