[ 
https://issues.apache.org/jira/browse/ACCUMULO-1734?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13779936#comment-13779936
 ] 

Bill Havanki commented on ACCUMULO-1734:
----------------------------------------

I've been looking at {{Mutation.equals()}} (trunk version) while working 
ACCUMULO-1627. The implementation is problematic for doing a close-to-correct 
subclass implementation of {{equals()}}, and I was planning of reworking it (a 
scary thing for a n00b like me, so I'll be seeking lots of feedback). I was 
thinking of protecting and renaming {{Mutation.equals(Mutation)}} - that's the 
one with the serialize calls - so that it doesn't get called instead of 
{{Mutation.equals(Object)}} when the parameter is a {{Mutation}} instance. That 
would make the implementation more typical.

Maybe such a change would help? Regardless, I wanted to mention it since it's 
related.
                
> Mutation is hard to check in unit tests
> ---------------------------------------
>
>                 Key: ACCUMULO-1734
>                 URL: https://issues.apache.org/jira/browse/ACCUMULO-1734
>             Project: Accumulo
>          Issue Type: Bug
>          Components: client
>    Affects Versions: 1.4.4
>            Reporter: Eric Newton
>            Priority: Minor
>
> [~treardon] writes:
> {quote}
> The problem is that Mutation.equals() calls a private serialize() method that 
> modifies the data about to be checked. I have successfully worked around this 
> in the past by wrapping the Mutation in a new Mutation, which calls serialize 
> under the hood:
>  assertEquals(expectedMutation, new Mutation(actualMutation));
> This applies to 1.4.x, I don't know if Mutation.equals() has changed since 
> then.
> {quote}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to