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 a99e19a31f
commit 3411f830e3
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));
}
/**
* 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);
}