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

        Mike Drob created issue -
        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.
        Corey J. Nolet made changes -
        Field Original Value New Value
        Fix Version/s 1.6.2 [ 12328644 ]
        Fix Version/s 1.6.1 [ 12325441 ]
        Corey J. Nolet made changes -
        Fix Version/s 1.6.3 [ 12329154 ]
        Fix Version/s 1.6.2 [ 12328644 ]
        Hide
        Josh Elser added a comment -
        Show
        Josh Elser added a comment - ping Keith Turner .
        Josh Elser made changes -
        Fix Version/s 1.8.0 [ 12329879 ]
        Fix Version/s 1.7.1 [ 12329940 ]
        Fix Version/s 1.7.0 [ 12324607 ]
        Christopher Tubbs made changes -
        Fix Version/s 1.6.3 [ 12329154 ]
        Fix Version/s 1.7.1 [ 12329940 ]

          People

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

            Dates

            • Created:
              Updated:

              Development