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

ByteArrayKey should print out its hashCode

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

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

      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.

              rh-ee-galder Galder ZamarreƱo
              rvansa1@redhat.com Radim Vansa (Inactive)
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: