You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2014/07/19 04:27:40 UTC

[jira] [Commented] (CAMEL-7611) org.apache.camel.util.KeyValueHolder equals bug

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

ASF GitHub Bot commented on CAMEL-7611:
---------------------------------------

GitHub user nkukhar opened a pull request:

    https://github.com/apache/camel/pull/223

    Fix for CAMEL-7611

    Equals and hash code in KeyValueHolder now are consistent.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/nkukhar/camel CAMEL-7611

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/camel/pull/223.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #223
    
----
commit d3a587f0824dc460f8dd78c9bf514abdd301c484
Author: nkukhar <ku...@gmail.com>
Date:   2014-07-19T02:05:40Z

    Fixed equals and hashCode methods to be consistent with java (equals and hashCode) requirements.

commit fa7e7733c8669c9708f7e41b0d9998a8ab48f98e
Author: nkukhar <ku...@gmail.com>
Date:   2014-07-19T02:17:53Z

    Merge branch 'master' into CAMEL-7611

----


> org.apache.camel.util.KeyValueHolder equals bug
> -----------------------------------------------
>
>                 Key: CAMEL-7611
>                 URL: https://issues.apache.org/jira/browse/CAMEL-7611
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.10.2, 2.12.4, 2.13.2
>         Environment: AIX, Weblogic
>            Reporter: Yann MOLLIER
>
> According to java.lang.Object javadoc (http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html), "equal objects must have equal hash codes". 
> Current implementation of the "equals" and "hashCode" method of the org.apache.camel.util.KeyValueHolder does not seem to follow that rule: hashCode is calculated from the key and value attributes while the equals compares only the key attribute. 
> Could generate unexpected behaviour in certain circumstances.



--
This message was sent by Atlassian JIRA
(v6.2#6252)