Commit c40c9d86 authored by Johannes Mey's avatar Johannes Mey
Browse files

apply performance bug hint from intellij

parent 647e1f2d
......@@ -33,7 +33,7 @@ aspect DumpTree {
public String ASTNode.extraDumpInfo() { return ""; }
public String ASTNode.getTokens() {
java.util.TreeSet<java.lang.reflect.Method> methods = new java.util.TreeSet<>(Comparator.comparing(Method::getName));
java.util.TreeSet<java.lang.reflect.Method> methods = new java.util.TreeSet<>(Comparator.comparing(java.lang.reflect.Method::getName));
methods.addAll(java.util.Arrays.asList(getClass().getMethods()));
......@@ -43,7 +43,8 @@ aspect DumpTree {
if (token != null) {
try {
result.append(String.format(" %s=\"%s\"", token.name(), method.invoke(this)));
} catch (IllegalAccessException | java.lang.reflect.InvocationTargetException ignored) {
} catch (IllegalAccessException ignored) {
} catch (java.lang.reflect.InvocationTargetException ignored) {
}
}
}
......
......@@ -33,10 +33,10 @@ aspect PrettyPrinting {
aspect Utils {
public String ASTNode.ind(int n) {
String s = "";
StringBuilder s = new StringBuilder();
for (int i = 0; i < n; i++) {
s += " ";
s.append(" ");
}
return s;
return s.toString();
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment