Some code optimization (#1608)

This commit is contained in:
polarbear567
2020-12-08 15:59:33 +08:00
committed by GitHub
parent db533a02b0
commit 6a3d9fac33
6 changed files with 3 additions and 13 deletions
@@ -92,7 +92,6 @@ public class ArthasMethod {
if ("<init>".equals(this.methodName)) {
this.constructor = clazz.getDeclaredConstructor(argsClasses);
;
} else {
this.method = clazz.getDeclaredMethod(methodName, argsClasses);
}
@@ -195,9 +195,7 @@ public class MutablePropertySources implements PropertySources {
* Remove the given property source if it is present.
*/
protected void removeIfPresent(PropertySource<?> propertySource) {
if (this.propertySourceList.contains(propertySource)) {
this.propertySourceList.remove(propertySource);
}
this.propertySourceList.remove(propertySource);
}
/**
@@ -68,7 +68,6 @@ public class LogUtil {
loggerContext.reset();
String fileName = env.getProperty(FILE_NAME_PROPERTY);
;
if (fileName != null) {
loggerContext.putProperty(ARTHAS_LOG_FILE, fileName);
}
@@ -453,7 +453,7 @@ public abstract class ObjectUtils {
sb.append(", ");
}
sb.append(String.valueOf(array[i]));
sb.append(array[i]);
}
sb.append("}");
@@ -59,8 +59,6 @@ public class Ansi {
}
}
;
public static enum Attribute {
RESET(0, "RESET"),
INTENSITY_BOLD(1, "INTENSITY_BOLD"),
@@ -100,8 +98,6 @@ public class Ansi {
}
;
public static enum Erase {
FORWARD(0, "FORWARD"),
BACKWARD(1, "BACKWARD"),
@@ -125,8 +121,6 @@ public class Ansi {
}
}
;
public static final String DISABLE = Ansi.class.getName() + ".disable";
private static Callable<Boolean> detector = new Callable<Boolean>() {
@@ -123,7 +123,7 @@ public class TunnelSocketFrameHandler extends SimpleChannelInboundHandler<WebSoc
List<String> agentId = parameters.getOrDefault("id", Collections.emptyList());
if (agentId.isEmpty()) {
logger.error("arthas agent id can not be null, parameters: ", parameters);
logger.error("arthas agent id can not be null, parameters: {}", parameters);
throw new IllegalArgumentException("arthas agent id can not be null");
}