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] [Resolved] (JXPATH-177) Pipe in combination with variables causes NullPointerException
Date Tue, 24 Nov 2015 16:38:11 GMT

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

Benedikt Ritter resolved JXPATH-177.
------------------------------------
    Resolution: Not A Problem

See revision 1716199. Works on current trunk. Thanks to all for contributing.

> Pipe in combination with variables causes NullPointerException
> --------------------------------------------------------------
>
>                 Key: JXPATH-177
>                 URL: https://issues.apache.org/jira/browse/JXPATH-177
>             Project: Commons JXPath
>          Issue Type: Bug
>            Reporter: Martin Xarx
>         Attachments: TestJxPath177.java, TestJxPath177_V2.zip, jx177.zip
>
>
> xpath: name", result: ROOT name
> xpath: /x/name", result: X name
> xpath: $__root/x/name", result: X name
> xpath: $__root/x/name|name, causes:
> Exception in thread "main" java.lang.NullPointerException
> 	at org.apache.commons.jxpath.ri.model.dynamic.DynamicPointer.hashCode(DynamicPointer.java:126)
> 	at org.apache.commons.jxpath.ri.model.beans.PropertyPointer.hashCode(PropertyPointer.java:221)
> 	at java.util.HashMap.hash(HashMap.java:338)
> 	at java.util.HashMap.containsKey(HashMap.java:595)
> 	at java.util.HashSet.contains(HashSet.java:203)
> 	at org.apache.commons.jxpath.ri.model.NodePointer.compareTo(NodePointer.java:759)
> 	at java.util.ComparableTimSort.countRunAndMakeAscending(ComparableTimSort.java:316)
> 	at java.util.ComparableTimSort.sort(ComparableTimSort.java:184)
> 	at java.util.Arrays.sort(Arrays.java:1312)
> 	at java.util.Arrays.sort(Arrays.java:1506)
> 	at java.util.ArrayList.sort(ArrayList.java:1454)
> 	at java.util.Collections.sort(Collections.java:141)
> 	at org.apache.commons.jxpath.ri.EvalContext.sortPointers(EvalContext.java:206)
> 	at org.apache.commons.jxpath.ri.axes.UnionContext.setPosition(UnionContext.java:68)
> 	at org.apache.commons.jxpath.ri.axes.NodeSetContext.nextNode(NodeSetContext.java:68)
> 	at org.apache.commons.jxpath.ri.EvalContext.getSingleNodePointer(EvalContext.java:312)
> 	at org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.getPointer(JXPathContextReferenceImpl.java:464)
> 	at org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.getPointer(JXPathContextReferenceImpl.java:452)
> I'm using model created from java containers (Lists, Maps):
> {
> 	"name" : "ROOT name",
> 	"x" : {
> 		"name" : "X name"
> 	}
> }
> The context is set to the root node. I'm using the following code:
>     JXPathContext xpathContext = JXPathContext.newContext(root);
>     Pointer p = contextContext.getPointer(xpath);
>     return p.getNode();



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

Mime
View raw message