HBASE-11828 callers of SeverName.valueOf should use equals and not ==. Signed-off-by: Andrew Purtell <[email protected]>
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/2ef6d03e Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/2ef6d03e Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/2ef6d03e Branch: refs/heads/branch-1 Commit: 2ef6d03e56c374ef56ddcee5f87e7f7a77c9337f Parents: 95da297 Author: Sean Busbey <[email protected]> Authored: Tue Aug 26 11:29:33 2014 -0500 Committer: Andrew Purtell <[email protected]> Committed: Tue Aug 26 17:52:26 2014 -0700 ---------------------------------------------------------------------- .../java/org/apache/hadoop/hbase/ServerName.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/2ef6d03e/hbase-client/src/main/java/org/apache/hadoop/hbase/ServerName.java ---------------------------------------------------------------------- diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/ServerName.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/ServerName.java index acd6ee7..48b4a79 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/ServerName.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/ServerName.java @@ -147,14 +147,29 @@ public class ServerName implements Comparable<ServerName>, Serializable { return Long.parseLong(serverName.substring(index + 1)); } + /** + * Retrieve an instance of ServerName. + * Callers should use the equals method to compare returned instances, though we may return + * a shared immutable object as an internal optimization. + */ public static ServerName valueOf(final String hostname, final int port, final long startcode) { return new ServerName(hostname, port, startcode); } + /** + * Retrieve an instance of ServerName. + * Callers should use the equals method to compare returned instances, though we may return + * a shared immutable object as an internal optimization. + */ public static ServerName valueOf(final String serverName) { return new ServerName(serverName); } + /** + * Retrieve an instance of ServerName. + * Callers should use the equals method to compare returned instances, though we may return + * a shared immutable object as an internal optimization. + */ public static ServerName valueOf(final String hostAndPort, final long startCode) { return new ServerName(hostAndPort, startCode); }
