Optimized method name camelCase

pull/656/head
chen.ma 2 years ago
parent b9247ef8d1
commit f936845d0e

@ -57,7 +57,7 @@ public class ThreadPoolRunStateHandler extends AbstractThreadPoolRuntime {
ByteConvertUtil.getPrintSize(runtimeInfo.getMaxMemory())).toString(); ByteConvertUtil.getPrintSize(runtimeInfo.getMaxMemory())).toString();
poolRunStateInfo.setCurrentLoad(poolRunStateInfo.getCurrentLoad() + "%"); poolRunStateInfo.setCurrentLoad(poolRunStateInfo.getCurrentLoad() + "%");
poolRunStateInfo.setPeakLoad(poolRunStateInfo.getPeakLoad() + "%"); poolRunStateInfo.setPeakLoad(poolRunStateInfo.getPeakLoad() + "%");
String ipAddress = hippo4JInetUtils.findFirstNonLoopbackHostInfo().getIpAddress(); String ipAddress = hippo4JInetUtils.findFirstNonLoopBackHostInfo().getIpAddress();
poolRunStateInfo.setHost(ipAddress); poolRunStateInfo.setHost(ipAddress);
poolRunStateInfo.setMemoryProportion(memoryProportion); poolRunStateInfo.setMemoryProportion(memoryProportion);
poolRunStateInfo.setFreeMemory(ByteConvertUtil.getPrintSize(runtimeInfo.getFreeMemory())); poolRunStateInfo.setFreeMemory(ByteConvertUtil.getPrintSize(runtimeInfo.getFreeMemory()));

@ -51,7 +51,7 @@ public class IdentifyUtil {
if (StrUtil.isNotBlank(IDENTIFY)) { if (StrUtil.isNotBlank(IDENTIFY)) {
return IDENTIFY; return IDENTIFY;
} }
String ip = hippo4JInetUtils.findFirstNonLoopbackHostInfo().getIpAddress(); String ip = hippo4JInetUtils.findFirstNonLoopBackHostInfo().getIpAddress();
String port = environment.getProperty("server.port", "8080"); String port = environment.getProperty("server.port", "8080");
String identification = StrUtil.builder(ip, String identification = StrUtil.builder(ip,
":", ":",

@ -58,7 +58,7 @@ public class InetUtils implements Closeable {
this.executorService.shutdown(); this.executorService.shutdown();
} }
public HostInfo findFirstNonLoopbackHostInfo() { public HostInfo findFirstNonLoopBackHostInfo() {
InetAddress address = findFirstNonLoopbackAddress(); InetAddress address = findFirstNonLoopbackAddress();
if (address != null) { if (address != null) {
return convertAddress(address); return convertAddress(address);

@ -55,9 +55,9 @@ public abstract class AbstractRefreshListener<M> implements RefreshListener<Hipp
AbstractRefreshListener() { AbstractRefreshListener() {
InetUtils inetUtils = ApplicationContextHolder.getBean(InetUtils.class); InetUtils inetUtils = ApplicationContextHolder.getBean(InetUtils.class);
InetUtils.HostInfo loopbackHostInfo = inetUtils.findFirstNonLoopbackHostInfo(); InetUtils.HostInfo loopBackHostInfo = inetUtils.findFirstNonLoopBackHostInfo();
Assert.notNull(loopbackHostInfo, "Unable to get the application IP address"); Assert.notNull(loopBackHostInfo, "Unable to get the application IP address");
ipSegment = loopbackHostInfo.getIpAddress().split(SPOT); ipSegment = loopBackHostInfo.getIpAddress().split(SPOT);
} }
@EventListener(WebServerInitializedEvent.class) @EventListener(WebServerInitializedEvent.class)

@ -29,7 +29,7 @@ public class CloudCommonIdUtil {
private static final String SEPARATOR = ":"; private static final String SEPARATOR = ":";
public static String getClientIpPort(PropertyResolver resolver, InetUtils inetUtils) { public static String getClientIpPort(PropertyResolver resolver, InetUtils inetUtils) {
String hostname = inetUtils.findFirstNonLoopbackHostInfo().getIpAddress(); String hostname = inetUtils.findFirstNonLoopBackHostInfo().getIpAddress();
String port = resolver.getProperty("server.port", "8080"); String port = resolver.getProperty("server.port", "8080");
return combineParts(hostname, SEPARATOR, port); return combineParts(hostname, SEPARATOR, port);
} }
@ -43,7 +43,7 @@ public class CloudCommonIdUtil {
@SneakyThrows @SneakyThrows
public static String getIpApplicationName(PropertyResolver resolver, InetUtils inetUtils) { public static String getIpApplicationName(PropertyResolver resolver, InetUtils inetUtils) {
String hostname = inetUtils.findFirstNonLoopbackHostInfo().getIpAddress(); String hostname = inetUtils.findFirstNonLoopBackHostInfo().getIpAddress();
String appName = resolver.getProperty("spring.application.name"); String appName = resolver.getProperty("spring.application.name");
return combineParts(hostname, SEPARATOR, appName); return combineParts(hostname, SEPARATOR, appName);
} }

Loading…
Cancel
Save