Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some code optimization #1608

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ private void initMethod() {

if ("<init>".equals(this.methodName)) {
this.constructor = clazz.getDeclaredConstructor(argsClasses);
;
} else {
this.method = clazz.getDeclaredMethod(methodName, argsClasses);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,7 @@ protected void assertLegalRelativeAddition(String relativePropertySourceName, Pr
* 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);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ public static LoggerContext initLooger(ArthasEnvironment env) {
loggerContext.reset();

String fileName = env.getProperty(FILE_NAME_PROPERTY);
;
if (fileName != null) {
loggerContext.putProperty(ARTHAS_LOG_FILE, fileName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ public static String nullSafeToString(Object[] array) {
sb.append(", ");
}

sb.append(String.valueOf(array[i]));
sb.append(array[i]);
}

sb.append("}");
Expand Down
6 changes: 0 additions & 6 deletions core/src/main/java/com/taobao/arthas/core/view/Ansi.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ public int bgBright() {
}
}

;

public static enum Attribute {
RESET(0, "RESET"),
INTENSITY_BOLD(1, "INTENSITY_BOLD"),
Expand Down Expand Up @@ -100,8 +98,6 @@ public int value() {

}

;

public static enum Erase {
FORWARD(0, "FORWARD"),
BACKWARD(1, "BACKWARD"),
Expand All @@ -125,8 +121,6 @@ public int value() {
}
}

;

public static final String DISABLE = Ansi.class.getName() + ".disable";

private static Callable<Boolean> detector = new Callable<Boolean>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ private void connectArthas(ChannelHandlerContext tunnelSocketCtx, MultiValueMap<
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");
}

Expand Down