Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-2693

ByteArrayKey should print out its hashCode

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Minor
    • 5.2.0.Final
    • 5.2.0.Beta6
    • Marshalling
    • None

    Description

      When a ByteArrayKey is printed out, the format is ByteArrayKey{data=ByteArray{size=..., hashCode=..., array=...}}

      However, ByteArray computes hashCode using array.hashCode() instead of Arrays.hashCode(array) and, therefore, two equal ByteArrayKeys have different hashCode when printed out.

      Another way to fix that could be using Arrays.hashCode(array) in Util.printArray() (although I am not sure whether this could break anything).

      As the result is pretty unexpected, I consider this a bug rather than a feature request.

      Attachments

        Activity

          People

            rh-ee-galder Galder ZamarreƱo
            rvansa1@redhat.com Radim Vansa (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: