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/aa60960a Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/aa60960a Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/aa60960a Branch: refs/heads/0.98 Commit: aa60960a355d5ee27c464fe3e00ae0dc4b012437 Parents: d15df97 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:30 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/aa60960a/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); }
