ctubbsii commented on a change in pull request #2551:
URL: https://github.com/apache/accumulo/pull/2551#discussion_r821784698
##########
File path: core/src/main/java/org/apache/accumulo/core/util/HostAndPort.java
##########
@@ -281,4 +281,18 @@ public int getPortOrDefault(int defaultPort) {
return hasPort() ? port : defaultPort;
}
+ /**
+ * HostAndPort must implement compareTo. As this is a seldom used utiltiy,
compareTo simply orders
+ * HostAndPort values using a String compare on the Host value with a
secondary integer compare on
+ * the Port if Host values are identical.
+ */
+ @Override
+ public int compareTo(HostAndPort other) {
+ if (this == other) {
+ return 0;
+ }
+ int hostCompareValue = this.getHost().compareTo(other.getHost());
Review comment:
host can be null
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]