mirror of
https://github.com/alibaba/arthas.git
synced 2024-04-21 10:21:39 +00:00
Some code optimization (#1608)
This commit is contained in:
@@ -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>() {
|
||||
|
||||
+1
-1
@@ -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");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user