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-170) NullPointerException using org.apache.commons.jxpath.ri.model.dynamic.DynamicPointer
Date Tue, 14 Oct 2014 17:49:34 GMT

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

Michele Vivoda commented on JXPATH-170:
---------------------------------------

Hi,

Is it in ? Otherwise you need to download source from github page https://github.com/apache/commons-jxpath
and compile

Ciao
Michele

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

Mime
View raw message