style: fix code style to adapter PMD
This commit is contained in:
parent
f222dccd3d
commit
6a0d71a26d
@ -34,6 +34,8 @@ import java.util.function.Predicate;
|
|||||||
*/
|
*/
|
||||||
public class MemberUtils {
|
public class MemberUtils {
|
||||||
|
|
||||||
|
private static final String SEMICOLON = ":";
|
||||||
|
|
||||||
private static ServerMemberManager manager;
|
private static ServerMemberManager manager;
|
||||||
|
|
||||||
public static void setManager(ServerMemberManager manager) {
|
public static void setManager(ServerMemberManager manager) {
|
||||||
@ -48,6 +50,7 @@ public class MemberUtils {
|
|||||||
oldMember.setAddress(newMember.getAddress());
|
oldMember.setAddress(newMember.getAddress());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("PMD.UndefineMagicConstantRule")
|
||||||
public static Member singleParse(String member) {
|
public static Member singleParse(String member) {
|
||||||
int selfPort = ApplicationUtils.getPort();
|
int selfPort = ApplicationUtils.getPort();
|
||||||
// Nacos default port is 8848
|
// Nacos default port is 8848
|
||||||
@ -58,8 +61,8 @@ public class MemberUtils {
|
|||||||
String[] memberDetails = member.split("\\?");
|
String[] memberDetails = member.split("\\?");
|
||||||
String address = memberDetails[0];
|
String address = memberDetails[0];
|
||||||
int port = defaultPort;
|
int port = defaultPort;
|
||||||
if (address.contains(":")) {
|
if (address.contains(SEMICOLON)) {
|
||||||
String[] info = address.split(":");
|
String[] info = address.split(SEMICOLON);
|
||||||
address = info[0];
|
address = info[0];
|
||||||
port = Integer.parseInt(info[1]);
|
port = Integer.parseInt(info[1]);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user