Some code optimization (#1608)

pull/1622/head
polarbear567 4 years ago committed by GitHub
parent db533a02b0
commit 6a3d9fac33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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");
}

Loading…
Cancel
Save