HBASE-11828 callers of SeverName.valueOf should use equals and not ==.

Signed-off-by: Andrew Purtell <apurtell@apache.org>
This commit is contained in:
Sean Busbey 2014-08-26 11:29:33 -05:00 committed by Andrew Purtell
parent 95da29707f
commit 2ef6d03e56
1 changed files with 15 additions and 0 deletions

View File

@ -147,14 +147,29 @@ public class ServerName implements Comparable<ServerName>, Serializable {
return Long.parseLong(serverName.substring(index + 1)); 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) { public static ServerName valueOf(final String hostname, final int port, final long startcode) {
return new ServerName(hostname, port, 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) { public static ServerName valueOf(final String serverName) {
return new ServerName(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) { public static ServerName valueOf(final String hostAndPort, final long startCode) {
return new ServerName(hostAndPort, startCode); return new ServerName(hostAndPort, startCode);
} }