ctubbsii commented on a change in pull request #313: ACCUMULO-4726 Add
Value.contentEquals(byte[]) method
URL: https://github.com/apache/accumulo/pull/313#discussion_r146066414
##########
File path: core/src/main/java/org/apache/accumulo/core/data/Value.java
##########
@@ -242,16 +242,16 @@ public int compareTo(final byte[] that) {
@Override
public boolean equals(Object right_obj) {
- // compare with byte[] for backwards compatibility, but this is generally
a pretty bad practice
- if (right_obj instanceof byte[]) {
- return compareTo((byte[]) right_obj) == 0;
Review comment:
I understand the problematic consequences of a change in behavior, but I
don't see the point in throwing an exception, when that leaves the original
problem in place (non-symmetrical equals implementations). It would be better
to not do anything, I think.
My intent was to rely on the fact that Accumulo does not use this behavior,
it was undocumented behavior, and *very* unlikely to be used by anybody else.
Given those conditions, and with sufficient documentation in the release notes,
I was thinking a breaking change in behavior in a 2.0.0 release would be fine.
But, if the consensus is that it's not worth the risk, it's no big deal. We
don't have to fix this at all.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services