commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benedikt Ritter (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (JXPATH-113) NullPointerException in ChildContext when document only contains an empty root node
Date Tue, 24 Nov 2015 18:15:11 GMT

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

Benedikt Ritter updated JXPATH-113:
-----------------------------------
    Summary: NullPointerException in ChildContext when document only contains an empty root
node  (was: NullPointerException in ChildContext)

> NullPointerException in ChildContext when document only contains an empty root node
> -----------------------------------------------------------------------------------
>
>                 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()
> {code:java}
>     iterator = (startFromParentLocation ? parent.getParent() : parent).childIterator(nodeTest,
>                 reverse, startFromParentLocation ? parent : null);
> {code}
>     
> should be changed in my opinion to
> {code:java}
> final NodePointer actualParent = startFromParentLocation ? parent.getParent() : parent;
>         iterator = actualParent==null ? null : actualParent.childIterator(nodeTest,
>                 reverse, startFromParentLocation ? parent : null);
> {code}
> The tests triggering the error are testIssue172_CountFollowingSiblingNode and testIssue172_CountPrecedingSiblingNode



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message