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

Reto Bachmann-Gmür resolved CLEREZZA-727.
-----------------------------------------

    Resolution: Fixed
      Assignee: Reto Bachmann-Gmür

Fixed definition and implementation. This should make clerezz faster! Thanks 
for reporting!
                
> Error in hashCode implementation in 
> org.apache.clerezza.rdf.core.impl.TripleImpl
> --------------------------------------------------------------------------------
>
>                 Key: CLEREZZA-727
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-727
>             Project: Clerezza
>          Issue Type: Bug
>          Components: rdf.core
>            Reporter: Giuseppe Miscione
>            Assignee: Reto Bachmann-Gmür
>            Priority: Minor
>              Labels: performance
>
> hashCode of --- class is implemented as
> public int hashCode() {
>     return (subject.hashCode() >> 1) ^ subject.hashCode() ^ 
> (subject.hashCode() << 1);
> }
> and it's using only the subject part of the triple. It's correct 
> implementation should be:
> public int hashCode() {
>     return (subject.hashCode() >> 1) ^ predicate.hashCode() ^ 
> (object.hashCode() << 1);
> }
> The actual implementation works well with its corresponding equals method 
> (the methods are coherent) but it can yield to performance degradation when 
> using a lot of TripleImpl objects with the same subject as HashMap key.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to