From 3411f830e350702bb94090fe298df27d508036d8 Mon Sep 17 00:00:00 2001 From: Sean Busbey Date: Tue, 26 Aug 2014 11:29:33 -0500 Subject: [PATCH] HBASE-11828 callers of SeverName.valueOf should use equals and not ==. Signed-off-by: Andrew Purtell --- .../java/org/apache/hadoop/hbase/ServerName.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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 acd6ee7de32..48b4a79d7a2 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, 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); }