--- a/langtools/test/tools/javac/T6855236.java Thu Sep 16 09:56:25 2010 -0700
+++ b/langtools/test/tools/javac/T6855236.java Thu Sep 16 09:57:37 2010 -0700
@@ -71,12 +71,10 @@
@Override
public Object visitMethodInvocation(MethodInvocationTree node, Trees p) {
- System.out.print("current path: ");
+ System.out.println("current path: ");
for (Tree t : getCurrentPath()) {
- System.out.print('/');
- System.out.print(t);
- }
- System.out.println();
+ System.out.println(" " + t.getKind() + ": " + trim(t, 64));
+ }
System.out.println("parent path: " + getCurrentPath().getParentPath());
System.out.println("method select: " + node.getMethodSelect().toString());
for (ExpressionTree arg : node.getArguments()) {
@@ -88,12 +86,20 @@
@Override
public Object visitExpressionStatement(ExpressionStatementTree node, Trees p) {
ExpressionTree t = node.getExpression();
- System.out.println("expression statement: " + t.toString());
+ System.out.println();
+ System.out.println("expression statement: " + trim(t, 64));
return super.visitExpressionStatement(node, p);
}
}
+ private String trim(Tree t, int len) {
+ String s = t.toString().trim().replaceAll("\\s+", " ");
+ if (s.length() > len)
+ s = s.substring(0, len) + "...";
+ return s;
+ }
+
}