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] [Reopened] (JXPATH-170) NullPointerException using org.apache.commons.jxpath.ri.model.dynamic.DynamicPointer
Date Sat, 21 Nov 2015 10:14:11 GMT

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

Benedikt Ritter reopened JXPATH-170:
------------------------------------

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

Mime
View raw message