HorizonNet commented on a change in pull request #1639:
URL: https://github.com/apache/hbase/pull/1639#discussion_r420148094
##########
File path: hbase-common/src/main/java/org/apache/hadoop/hbase/ServerName.java
##########
@@ -366,22 +286,32 @@ public int hashCode() {
@Override
public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null) return false;
- if (!(o instanceof ServerName)) return false;
+ if (this == o) {
+ return true;
+ }
+ if (o == null) {
+ return false;
+ }
+ if (!(o instanceof ServerName)) {
+ return false;
+ }
return this.compareTo((ServerName)o) == 0;
}
/**
- * @param left
- * @param right
- * @return True if <code>other</code> has same hostname and port.
+ * @param left the first server address to compare
+ * @param right the second server address to compare
+ * @return {@code true} if {@code left} and {@code right} have the same
hostname and port.
*/
public static boolean isSameAddress(final ServerName left,
final ServerName right) {
// TODO: Make this left.getAddress().equals(right.getAddress())
Review comment:
We have a test case over in `TestServerName` called
`testHostNameCaseSensitivity`, which compares a lower case version to the upper
case version via `isSameAddress`. Does this cover your point?
Another point: Currently `TestServerName` is located in `hbase-server`,
which feels a little bit strange. Should we move the test case to
`hbase-common` in this one or should we do it separately? If we do the latter
I'm also going to prepare backports, even if the original ticket is targeting
3.0.0. Probably a backport would still be good as `isSameAddress` was changed
here and other branches would benefit from the change.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]