[
https://issues.apache.org/jira/browse/JXPATH-170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14164734#comment-14164734
]
Gary Gregory commented on JXPATH-170:
-------------------------------------
[~guargua]: Can you confirm that this is fixed as commented in
https://issues.apache.org/jira/browse/JXPATH-170?focusedCommentId=14131085&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14131085
?
> NullPointerException using
> org.apache.commons.jxpath.ri.model.dynamic.DynamicPointer
> ------------------------------------------------------------------------------------
>
> Key: JXPATH-170
> URL: https://issues.apache.org/jira/browse/JXPATH-170
> Project: Commons JXPath
> Issue Type: Bug
> Affects Versions: 1.2 Final
> Reporter: Giacomo Guarguaglini
> Fix For: 1.4
>
>
> Trying to use alternative xpath (for example "homeAddress | streetNumber") we
> get a NullPointerException in
> org.apache.commons.jxpath.ri.model.dynamic.DynamicPointer.hashCode
> and
> org.apache.commons.jxpath.ri.model.dynamic.DynamicPointer.equals
> due to not checked null value for attribute name.
> Original code:
> public int hashCode() {
> return System.identityHashCode(bean) + name.hashCode();
> }
> fixed code
> public int hashCode() {
> return System.identityHashCode(bean) + ((name != null) ?
> name.hashCode() : 0);
> }
> In a similar way for equals method.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)