Accumulo
  1. Accumulo
  2. ACCUMULO-2892

QCMutation defines equals but not hashcode

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.6.0
    • Fix Version/s: 1.8.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
        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
        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
        Josh Elser added a comment -
        Show
        Josh Elser added a comment - ping Keith Turner .

          People

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

            Dates

            • Created:
              Updated:

              Development