aboutsummaryrefslogtreecommitdiff
path: root/src/lombok/javac/JavacASTVisitor.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/lombok/javac/JavacASTVisitor.java')
-rw-r--r--src/lombok/javac/JavacASTVisitor.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lombok/javac/JavacASTVisitor.java b/src/lombok/javac/JavacASTVisitor.java
index 0d751c52..d0902006 100644
--- a/src/lombok/javac/JavacASTVisitor.java
+++ b/src/lombok/javac/JavacASTVisitor.java
@@ -104,7 +104,7 @@ public interface JavacASTVisitor {
private int indent = 0;
/**
- * @param printContent if true, method and initializer bodies are printed directly, as java code,
+ * @param printContent if true, bodies are printed directly, as java code,
* instead of a tree listing of every AST node inside it.
*/
public Printer(boolean printContent) {
@@ -112,7 +112,7 @@ public interface JavacASTVisitor {
}
/**
- * @param printContent if true, method and initializer bodies are printed directly, as java code,
+ * @param printContent if true, bodies are printed directly, as java code,
* instead of a tree listing of every AST node inside it.
* @param out write output to this stream. You must close it yourself. flush() is called after every line.
*
@@ -149,6 +149,10 @@ public interface JavacASTVisitor {
@Override public void visitType(Node node, JCClassDecl type) {
print("<TYPE %s>", type.name);
indent++;
+ if ( printContent ) {
+ print("%s", type);
+ disablePrinting++;
+ }
}
@Override public void visitAnnotationOnType(JCClassDecl type, Node node, JCAnnotation annotation) {
@@ -156,6 +160,7 @@ public interface JavacASTVisitor {
}
@Override public void endVisitType(Node node, JCClassDecl type) {
+ if ( printContent ) disablePrinting--;
indent--;
print("</TYPE %s>", type.name);
}