< prev index next > src/jdk.compiler/share/classes/com/sun/tools/javac/tree/Pretty.java
Print this page
}
public void visitMethodDef(JCMethodDecl tree) {
try {
// when producing source output, omit anonymous constructors
! if (tree.name == tree.name.table.names.init &&
enclClassName == null &&
sourceOutput) return;
println(); align();
printDocComment(tree);
printExpr(tree.mods);
printTypeParameters(tree.typarams);
! if (tree.name == tree.name.table.names.init) {
print(enclClassName != null ? enclClassName : tree.name);
} else {
printExpr(tree.restype);
print(' ');
print(tree.name);
}
public void visitMethodDef(JCMethodDecl tree) {
try {
// when producing source output, omit anonymous constructors
! if (tree.isInitOrVNew() &&
enclClassName == null &&
sourceOutput) return;
println(); align();
printDocComment(tree);
printExpr(tree.mods);
printTypeParameters(tree.typarams);
! if (tree.isInitOrVNew()) {
print(enclClassName != null ? enclClassName : tree.name);
} else {
printExpr(tree.restype);
print(' ');
print(tree.name);
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
+ public void visitDefaultValue(JCDefaultValue tree) {
+ try {
+ printExpr(tree.clazz, TreeInfo.postfixPrec);
+ print(".default");
+ } catch (IOException e) {
+ throw new UncheckedIOException(e);
+ }
+ }
+
public void visitDoLoop(JCDoWhileLoop tree) {
try {
print("do ");
printStat(tree.body);
align();
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
+ public void visitWithField(JCWithField tree) {
+ try {
+ print("__WithField(");
+ printExpr(tree.field);
+ print(", ");
+ printExpr(tree.value);
+ print(")");
+ } catch (IOException e) {
+ throw new UncheckedIOException(e);
+ }
+ }
+
public void visitForLoop(JCForLoop tree) {
try {
print("for (");
if (tree.init.nonEmpty()) {
if (tree.init.head.hasTag(VARDEF)) {
< prev index next >