Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-7611

org.apache.camel.util.KeyValueHolder equals bug

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.10.2, 2.12.4, 2.13.2
    • 2.12.5, 2.13.3, 2.14.0
    • camel-core
    • None
    • AIX, Weblogic

    • Moderate

    Description

      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.

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            yann_m Yann MOLLIER
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: