commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michele Vivoda (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (JXPATH-177) Pipe in combination with variables causes NullPointerException
Date Thu, 18 Jun 2015 19:45:00 GMT

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

Michele Vivoda commented on JXPATH-177:
---------------------------------------

Seems that the test fails with jxpath 1.3 but passes with the current trunk, can you check
it ? I updated the test

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

> 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, 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