[
https://issues.apache.org/jira/browse/HBASE-8222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13617658#comment-13617658
]
Gary Helmling commented on HBASE-8222:
--------------------------------------
+1 on patch. I was testing a very similar change.
I'd recommend the following change to TestUser as well, which tests for the
problem:
{noformat}
diff --git
a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/TestUser.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/TestUser.java
index 619c87a..9a30964 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/TestUser.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/TestUser.java
@@ -101,6 +101,8 @@ public class TestUser {
User u = User.getCurrent();
assertNotNull(u);
assertEquals(user1.getName(), u.getName());
+ assertEquals(user1, u);
+ assertEquals(user1.hashCode(), u.hashCode());
}
}
{noformat}
> User should implement equals() and hashCode()
> ---------------------------------------------
>
> Key: HBASE-8222
> URL: https://issues.apache.org/jira/browse/HBASE-8222
> Project: HBase
> Issue Type: Bug
> Components: security
> Affects Versions: 0.94.6
> Reporter: Gary Helmling
> Priority: Critical
> Fix For: 0.95.0, 0.98.0, 0.94.7
>
> Attachments: 8222-v1.txt
>
>
> The current implementation of the User class does not override equals() and
> hashCode(), so connection reuse in HBaseClient is completely broken.
--
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