Uploaded image for project: 'Accumulo'
  1. Accumulo
  2. ACCUMULO-2892

QCMutation defines equals but not hashcode

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.6.0
    • Fix Version/s: 1.8.2, 2.0.0
    • Component/s: client
    • Labels:

      Description

      FindBugs output: org.apache.accumulo.core.client.impl.ConditionalWriterImpl$QCMutation defines equals but not hashCode

      It looks like equals also depends on compareTo, which is unsafe. (This equals dependency is fine, but compareTo does an unchecked cast.)

        Activity

        Hide
        mdrob Mike Drob added a comment -

        Actually, the situation is more complicated than that. QCMutation::hashCode inherits ConditionalMutation::hashCode which hashes on the thrift representation and the conditions. However, when QCMutation::equals delegates to QCMutation::compareTo it only compares the resetTime fields, ignoring conditions.

        Keith Turner - What is the intent here? I can take a guess and make it consistent, but I don't know if that is correct.

        Show
        mdrob Mike Drob added a comment - Actually, the situation is more complicated than that. QCMutation::hashCode inherits ConditionalMutation::hashCode which hashes on the thrift representation and the conditions. However, when QCMutation::equals delegates to QCMutation::compareTo it only compares the resetTime fields, ignoring conditions. Keith Turner - What is the intent here? I can take a guess and make it consistent, but I don't know if that is correct.
        Hide
        elserj Josh Elser added a comment -
        Show
        elserj Josh Elser added a comment - ping Keith Turner .

          People

          • Assignee:
            Unassigned
            Reporter:
            mdrob Mike Drob
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development