jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Dürig <mdue...@apache.org>
Subject Re: Possible bugs / acknowledgement
Date Thu, 29 Jan 2015 13:08:29 GMT


On 28.1.15 8:10 , Johannes Birgmeier wrote:
> === REPORT 1 ===
> In GlobPattern.java, in equals(), somebody wrote:
>
>   return nodePath.equals(other.nodePath) &&
>                      (restriction == null) ? other.restriction == null :
> restriction.equals(other.restriction);
>
> However, the ternary operator has lower precedence than &&, and thus the
> hashCode/equals contract might be violated here. What you probably want is
>
>   return nodePath.equals(other.nodePath) &&
>                      ((restriction == null) ? other.restriction == null :
> restriction.equals(other.restriction));

See https://issues.apache.org/jira/browse/JCR-3847

Michael

Mime
View raw message