2225 lines
77 KiB
Java
2225 lines
77 KiB
Java
package lombok.delombok;
|
|
|
|
import com.adjust.sdk.Constants;
|
|
import com.discord.api.permission.Permission;
|
|
import com.discord.models.domain.ModelAuditLogEntry;
|
|
import com.discord.widgets.chat.input.autocomplete.AutocompleteViewModel;
|
|
import com.google.android.material.badge.BadgeDrawable;
|
|
import com.sun.source.tree.Tree;
|
|
import com.sun.tools.javac.tree.DocCommentTable;
|
|
import com.sun.tools.javac.tree.JCTree;
|
|
import com.sun.tools.javac.util.JCDiagnostic;
|
|
import com.sun.tools.javac.util.List;
|
|
import com.sun.tools.javac.util.Name;
|
|
import java.io.IOException;
|
|
import java.io.Writer;
|
|
import java.lang.reflect.Field;
|
|
import java.lang.reflect.InvocationTargetException;
|
|
import java.lang.reflect.Method;
|
|
import java.util.Arrays;
|
|
import java.util.HashMap;
|
|
import java.util.Iterator;
|
|
import java.util.Map;
|
|
import lombok.javac.CommentInfo;
|
|
import lombok.javac.Javac;
|
|
import lombok.javac.JavacTreeMaker;
|
|
import lombok.javac.PackageName;
|
|
import lombok.permit.Permit;
|
|
/* loaded from: com.discord-119107.apk:lombok/delombok/PrettyPrinter.SCL.lombok */
|
|
public class PrettyPrinter extends JCTree.Visitor {
|
|
private static final Map<JavacTreeMaker.TreeTag, String> OPERATORS;
|
|
private final Writer out;
|
|
private final JCTree.JCCompilationUnit compilationUnit;
|
|
private List<CommentInfo> comments;
|
|
private final int[] textBlockStarts;
|
|
private final FormatPreferences formatPreferences;
|
|
private final Map<JCTree, String> docComments;
|
|
private final DocCommentTable docTable;
|
|
private boolean needsAlign;
|
|
private boolean needsNewLine;
|
|
private boolean needsSpace;
|
|
private boolean aligned;
|
|
private Name __INIT__;
|
|
private Name __VALUE__;
|
|
private Name currentTypeName;
|
|
private static final long DEFAULT = 8796093022208L;
|
|
private static final int PREFIX = 14;
|
|
private static final Method getEndPosition;
|
|
private static final Method storeEnd;
|
|
private static final Map<Class<?>, Map<String, Field>> reflectionCache;
|
|
private static /* synthetic */ int[] $SWITCH_TABLE$lombok$javac$CommentInfo$StartConnection;
|
|
private static /* synthetic */ int[] $SWITCH_TABLE$lombok$javac$CommentInfo$EndConnection;
|
|
private static /* synthetic */ int[] $SWITCH_TABLE$com$sun$source$tree$Tree$Kind;
|
|
private static final String LINE_SEP = System.getProperty("line.separator");
|
|
private static final Method getExtendsClause = getMethod(JCTree.JCClassDecl.class, "getExtendsClause", new Class[0]);
|
|
private int indent = 0;
|
|
private boolean onNewLine = true;
|
|
private boolean innermostArrayBracketsAreVarargs = false;
|
|
private long flagMod = -1;
|
|
private boolean jcAnnotatedTypeInit = false;
|
|
private Class<?> jcAnnotatedTypeClass = null;
|
|
|
|
/* loaded from: com.discord-119107.apk:lombok/delombok/PrettyPrinter$UncheckedIOException.SCL.lombok */
|
|
public static final class UncheckedIOException extends RuntimeException {
|
|
UncheckedIOException(IOException iOException) {
|
|
super(toMsg(iOException));
|
|
setStackTrace(iOException.getStackTrace());
|
|
}
|
|
|
|
private static String toMsg(Throwable th) {
|
|
String message = th.getMessage();
|
|
String simpleName = th.getClass().getSimpleName();
|
|
return (message == null || message.isEmpty()) ? simpleName : String.valueOf(simpleName) + ": " + message;
|
|
}
|
|
}
|
|
|
|
static {
|
|
Method method;
|
|
HashMap hashMap = new HashMap();
|
|
hashMap.put(JavacTreeMaker.TreeTag.treeTag("POS"), BadgeDrawable.DEFAULT_EXCEED_MAX_BADGE_NUMBER_SUFFIX);
|
|
hashMap.put(JavacTreeMaker.TreeTag.treeTag("NEG"), "-");
|
|
hashMap.put(JavacTreeMaker.TreeTag.treeTag("NOT"), "!");
|
|
hashMap.put(JavacTreeMaker.TreeTag.treeTag("COMPL"), "~");
|
|
hashMap.put(JavacTreeMaker.TreeTag.treeTag("PREINC"), "++");
|
|
hashMap.put(JavacTreeMaker.TreeTag.treeTag("PREDEC"), "--");
|
|
hashMap.put(JavacTreeMaker.TreeTag.treeTag("POSTINC"), "++");
|
|
hashMap.put(JavacTreeMaker.TreeTag.treeTag("POSTDEC"), "--");
|
|
hashMap.put(JavacTreeMaker.TreeTag.treeTag("NULLCHK"), "<*nullchk*>");
|
|
hashMap.put(JavacTreeMaker.TreeTag.treeTag("OR"), "||");
|
|
hashMap.put(JavacTreeMaker.TreeTag.treeTag("AND"), "&&");
|
|
hashMap.put(JavacTreeMaker.TreeTag.treeTag("EQ"), "==");
|
|
hashMap.put(JavacTreeMaker.TreeTag.treeTag("NE"), "!=");
|
|
hashMap.put(JavacTreeMaker.TreeTag.treeTag("LT"), "<");
|
|
hashMap.put(JavacTreeMaker.TreeTag.treeTag("GT"), ">");
|
|
hashMap.put(JavacTreeMaker.TreeTag.treeTag("LE"), "<=");
|
|
hashMap.put(JavacTreeMaker.TreeTag.treeTag("GE"), ">=");
|
|
hashMap.put(JavacTreeMaker.TreeTag.treeTag("BITOR"), "|");
|
|
hashMap.put(JavacTreeMaker.TreeTag.treeTag("BITXOR"), "^");
|
|
hashMap.put(JavacTreeMaker.TreeTag.treeTag("BITAND"), "&");
|
|
hashMap.put(JavacTreeMaker.TreeTag.treeTag("SL"), "<<");
|
|
hashMap.put(JavacTreeMaker.TreeTag.treeTag("SR"), ">>");
|
|
hashMap.put(JavacTreeMaker.TreeTag.treeTag("USR"), ">>>");
|
|
hashMap.put(JavacTreeMaker.TreeTag.treeTag("PLUS"), BadgeDrawable.DEFAULT_EXCEED_MAX_BADGE_NUMBER_SUFFIX);
|
|
hashMap.put(JavacTreeMaker.TreeTag.treeTag("MINUS"), "-");
|
|
hashMap.put(JavacTreeMaker.TreeTag.treeTag("MUL"), "*");
|
|
hashMap.put(JavacTreeMaker.TreeTag.treeTag("DIV"), AutocompleteViewModel.COMMAND_DISCOVER_TOKEN);
|
|
hashMap.put(JavacTreeMaker.TreeTag.treeTag("MOD"), "%");
|
|
hashMap.put(JavacTreeMaker.TreeTag.treeTag("BITOR_ASG"), "|=");
|
|
hashMap.put(JavacTreeMaker.TreeTag.treeTag("BITXOR_ASG"), "^=");
|
|
hashMap.put(JavacTreeMaker.TreeTag.treeTag("BITAND_ASG"), "&=");
|
|
hashMap.put(JavacTreeMaker.TreeTag.treeTag("SL_ASG"), "<<=");
|
|
hashMap.put(JavacTreeMaker.TreeTag.treeTag("SR_ASG"), ">>=");
|
|
hashMap.put(JavacTreeMaker.TreeTag.treeTag("USR_ASG"), ">>>=");
|
|
hashMap.put(JavacTreeMaker.TreeTag.treeTag("PLUS_ASG"), "+=");
|
|
hashMap.put(JavacTreeMaker.TreeTag.treeTag("MINUS_ASG"), "-=");
|
|
hashMap.put(JavacTreeMaker.TreeTag.treeTag("MUL_ASG"), "*=");
|
|
hashMap.put(JavacTreeMaker.TreeTag.treeTag("DIV_ASG"), "/=");
|
|
hashMap.put(JavacTreeMaker.TreeTag.treeTag("MOD_ASG"), "%=");
|
|
OPERATORS = hashMap;
|
|
if (Javac.getJavaCompilerVersion() < 8) {
|
|
getEndPosition = getMethod(JCDiagnostic.DiagnosticPosition.class, "getEndPosition", Map.class);
|
|
storeEnd = getMethod(Map.class, "put", Object.class, Object.class);
|
|
} else {
|
|
getEndPosition = getMethod(JCDiagnostic.DiagnosticPosition.class, "getEndPosition", "com.sun.tools.javac.tree.EndPosTable");
|
|
try {
|
|
try {
|
|
method = Permit.getMethod(Class.forName("com.sun.tools.javac.tree.EndPosTable"), "storeEnd", JCTree.class, Integer.TYPE);
|
|
} catch (NoSuchMethodException unused) {
|
|
try {
|
|
method = Permit.getMethod(Class.forName("com.sun.tools.javac.parser.JavacParser$AbstractEndPosTable"), "storeEnd", JCTree.class, Integer.TYPE);
|
|
} catch (ClassNotFoundException e) {
|
|
throw sneakyThrow(e);
|
|
} catch (NoSuchMethodException e2) {
|
|
throw sneakyThrow(e2);
|
|
}
|
|
}
|
|
storeEnd = method;
|
|
} catch (ClassNotFoundException e3) {
|
|
throw sneakyThrow(e3);
|
|
}
|
|
}
|
|
Permit.setAccessible(getEndPosition);
|
|
Permit.setAccessible(storeEnd);
|
|
reflectionCache = new HashMap();
|
|
}
|
|
|
|
public PrettyPrinter(Writer writer, JCTree.JCCompilationUnit jCCompilationUnit, List<CommentInfo> list, int[] iArr, FormatPreferences formatPreferences) {
|
|
this.out = writer;
|
|
this.comments = list;
|
|
this.textBlockStarts = iArr;
|
|
this.compilationUnit = jCCompilationUnit;
|
|
this.formatPreferences = formatPreferences;
|
|
Object docComments = Javac.getDocComments(this.compilationUnit);
|
|
if (docComments instanceof Map) {
|
|
this.docComments = (Map) docComments;
|
|
this.docTable = null;
|
|
} else if (docComments instanceof DocCommentTable) {
|
|
this.docComments = null;
|
|
this.docTable = (DocCommentTable) docComments;
|
|
} else {
|
|
this.docComments = null;
|
|
this.docTable = null;
|
|
}
|
|
}
|
|
|
|
private int endPos(JCTree jCTree) {
|
|
return Javac.getEndPosition(jCTree, this.compilationUnit);
|
|
}
|
|
|
|
private void align() {
|
|
if (this.onNewLine) {
|
|
for (int i = 0; i < this.indent; i++) {
|
|
try {
|
|
this.out.write(this.formatPreferences.indent());
|
|
} catch (IOException e) {
|
|
throw new UncheckedIOException(e);
|
|
}
|
|
}
|
|
this.onNewLine = false;
|
|
this.aligned = true;
|
|
this.needsAlign = false;
|
|
}
|
|
}
|
|
|
|
private void print(JCTree jCTree) {
|
|
if (jCTree == null) {
|
|
print("/*missing*/");
|
|
return;
|
|
}
|
|
consumeComments(jCTree);
|
|
jCTree.accept(this);
|
|
consumeTrailingComments(endPos(jCTree));
|
|
}
|
|
|
|
private void print(List<? extends JCTree> list, String str) {
|
|
boolean z2 = true;
|
|
JCTree jCTree = null;
|
|
Iterator it = list.iterator();
|
|
while (it.hasNext()) {
|
|
JCTree jCTree2 = (JCTree) it.next();
|
|
if (!suppress(jCTree2)) {
|
|
if (!z2 && str != null && !str.isEmpty()) {
|
|
if ("\n".equals(str)) {
|
|
println(jCTree);
|
|
} else {
|
|
print(str);
|
|
}
|
|
}
|
|
z2 = false;
|
|
print(jCTree2);
|
|
jCTree = jCTree2;
|
|
}
|
|
}
|
|
}
|
|
|
|
private boolean suppress(JCTree jCTree) {
|
|
if (jCTree instanceof JCTree.JCBlock) {
|
|
JCTree.JCBlock jCBlock = (JCTree.JCBlock) jCTree;
|
|
return -1 == jCBlock.pos && jCBlock.stats.isEmpty();
|
|
} else if (!(jCTree instanceof JCTree.JCExpressionStatement)) {
|
|
return false;
|
|
} else {
|
|
JCTree.JCMethodInvocation jCMethodInvocation = ((JCTree.JCExpressionStatement) jCTree).expr;
|
|
if (!(jCMethodInvocation instanceof JCTree.JCMethodInvocation)) {
|
|
return false;
|
|
}
|
|
JCTree.JCMethodInvocation jCMethodInvocation2 = jCMethodInvocation;
|
|
if (!jCMethodInvocation2.typeargs.isEmpty() || !jCMethodInvocation2.args.isEmpty() || !(jCMethodInvocation2.meth instanceof JCTree.JCIdent) || jCTree.pos != ((JCTree.JCExpression) jCMethodInvocation).pos) {
|
|
return false;
|
|
}
|
|
return jCMethodInvocation2.meth.name.toString().equals("super");
|
|
}
|
|
}
|
|
|
|
private void print(CharSequence charSequence) {
|
|
boolean z2 = this.needsAlign;
|
|
if (this.needsNewLine && !this.onNewLine) {
|
|
println();
|
|
}
|
|
if (z2 && !this.aligned) {
|
|
align();
|
|
}
|
|
try {
|
|
if (this.needsSpace && !this.onNewLine && !this.aligned) {
|
|
this.out.write(32);
|
|
}
|
|
this.out.write(charSequence.toString());
|
|
this.needsSpace = false;
|
|
this.onNewLine = false;
|
|
this.aligned = false;
|
|
} catch (IOException e) {
|
|
throw new UncheckedIOException(e);
|
|
}
|
|
}
|
|
|
|
private void println() {
|
|
try {
|
|
this.out.write(LINE_SEP);
|
|
this.onNewLine = true;
|
|
this.aligned = false;
|
|
this.needsNewLine = false;
|
|
} catch (IOException e) {
|
|
throw new UncheckedIOException(e);
|
|
}
|
|
}
|
|
|
|
private void println(JCTree jCTree) {
|
|
if (jCTree != null) {
|
|
consumeTrailingComments(endPos(jCTree));
|
|
}
|
|
try {
|
|
this.out.write(LINE_SEP);
|
|
this.onNewLine = true;
|
|
this.aligned = false;
|
|
this.needsNewLine = false;
|
|
} catch (IOException e) {
|
|
throw new UncheckedIOException(e);
|
|
}
|
|
}
|
|
|
|
private void println(CharSequence charSequence) {
|
|
print(charSequence);
|
|
println();
|
|
}
|
|
|
|
private void println(CharSequence charSequence, JCTree jCTree) {
|
|
print(charSequence);
|
|
println(jCTree);
|
|
}
|
|
|
|
private void aPrint(CharSequence charSequence) {
|
|
align();
|
|
print(charSequence);
|
|
}
|
|
|
|
private void aPrintln(CharSequence charSequence) {
|
|
align();
|
|
print(charSequence);
|
|
println();
|
|
}
|
|
|
|
private void aPrintln(CharSequence charSequence, JCTree jCTree) {
|
|
align();
|
|
print(charSequence);
|
|
println(jCTree);
|
|
}
|
|
|
|
private void consumeComments(int i) {
|
|
Object obj = this.comments.head;
|
|
while (true) {
|
|
CommentInfo commentInfo = (CommentInfo) obj;
|
|
if (this.comments.nonEmpty() && commentInfo.pos < i) {
|
|
printComment(commentInfo);
|
|
this.comments = this.comments.tail;
|
|
obj = this.comments.head;
|
|
} else {
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
private void consumeComments(JCTree jCTree) {
|
|
consumeComments(jCTree.pos);
|
|
}
|
|
|
|
private void consumeTrailingComments(int i) {
|
|
boolean z2 = this.onNewLine;
|
|
CommentInfo commentInfo = (CommentInfo) this.comments.head;
|
|
boolean z3 = false;
|
|
while (this.comments.nonEmpty() && commentInfo.prevEndPos == i && !z3 && commentInfo.start != CommentInfo.StartConnection.ON_NEXT_LINE && commentInfo.start != CommentInfo.StartConnection.START_OF_LINE) {
|
|
i = commentInfo.endPos;
|
|
printComment(commentInfo);
|
|
z3 = commentInfo.end == CommentInfo.EndConnection.ON_NEXT_LINE;
|
|
this.comments = this.comments.tail;
|
|
commentInfo = (CommentInfo) this.comments.head;
|
|
}
|
|
if (!this.onNewLine && z2) {
|
|
println();
|
|
}
|
|
}
|
|
|
|
private String getJavadocFor(JCTree jCTree) {
|
|
if (this.docComments != null) {
|
|
return this.docComments.get(jCTree);
|
|
}
|
|
if (this.docTable != null) {
|
|
return this.docTable.getCommentText(jCTree);
|
|
}
|
|
return null;
|
|
}
|
|
|
|
private int dims(JCTree.JCExpression jCExpression) {
|
|
if (jCExpression instanceof JCTree.JCArrayTypeTree) {
|
|
return 1 + dims(((JCTree.JCArrayTypeTree) jCExpression).elemtype);
|
|
}
|
|
if (!isJcAnnotatedType(jCExpression)) {
|
|
return 0;
|
|
}
|
|
JCTree.JCArrayTypeTree jCArrayTypeTree = (JCTree) readObject(jCExpression, "underlyingType", null);
|
|
if (jCArrayTypeTree instanceof JCTree.JCArrayTypeTree) {
|
|
return 1 + dims(jCArrayTypeTree.elemtype);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
private void printComment(CommentInfo commentInfo) {
|
|
switch ($SWITCH_TABLE$lombok$javac$CommentInfo$StartConnection()[commentInfo.start.ordinal()]) {
|
|
case 1:
|
|
this.needsNewLine = true;
|
|
this.needsAlign = false;
|
|
break;
|
|
case 2:
|
|
if (this.onNewLine) {
|
|
if (!this.aligned) {
|
|
this.needsAlign = true;
|
|
break;
|
|
}
|
|
} else {
|
|
this.needsNewLine = true;
|
|
this.needsAlign = true;
|
|
break;
|
|
}
|
|
break;
|
|
case 3:
|
|
this.needsSpace = false;
|
|
break;
|
|
case 4:
|
|
this.needsSpace = true;
|
|
break;
|
|
}
|
|
if (this.onNewLine && !this.aligned && commentInfo.start != CommentInfo.StartConnection.START_OF_LINE) {
|
|
this.needsAlign = true;
|
|
}
|
|
print(commentInfo.content);
|
|
switch ($SWITCH_TABLE$lombok$javac$CommentInfo$EndConnection()[commentInfo.end.ordinal()]) {
|
|
case 1:
|
|
default:
|
|
return;
|
|
case 2:
|
|
this.needsSpace = true;
|
|
return;
|
|
case 3:
|
|
if (!this.aligned) {
|
|
this.needsNewLine = true;
|
|
this.needsAlign = true;
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
}
|
|
|
|
private void printDocComment(JCTree jCTree) {
|
|
String[] split;
|
|
String javadocFor = getJavadocFor(jCTree);
|
|
if (javadocFor != null) {
|
|
aPrintln("/**");
|
|
boolean z2 = true;
|
|
for (String str : javadocFor.split("\\r?\\n")) {
|
|
if (!z2 || !str.trim().isEmpty()) {
|
|
z2 = false;
|
|
aPrint(" *");
|
|
if (!str.isEmpty() && !Character.isWhitespace(str.charAt(0))) {
|
|
print(" ");
|
|
}
|
|
println(str);
|
|
} else {
|
|
z2 = false;
|
|
}
|
|
}
|
|
aPrintln(" */");
|
|
}
|
|
}
|
|
|
|
private Name name_init(Name name) {
|
|
if (this.__INIT__ == null) {
|
|
this.__INIT__ = name.table.fromChars("<init>".toCharArray(), 0, 6);
|
|
}
|
|
return this.__INIT__;
|
|
}
|
|
|
|
private Name name_value(Name name) {
|
|
if (this.__VALUE__ == null) {
|
|
this.__VALUE__ = name.table.fromChars("value".toCharArray(), 0, 5);
|
|
}
|
|
return this.__VALUE__;
|
|
}
|
|
|
|
public void visitTopLevel(JCTree.JCCompilationUnit jCCompilationUnit) {
|
|
printDocComment(jCCompilationUnit);
|
|
JCTree packageNode = PackageName.getPackageNode(jCCompilationUnit);
|
|
if (packageNode != null) {
|
|
consumeComments((JCTree) jCCompilationUnit);
|
|
aPrint("package ");
|
|
print(packageNode);
|
|
println(";", packageNode);
|
|
}
|
|
boolean z2 = true;
|
|
Iterator it = jCCompilationUnit.defs.iterator();
|
|
while (it.hasNext()) {
|
|
JCTree jCTree = (JCTree) it.next();
|
|
if (jCTree instanceof JCTree.JCImport) {
|
|
if (z2) {
|
|
println();
|
|
}
|
|
z2 = false;
|
|
print(jCTree);
|
|
}
|
|
}
|
|
Iterator it2 = jCCompilationUnit.defs.iterator();
|
|
while (it2.hasNext()) {
|
|
JCTree jCTree2 = (JCTree) it2.next();
|
|
if (!(jCTree2 instanceof JCTree.JCImport)) {
|
|
print(jCTree2);
|
|
}
|
|
}
|
|
consumeComments(Integer.MAX_VALUE);
|
|
}
|
|
|
|
public void visitImport(JCTree.JCImport jCImport) {
|
|
if (jCImport.qualid instanceof JCTree.JCFieldAccess) {
|
|
JCTree.JCFieldAccess jCFieldAccess = jCImport.qualid;
|
|
if (jCFieldAccess.name.length() == 1 && jCFieldAccess.name.contentEquals("*") && (jCFieldAccess.selected instanceof JCTree.JCFieldAccess)) {
|
|
JCTree.JCFieldAccess jCFieldAccess2 = jCFieldAccess.selected;
|
|
if (jCFieldAccess2.name.contentEquals("experimental") && (jCFieldAccess2.selected instanceof JCTree.JCIdent) && jCFieldAccess2.selected.name.contentEquals("lombok")) {
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
aPrint("import ");
|
|
if (jCImport.staticImport) {
|
|
print("static ");
|
|
}
|
|
print(jCImport.qualid);
|
|
println(";", jCImport);
|
|
}
|
|
|
|
public void visitClassDef(JCTree.JCClassDecl jCClassDecl) {
|
|
println();
|
|
printDocComment(jCClassDecl);
|
|
align();
|
|
print((JCTree) jCClassDecl.mods);
|
|
boolean z2 = (jCClassDecl.mods.flags & 512) != 0;
|
|
boolean z3 = z2 && (jCClassDecl.mods.flags & Permission.MANAGE_MESSAGES) != 0;
|
|
boolean z4 = (jCClassDecl.mods.flags & Permission.EMBED_LINKS) != 0;
|
|
if (z3) {
|
|
print("@interface ");
|
|
} else if (z2) {
|
|
print("interface ");
|
|
} else if (z4) {
|
|
print("enum ");
|
|
} else {
|
|
print("class ");
|
|
}
|
|
print((CharSequence) jCClassDecl.name);
|
|
Name name = this.currentTypeName;
|
|
this.currentTypeName = jCClassDecl.name;
|
|
if (jCClassDecl.typarams.nonEmpty()) {
|
|
print("<");
|
|
print(jCClassDecl.typarams, ", ");
|
|
print(">");
|
|
}
|
|
JCTree extendsClause = getExtendsClause(jCClassDecl);
|
|
if (extendsClause != null) {
|
|
print(" extends ");
|
|
print(extendsClause);
|
|
}
|
|
if (jCClassDecl.implementing.nonEmpty()) {
|
|
print(z2 ? " extends " : " implements ");
|
|
print(jCClassDecl.implementing, ", ");
|
|
}
|
|
println(" {");
|
|
this.indent++;
|
|
printClassMembers(jCClassDecl.defs, z4, z2);
|
|
consumeComments(endPos(jCClassDecl));
|
|
this.indent--;
|
|
aPrintln("}", jCClassDecl);
|
|
this.currentTypeName = name;
|
|
}
|
|
|
|
private void printClassMembers(List<JCTree> list, boolean z2, boolean z3) {
|
|
Class<?> cls = null;
|
|
char c = z2 ? (char) 3 : (char) 0;
|
|
boolean z4 = z2;
|
|
Iterator it = list.iterator();
|
|
while (it.hasNext()) {
|
|
JCTree.JCMethodDecl jCMethodDecl = (JCTree) it.next();
|
|
if (c != 3 || !(jCMethodDecl instanceof JCTree.JCMethodDecl) || (jCMethodDecl.mods.flags & Permission.CREATE_PRIVATE_THREADS) == 0) {
|
|
boolean z5 = z2 && (jCMethodDecl instanceof JCTree.JCVariableDecl) && (((JCTree.JCVariableDecl) jCMethodDecl).mods.flags & Permission.EMBED_LINKS) != 0;
|
|
if (!z5 && z4) {
|
|
z4 = false;
|
|
if (c == 3) {
|
|
align();
|
|
}
|
|
println(";");
|
|
}
|
|
if (z5) {
|
|
if (!(cls == null || cls == JCTree.JCVariableDecl.class)) {
|
|
println();
|
|
}
|
|
switch (c) {
|
|
case 1:
|
|
print(", ");
|
|
break;
|
|
case 2:
|
|
println(",");
|
|
align();
|
|
break;
|
|
}
|
|
print((JCTree) jCMethodDecl);
|
|
JCTree.JCNewClass jCNewClass = ((JCTree.JCVariableDecl) jCMethodDecl).init;
|
|
c = (!(jCNewClass instanceof JCTree.JCNewClass) || jCNewClass.def == null) ? (char) 1 : (char) 2;
|
|
} else if (jCMethodDecl instanceof JCTree.JCVariableDecl) {
|
|
if (!(cls == null || cls == JCTree.JCVariableDecl.class)) {
|
|
println();
|
|
}
|
|
if (z3) {
|
|
this.flagMod = -26L;
|
|
}
|
|
print((JCTree) jCMethodDecl);
|
|
} else if (jCMethodDecl instanceof JCTree.JCMethodDecl) {
|
|
if ((jCMethodDecl.mods.flags & Permission.CREATE_PRIVATE_THREADS) == 0) {
|
|
if (cls != null) {
|
|
println();
|
|
}
|
|
if (z3) {
|
|
this.flagMod = -1026L;
|
|
}
|
|
print((JCTree) jCMethodDecl);
|
|
}
|
|
} else if (jCMethodDecl instanceof JCTree.JCClassDecl) {
|
|
if (cls != null) {
|
|
println();
|
|
}
|
|
if (z3) {
|
|
this.flagMod = -10L;
|
|
}
|
|
print((JCTree) jCMethodDecl);
|
|
} else {
|
|
if (cls != null) {
|
|
println();
|
|
}
|
|
print((JCTree) jCMethodDecl);
|
|
}
|
|
cls = jCMethodDecl.getClass();
|
|
}
|
|
}
|
|
if (z4) {
|
|
if (c == 3) {
|
|
align();
|
|
}
|
|
println(";");
|
|
}
|
|
}
|
|
|
|
public void visitTypeParameter(JCTree.JCTypeParameter jCTypeParameter) {
|
|
List<? extends JCTree> list = (List) readObject(jCTypeParameter, "annotations", List.nil());
|
|
if (!list.isEmpty()) {
|
|
print(list, " ");
|
|
print(" ");
|
|
}
|
|
print((CharSequence) jCTypeParameter.name);
|
|
if (jCTypeParameter.bounds.nonEmpty()) {
|
|
print(" extends ");
|
|
print(jCTypeParameter.bounds, " & ");
|
|
}
|
|
consumeComments((JCTree) jCTypeParameter);
|
|
}
|
|
|
|
public void visitVarDef(JCTree.JCVariableDecl jCVariableDecl) {
|
|
printDocComment(jCVariableDecl);
|
|
align();
|
|
if ((jCVariableDecl.mods.flags & Permission.EMBED_LINKS) != 0) {
|
|
printEnumMember(jCVariableDecl);
|
|
return;
|
|
}
|
|
printAnnotations(jCVariableDecl.mods.annotations, true);
|
|
printModifierKeywords(jCVariableDecl.mods);
|
|
printVarDef0(jCVariableDecl);
|
|
println(";", jCVariableDecl);
|
|
}
|
|
|
|
private void printVarDefInline(JCTree.JCVariableDecl jCVariableDecl) {
|
|
printAnnotations(jCVariableDecl.mods.annotations, false);
|
|
printModifierKeywords(jCVariableDecl.mods);
|
|
printVarDef0(jCVariableDecl);
|
|
}
|
|
|
|
/* JADX WARN: Finally extract failed */
|
|
private void printVarDef0(JCTree.JCVariableDecl jCVariableDecl) {
|
|
try {
|
|
this.innermostArrayBracketsAreVarargs = (jCVariableDecl.mods.flags & Permission.MANAGE_THREADS) != 0;
|
|
if (jCVariableDecl.vartype == null || jCVariableDecl.vartype.pos == -1) {
|
|
print("var");
|
|
} else {
|
|
print((JCTree) jCVariableDecl.vartype);
|
|
}
|
|
this.innermostArrayBracketsAreVarargs = false;
|
|
print(" ");
|
|
print((CharSequence) jCVariableDecl.name);
|
|
if (jCVariableDecl.init != null) {
|
|
print(" = ");
|
|
print((JCTree) jCVariableDecl.init);
|
|
}
|
|
} catch (Throwable th) {
|
|
this.innermostArrayBracketsAreVarargs = false;
|
|
throw th;
|
|
}
|
|
}
|
|
|
|
private void printEnumMember(JCTree.JCVariableDecl jCVariableDecl) {
|
|
printAnnotations(jCVariableDecl.mods.annotations, true);
|
|
print((CharSequence) jCVariableDecl.name);
|
|
if (jCVariableDecl.init instanceof JCTree.JCNewClass) {
|
|
JCTree.JCNewClass jCNewClass = jCVariableDecl.init;
|
|
if (jCNewClass.args != null && jCNewClass.args.nonEmpty()) {
|
|
print("(");
|
|
print(jCNewClass.args, ", ");
|
|
print(")");
|
|
}
|
|
if (jCNewClass.def != null && jCNewClass.def.defs != null) {
|
|
println(" {");
|
|
this.indent++;
|
|
printClassMembers(jCNewClass.def.defs, false, false);
|
|
consumeComments(endPos(jCVariableDecl));
|
|
this.indent--;
|
|
aPrint("}");
|
|
}
|
|
}
|
|
}
|
|
|
|
public void visitTypeApply(JCTree.JCTypeApply jCTypeApply) {
|
|
print((JCTree) jCTypeApply.clazz);
|
|
print("<");
|
|
boolean z2 = this.innermostArrayBracketsAreVarargs;
|
|
this.innermostArrayBracketsAreVarargs = false;
|
|
print(jCTypeApply.arguments, ", ");
|
|
this.innermostArrayBracketsAreVarargs = z2;
|
|
print(">");
|
|
}
|
|
|
|
public void visitWildcard(JCTree.JCWildcard jCWildcard) {
|
|
switch ($SWITCH_TABLE$com$sun$source$tree$Tree$Kind()[jCWildcard.getKind().ordinal()]) {
|
|
case 88:
|
|
default:
|
|
print("?");
|
|
return;
|
|
case 89:
|
|
print("? extends ");
|
|
print(jCWildcard.inner);
|
|
return;
|
|
case 90:
|
|
print("? super ");
|
|
print(jCWildcard.inner);
|
|
return;
|
|
}
|
|
}
|
|
|
|
public void visitLiteral(JCTree.JCLiteral jCLiteral) {
|
|
JavacTreeMaker.TypeTag typeTag = JavacTreeMaker.TypeTag.typeTag((JCTree) jCLiteral);
|
|
if (Javac.CTC_INT.equals(typeTag)) {
|
|
print(new StringBuilder().append(jCLiteral.value).toString());
|
|
} else if (Javac.CTC_LONG.equals(typeTag)) {
|
|
print(jCLiteral.value + "L");
|
|
} else if (Javac.CTC_FLOAT.equals(typeTag)) {
|
|
print(jCLiteral.value + "F");
|
|
} else if (Javac.CTC_DOUBLE.equals(typeTag)) {
|
|
print(new StringBuilder().append(jCLiteral.value).toString());
|
|
} else if (Javac.CTC_CHAR.equals(typeTag)) {
|
|
print("'" + quoteChar((char) ((Number) jCLiteral.value).intValue()) + "'");
|
|
} else if (Javac.CTC_BOOLEAN.equals(typeTag)) {
|
|
print(((Number) jCLiteral.value).intValue() == 1 ? "true" : "false");
|
|
} else if (Javac.CTC_BOT.equals(typeTag)) {
|
|
print("null");
|
|
} else if (Arrays.binarySearch(this.textBlockStarts, jCLiteral.pos) < 0) {
|
|
print("\"" + quoteChars(jCLiteral.value.toString()) + "\"");
|
|
} else {
|
|
printTextBlock(jCLiteral.value.toString());
|
|
}
|
|
}
|
|
|
|
private void printTextBlock(String str) {
|
|
println("\"\"\"");
|
|
this.needsAlign = true;
|
|
this.indent++;
|
|
StringBuilder sb = new StringBuilder();
|
|
boolean z2 = true;
|
|
for (int i = 0; i < str.length(); i++) {
|
|
char charAt = str.charAt(i);
|
|
if (!(charAt == ' ' || charAt == '\t')) {
|
|
z2 = false;
|
|
}
|
|
if (charAt == '\n') {
|
|
println(sb);
|
|
sb.setLength(0);
|
|
this.needsAlign = true;
|
|
z2 = true;
|
|
} else if (charAt != '\t' || !z2) {
|
|
sb.append(quoteChar(str.charAt(i)));
|
|
} else {
|
|
sb.append("\t");
|
|
}
|
|
}
|
|
print(sb);
|
|
print("\"\"\"");
|
|
this.indent--;
|
|
}
|
|
|
|
public void visitMethodDef(JCTree.JCMethodDecl jCMethodDecl) {
|
|
boolean z2 = jCMethodDecl.name == name_init(jCMethodDecl.name);
|
|
if (!z2 || (jCMethodDecl.mods.flags & Permission.CREATE_PRIVATE_THREADS) == 0) {
|
|
printDocComment(jCMethodDecl);
|
|
align();
|
|
print((JCTree) jCMethodDecl.mods);
|
|
if (jCMethodDecl.typarams != null && jCMethodDecl.typarams.nonEmpty()) {
|
|
print("<");
|
|
print(jCMethodDecl.typarams, ", ");
|
|
print("> ");
|
|
}
|
|
if (z2) {
|
|
print(this.currentTypeName == null ? "<init>" : this.currentTypeName);
|
|
} else {
|
|
print((JCTree) jCMethodDecl.restype);
|
|
print(" ");
|
|
print((CharSequence) jCMethodDecl.name);
|
|
}
|
|
boolean z3 = true;
|
|
print("(");
|
|
JCTree.JCVariableDecl jCVariableDecl = (JCTree.JCVariableDecl) readObject(jCMethodDecl, "recvparam", null);
|
|
if (jCVariableDecl != null) {
|
|
printVarDefInline(jCVariableDecl);
|
|
z3 = false;
|
|
}
|
|
Iterator it = jCMethodDecl.params.iterator();
|
|
while (it.hasNext()) {
|
|
JCTree.JCVariableDecl jCVariableDecl2 = (JCTree.JCVariableDecl) it.next();
|
|
if (!z3) {
|
|
print(", ");
|
|
}
|
|
z3 = false;
|
|
printVarDefInline(jCVariableDecl2);
|
|
}
|
|
print(")");
|
|
if (jCMethodDecl.thrown.nonEmpty()) {
|
|
print(" throws ");
|
|
print(jCMethodDecl.thrown, ", ");
|
|
}
|
|
if (jCMethodDecl.defaultValue != null) {
|
|
print(" default ");
|
|
print((JCTree) jCMethodDecl.defaultValue);
|
|
}
|
|
if (jCMethodDecl.body != null) {
|
|
print(" ");
|
|
print((JCTree) jCMethodDecl.body);
|
|
return;
|
|
}
|
|
println(";", jCMethodDecl);
|
|
}
|
|
}
|
|
|
|
public void visitSkip(JCTree.JCSkip jCSkip) {
|
|
if (this.onNewLine && !this.aligned) {
|
|
align();
|
|
}
|
|
println(";");
|
|
}
|
|
|
|
public void visitAnnotation(JCTree.JCAnnotation jCAnnotation) {
|
|
print("@");
|
|
print(jCAnnotation.annotationType);
|
|
if (!jCAnnotation.args.isEmpty()) {
|
|
print("(");
|
|
boolean z2 = false;
|
|
if (jCAnnotation.args.length() == 1 && (jCAnnotation.args.get(0) instanceof JCTree.JCAssign)) {
|
|
JCTree.JCAssign jCAssign = (JCTree.JCAssign) jCAnnotation.args.get(0);
|
|
JCTree.JCIdent jCIdent = jCAssign.lhs instanceof JCTree.JCIdent ? (JCTree.JCIdent) jCAssign.lhs : null;
|
|
if (jCIdent != null && jCIdent.name == name_value(jCIdent.name)) {
|
|
print((JCTree) jCAssign.rhs);
|
|
z2 = true;
|
|
}
|
|
}
|
|
if (!z2) {
|
|
print(jCAnnotation.args, ", ");
|
|
}
|
|
print(")");
|
|
}
|
|
}
|
|
|
|
public void visitTypeArray(JCTree.JCArrayTypeTree jCArrayTypeTree) {
|
|
printTypeArray0(jCArrayTypeTree);
|
|
}
|
|
|
|
public void visitNewArray(JCTree.JCNewArray jCNewArray) {
|
|
JCTree.JCExpression jCExpression = jCNewArray.elemtype;
|
|
int i = 0;
|
|
if (jCExpression != null) {
|
|
print("new ");
|
|
while (jCExpression instanceof JCTree.JCArrayTypeTree) {
|
|
i++;
|
|
jCExpression = ((JCTree.JCArrayTypeTree) jCExpression).elemtype;
|
|
}
|
|
print((JCTree) jCExpression);
|
|
Iterator it = jCNewArray.dims.iterator();
|
|
while (it.hasNext()) {
|
|
print("[");
|
|
print((JCTree) ((JCTree.JCExpression) it.next()));
|
|
print("]");
|
|
}
|
|
}
|
|
for (int i2 = 0; i2 < i; i2++) {
|
|
print("[]");
|
|
}
|
|
if (jCNewArray.elems != null) {
|
|
if (jCExpression != null) {
|
|
print("[] ");
|
|
}
|
|
print("{");
|
|
print(jCNewArray.elems, ", ");
|
|
print("}");
|
|
}
|
|
}
|
|
|
|
public void visitNewClass(JCTree.JCNewClass jCNewClass) {
|
|
if (jCNewClass.encl != null) {
|
|
print((JCTree) jCNewClass.encl);
|
|
print(".");
|
|
}
|
|
boolean z2 = jCNewClass.args.nonEmpty() && (jCNewClass.args.head instanceof JCTree.JCUnary) && ((JCTree.JCExpression) jCNewClass.args.head).toString().startsWith("<*nullchk*>");
|
|
if (z2) {
|
|
print((JCTree) ((JCTree.JCUnary) jCNewClass.args.head).arg);
|
|
print(".");
|
|
}
|
|
print("new ");
|
|
if (!jCNewClass.typeargs.isEmpty()) {
|
|
print("<");
|
|
print(jCNewClass.typeargs, ", ");
|
|
print(">");
|
|
}
|
|
print((JCTree) jCNewClass.clazz);
|
|
print("(");
|
|
if (z2) {
|
|
print(jCNewClass.args.tail, ", ");
|
|
} else {
|
|
print(jCNewClass.args, ", ");
|
|
}
|
|
print(")");
|
|
if (jCNewClass.def != null) {
|
|
Name name = this.currentTypeName;
|
|
this.currentTypeName = null;
|
|
println(" {");
|
|
this.indent++;
|
|
print(jCNewClass.def.defs, "");
|
|
this.indent--;
|
|
aPrint("}");
|
|
this.currentTypeName = name;
|
|
}
|
|
}
|
|
|
|
public void visitIndexed(JCTree.JCArrayAccess jCArrayAccess) {
|
|
print((JCTree) jCArrayAccess.indexed);
|
|
print("[");
|
|
print((JCTree) jCArrayAccess.index);
|
|
print("]");
|
|
}
|
|
|
|
public void visitTypeIdent(JCTree.JCPrimitiveTypeTree jCPrimitiveTypeTree) {
|
|
JavacTreeMaker.TypeTag typeTag = JavacTreeMaker.TypeTag.typeTag((JCTree) jCPrimitiveTypeTree);
|
|
if (Javac.CTC_BYTE.equals(typeTag)) {
|
|
print("byte");
|
|
} else if (Javac.CTC_CHAR.equals(typeTag)) {
|
|
print("char");
|
|
} else if (Javac.CTC_SHORT.equals(typeTag)) {
|
|
print("short");
|
|
} else if (Javac.CTC_INT.equals(typeTag)) {
|
|
print("int");
|
|
} else if (Javac.CTC_LONG.equals(typeTag)) {
|
|
print(Constants.LONG);
|
|
} else if (Javac.CTC_FLOAT.equals(typeTag)) {
|
|
print("float");
|
|
} else if (Javac.CTC_DOUBLE.equals(typeTag)) {
|
|
print("double");
|
|
} else if (Javac.CTC_BOOLEAN.equals(typeTag)) {
|
|
print("boolean");
|
|
} else if (Javac.CTC_VOID.equals(typeTag)) {
|
|
print("void");
|
|
} else {
|
|
print("error");
|
|
}
|
|
}
|
|
|
|
public void visitLabelled(JCTree.JCLabeledStatement jCLabeledStatement) {
|
|
aPrint(jCLabeledStatement.label);
|
|
print(":");
|
|
if ((jCLabeledStatement.body instanceof JCTree.JCSkip) || suppress(jCLabeledStatement)) {
|
|
println(" ;", jCLabeledStatement);
|
|
} else if (jCLabeledStatement.body instanceof JCTree.JCBlock) {
|
|
print(" ");
|
|
print((JCTree) jCLabeledStatement.body);
|
|
} else {
|
|
println((JCTree) jCLabeledStatement);
|
|
print((JCTree) jCLabeledStatement.body);
|
|
}
|
|
}
|
|
|
|
public void visitModifiers(JCTree.JCModifiers jCModifiers) {
|
|
printAnnotations(jCModifiers.annotations, true);
|
|
printModifierKeywords(jCModifiers);
|
|
}
|
|
|
|
private void printAnnotations(List<JCTree.JCAnnotation> list, boolean z2) {
|
|
Iterator it = list.iterator();
|
|
while (it.hasNext()) {
|
|
print((JCTree) ((JCTree.JCAnnotation) it.next()));
|
|
if (z2) {
|
|
println();
|
|
align();
|
|
} else {
|
|
print(" ");
|
|
}
|
|
}
|
|
}
|
|
|
|
private void printModifierKeywords(JCTree.JCModifiers jCModifiers) {
|
|
long j = this.flagMod & jCModifiers.flags;
|
|
this.flagMod = -1L;
|
|
if ((j & Permission.SEND_TTS_MESSAGES) != 0) {
|
|
print("/* synthetic */ ");
|
|
}
|
|
if ((j & 1) != 0) {
|
|
print("public ");
|
|
}
|
|
if ((j & 2) != 0) {
|
|
print("private ");
|
|
}
|
|
if ((j & 4) != 0) {
|
|
print("protected ");
|
|
}
|
|
if ((j & 8) != 0) {
|
|
print("static ");
|
|
}
|
|
if ((j & 16) != 0) {
|
|
print("final ");
|
|
}
|
|
if ((j & 32) != 0) {
|
|
print("synchronized ");
|
|
}
|
|
if ((j & 64) != 0) {
|
|
print("volatile ");
|
|
}
|
|
if ((j & 128) != 0) {
|
|
print("transient ");
|
|
}
|
|
if ((j & 256) != 0) {
|
|
print("native ");
|
|
}
|
|
if ((j & Permission.VIEW_CHANNEL) != 0) {
|
|
print("abstract ");
|
|
}
|
|
if ((j & Permission.SEND_MESSAGES) != 0) {
|
|
print("strictfp ");
|
|
}
|
|
if ((j & DEFAULT) != 0 && (j & 512) == 0) {
|
|
print("default ");
|
|
}
|
|
}
|
|
|
|
public void visitSelect(JCTree.JCFieldAccess jCFieldAccess) {
|
|
print((JCTree) jCFieldAccess.selected);
|
|
print(".");
|
|
print((CharSequence) jCFieldAccess.name);
|
|
}
|
|
|
|
public void visitIdent(JCTree.JCIdent jCIdent) {
|
|
print((CharSequence) jCIdent.name);
|
|
}
|
|
|
|
public void visitApply(JCTree.JCMethodInvocation jCMethodInvocation) {
|
|
if (!jCMethodInvocation.typeargs.nonEmpty()) {
|
|
print((JCTree) jCMethodInvocation.meth);
|
|
} else if (jCMethodInvocation.meth instanceof JCTree.JCFieldAccess) {
|
|
JCTree.JCFieldAccess jCFieldAccess = jCMethodInvocation.meth;
|
|
print((JCTree) jCFieldAccess.selected);
|
|
print(".<");
|
|
print(jCMethodInvocation.typeargs, ", ");
|
|
print(">");
|
|
print((CharSequence) jCFieldAccess.name);
|
|
} else {
|
|
print("<");
|
|
print(jCMethodInvocation.typeargs, ", ");
|
|
print(">");
|
|
print((JCTree) jCMethodInvocation.meth);
|
|
}
|
|
print("(");
|
|
print(jCMethodInvocation.args, ", ");
|
|
print(")");
|
|
}
|
|
|
|
public void visitAssert(JCTree.JCAssert jCAssert) {
|
|
aPrint("assert ");
|
|
print((JCTree) jCAssert.cond);
|
|
if (jCAssert.detail != null) {
|
|
print(" : ");
|
|
print((JCTree) jCAssert.detail);
|
|
}
|
|
println(";", jCAssert);
|
|
}
|
|
|
|
public void visitAssign(JCTree.JCAssign jCAssign) {
|
|
print((JCTree) jCAssign.lhs);
|
|
print(" = ");
|
|
print((JCTree) jCAssign.rhs);
|
|
}
|
|
|
|
public void visitAssignop(JCTree.JCAssignOp jCAssignOp) {
|
|
print((JCTree) jCAssignOp.lhs);
|
|
print(" " + operator(JavacTreeMaker.TreeTag.treeTag((JCTree) jCAssignOp)) + " ");
|
|
print((JCTree) jCAssignOp.rhs);
|
|
}
|
|
|
|
public void visitUnary(JCTree.JCUnary jCUnary) {
|
|
String operator = operator(JavacTreeMaker.TreeTag.treeTag((JCTree) jCUnary));
|
|
if (JavacTreeMaker.TreeTag.treeTag((JCTree) jCUnary).getOperatorPrecedenceLevel() == 14) {
|
|
print(operator);
|
|
print((JCTree) jCUnary.arg);
|
|
return;
|
|
}
|
|
print((JCTree) jCUnary.arg);
|
|
print(operator);
|
|
}
|
|
|
|
public void visitBinary(JCTree.JCBinary jCBinary) {
|
|
String operator = operator(JavacTreeMaker.TreeTag.treeTag((JCTree) jCBinary));
|
|
print((JCTree) jCBinary.lhs);
|
|
print(" ");
|
|
print(operator);
|
|
print(" ");
|
|
print((JCTree) jCBinary.rhs);
|
|
}
|
|
|
|
public void visitTypeTest(JCTree.JCInstanceOf jCInstanceOf) {
|
|
print((JCTree) jCInstanceOf.expr);
|
|
print(" instanceof ");
|
|
JCTree jCTree = (JCTree) readObject(jCInstanceOf, "clazz", null);
|
|
if (jCTree == null) {
|
|
jCTree = (JCTree) readObject(jCInstanceOf, "pattern", null);
|
|
}
|
|
print(jCTree);
|
|
}
|
|
|
|
public void visitTypeCast(JCTree.JCTypeCast jCTypeCast) {
|
|
print("(");
|
|
print(jCTypeCast.clazz);
|
|
print(") ");
|
|
print((JCTree) jCTypeCast.expr);
|
|
}
|
|
|
|
public void visitBlock(JCTree.JCBlock jCBlock) {
|
|
if (jCBlock.pos != -1 || !jCBlock.stats.isEmpty()) {
|
|
if (this.onNewLine) {
|
|
align();
|
|
}
|
|
if ((jCBlock.flags & 8) != 0) {
|
|
print("static ");
|
|
}
|
|
println("{");
|
|
this.indent++;
|
|
print(jCBlock.stats, "");
|
|
consumeComments(endPos(jCBlock));
|
|
this.indent--;
|
|
aPrintln("}", jCBlock);
|
|
}
|
|
}
|
|
|
|
public void visitBreak(JCTree.JCBreak jCBreak) {
|
|
aPrint("break");
|
|
JCTree.JCExpression jCExpression = (JCTree.JCExpression) readObject(jCBreak, "value", null);
|
|
if (jCExpression != null) {
|
|
print(" ");
|
|
print((JCTree) jCExpression);
|
|
} else {
|
|
Name name = (Name) readObject(jCBreak, "label", null);
|
|
if (name != null) {
|
|
print(" ");
|
|
print((CharSequence) name);
|
|
}
|
|
}
|
|
println(";", jCBreak);
|
|
}
|
|
|
|
public void visitContinue(JCTree.JCContinue jCContinue) {
|
|
aPrint("continue");
|
|
if (jCContinue.label != null) {
|
|
print(" ");
|
|
print((CharSequence) jCContinue.label);
|
|
}
|
|
println(";", jCContinue);
|
|
}
|
|
|
|
public void visitConditional(JCTree.JCConditional jCConditional) {
|
|
print((JCTree) jCConditional.cond);
|
|
print(" ? ");
|
|
print((JCTree) jCConditional.truepart);
|
|
print(" : ");
|
|
print((JCTree) jCConditional.falsepart);
|
|
}
|
|
|
|
public void visitParens(JCTree.JCParens jCParens) {
|
|
print("(");
|
|
print((JCTree) jCParens.expr);
|
|
print(")");
|
|
}
|
|
|
|
public void visitReturn(JCTree.JCReturn jCReturn) {
|
|
aPrint("return");
|
|
if (jCReturn.expr != null) {
|
|
print(" ");
|
|
print((JCTree) jCReturn.expr);
|
|
}
|
|
println(";", jCReturn);
|
|
}
|
|
|
|
public void visitThrow(JCTree.JCThrow jCThrow) {
|
|
aPrint("throw ");
|
|
print((JCTree) jCThrow.expr);
|
|
println(";", jCThrow);
|
|
}
|
|
|
|
public void visitWhileLoop(JCTree.JCWhileLoop jCWhileLoop) {
|
|
aPrint("while ");
|
|
if (jCWhileLoop.cond instanceof JCTree.JCParens) {
|
|
print((JCTree) jCWhileLoop.cond);
|
|
} else {
|
|
print("(");
|
|
print((JCTree) jCWhileLoop.cond);
|
|
print(")");
|
|
}
|
|
print(" ");
|
|
print((JCTree) jCWhileLoop.body);
|
|
}
|
|
|
|
public void visitForLoop(JCTree.JCForLoop jCForLoop) {
|
|
aPrint("for (");
|
|
if (jCForLoop.init.nonEmpty()) {
|
|
if (jCForLoop.init.head instanceof JCTree.JCVariableDecl) {
|
|
boolean z2 = true;
|
|
int i = 0;
|
|
Iterator it = jCForLoop.init.iterator();
|
|
while (it.hasNext()) {
|
|
JCTree.JCVariableDecl jCVariableDecl = (JCTree.JCVariableDecl) ((JCTree.JCStatement) it.next());
|
|
if (z2) {
|
|
printVarDefInline(jCVariableDecl);
|
|
i = dims(jCVariableDecl.vartype);
|
|
} else {
|
|
print(", ");
|
|
print((CharSequence) jCVariableDecl.name);
|
|
int dims = dims(jCVariableDecl.vartype) - i;
|
|
for (int i2 = 0; i2 < dims; i2++) {
|
|
print("[]");
|
|
}
|
|
if (jCVariableDecl.init != null) {
|
|
print(" = ");
|
|
print((JCTree) jCVariableDecl.init);
|
|
}
|
|
}
|
|
z2 = false;
|
|
}
|
|
} else {
|
|
boolean z3 = true;
|
|
Iterator it2 = jCForLoop.init.iterator();
|
|
while (it2.hasNext()) {
|
|
JCTree.JCExpressionStatement jCExpressionStatement = (JCTree.JCStatement) it2.next();
|
|
if (!z3) {
|
|
print(", ");
|
|
}
|
|
z3 = false;
|
|
print((JCTree) jCExpressionStatement.expr);
|
|
}
|
|
}
|
|
}
|
|
print("; ");
|
|
if (jCForLoop.cond != null) {
|
|
print((JCTree) jCForLoop.cond);
|
|
}
|
|
print("; ");
|
|
boolean z4 = true;
|
|
Iterator it3 = jCForLoop.step.iterator();
|
|
while (it3.hasNext()) {
|
|
JCTree.JCExpressionStatement jCExpressionStatement2 = (JCTree.JCExpressionStatement) it3.next();
|
|
if (!z4) {
|
|
print(", ");
|
|
}
|
|
z4 = false;
|
|
print((JCTree) jCExpressionStatement2.expr);
|
|
}
|
|
print(") ");
|
|
print((JCTree) jCForLoop.body);
|
|
}
|
|
|
|
public void visitForeachLoop(JCTree.JCEnhancedForLoop jCEnhancedForLoop) {
|
|
aPrint("for (");
|
|
printVarDefInline(jCEnhancedForLoop.var);
|
|
print(" : ");
|
|
print((JCTree) jCEnhancedForLoop.expr);
|
|
print(") ");
|
|
print((JCTree) jCEnhancedForLoop.body);
|
|
}
|
|
|
|
public void visitIf(JCTree.JCIf jCIf) {
|
|
aPrint("if ");
|
|
if (jCIf.cond instanceof JCTree.JCParens) {
|
|
print((JCTree) jCIf.cond);
|
|
} else {
|
|
print("(");
|
|
print((JCTree) jCIf.cond);
|
|
print(")");
|
|
}
|
|
print(" ");
|
|
if (jCIf.thenpart instanceof JCTree.JCBlock) {
|
|
println("{");
|
|
this.indent++;
|
|
print(jCIf.thenpart.stats, "");
|
|
this.indent--;
|
|
if (jCIf.elsepart == null) {
|
|
aPrintln("}", jCIf);
|
|
} else {
|
|
aPrint("}");
|
|
}
|
|
} else {
|
|
print((JCTree) jCIf.thenpart);
|
|
}
|
|
if (jCIf.elsepart != null) {
|
|
aPrint(" else ");
|
|
print((JCTree) jCIf.elsepart);
|
|
}
|
|
}
|
|
|
|
public void visitExec(JCTree.JCExpressionStatement jCExpressionStatement) {
|
|
align();
|
|
print((JCTree) jCExpressionStatement.expr);
|
|
println(";", jCExpressionStatement);
|
|
}
|
|
|
|
public void visitDoLoop(JCTree.JCDoWhileLoop jCDoWhileLoop) {
|
|
aPrint("do ");
|
|
if (jCDoWhileLoop.body instanceof JCTree.JCBlock) {
|
|
println("{");
|
|
this.indent++;
|
|
print(jCDoWhileLoop.body.stats, "");
|
|
this.indent--;
|
|
aPrint("}");
|
|
} else {
|
|
print((JCTree) jCDoWhileLoop.body);
|
|
}
|
|
print(" while ");
|
|
if (jCDoWhileLoop.cond instanceof JCTree.JCParens) {
|
|
print((JCTree) jCDoWhileLoop.cond);
|
|
} else {
|
|
print("(");
|
|
print((JCTree) jCDoWhileLoop.cond);
|
|
print(")");
|
|
}
|
|
println(";", jCDoWhileLoop);
|
|
}
|
|
|
|
public void visitSynchronized(JCTree.JCSynchronized jCSynchronized) {
|
|
aPrint("synchronized ");
|
|
if (jCSynchronized.lock instanceof JCTree.JCParens) {
|
|
print((JCTree) jCSynchronized.lock);
|
|
} else {
|
|
print("(");
|
|
print((JCTree) jCSynchronized.lock);
|
|
print(")");
|
|
}
|
|
print(" ");
|
|
print((JCTree) jCSynchronized.body);
|
|
}
|
|
|
|
public void visitCase(JCTree.JCCase jCCase) {
|
|
List<? extends JCTree> list = (List) readObject(jCCase, "pats", null);
|
|
if (list == null) {
|
|
JCTree.JCExpression jCExpression = (JCTree.JCExpression) readObject(jCCase, "pat", null);
|
|
list = jCExpression == null ? List.nil() : List.of(jCExpression);
|
|
}
|
|
if (list.isEmpty()) {
|
|
aPrint("default");
|
|
} else {
|
|
aPrint("case ");
|
|
print(list, ", ");
|
|
}
|
|
Enum r0 = (Enum) readObject(jCCase, "caseKind", null);
|
|
if (r0 == null || !r0.name().equalsIgnoreCase("RULE")) {
|
|
println(": ");
|
|
this.indent++;
|
|
print(jCCase.stats, "");
|
|
this.indent--;
|
|
return;
|
|
}
|
|
print(" -> ");
|
|
if (jCCase.stats.head instanceof JCTree.JCBreak) {
|
|
print((JCTree) ((JCTree.JCExpression) readObject((JCTree.JCBreak) jCCase.stats.head, "value", null)));
|
|
print(";");
|
|
this.needsNewLine = true;
|
|
this.needsAlign = true;
|
|
} else if (((JCTree.JCStatement) jCCase.stats.head).getClass().getName().endsWith("$JCYield")) {
|
|
print((JCTree) ((JCTree.JCExpression) readObject((JCTree) jCCase.stats.head, "value", null)));
|
|
print(";");
|
|
this.needsNewLine = true;
|
|
this.needsAlign = true;
|
|
} else {
|
|
print((JCTree) jCCase.stats.head);
|
|
if (jCCase.stats.head instanceof JCTree.JCBlock) {
|
|
this.needsNewLine = false;
|
|
}
|
|
}
|
|
}
|
|
|
|
public void visitCatch(JCTree.JCCatch jCCatch) {
|
|
print(" catch (");
|
|
print((JCTree) jCCatch.param);
|
|
print(") ");
|
|
print((JCTree) jCCatch.body);
|
|
}
|
|
|
|
public void visitSwitch(JCTree.JCSwitch jCSwitch) {
|
|
aPrint("switch ");
|
|
if (jCSwitch.selector instanceof JCTree.JCParens) {
|
|
print((JCTree) jCSwitch.selector);
|
|
} else {
|
|
print("(");
|
|
print((JCTree) jCSwitch.selector);
|
|
print(")");
|
|
}
|
|
println(" {");
|
|
boolean isCaseRuleStyle = isCaseRuleStyle((JCTree.JCCase) jCSwitch.cases.head);
|
|
if (isCaseRuleStyle) {
|
|
this.indent++;
|
|
}
|
|
print(jCSwitch.cases, "");
|
|
if (isCaseRuleStyle) {
|
|
this.indent--;
|
|
}
|
|
aPrintln("}", jCSwitch);
|
|
}
|
|
|
|
void printSwitchExpression(JCTree jCTree) {
|
|
aPrint("switch ");
|
|
JCTree.JCExpression jCExpression = (JCTree.JCExpression) readObject(jCTree, "selector", null);
|
|
if (jCExpression instanceof JCTree.JCParens) {
|
|
print((JCTree) jCExpression);
|
|
} else {
|
|
print("(");
|
|
print((JCTree) jCExpression);
|
|
print(")");
|
|
}
|
|
println(" {");
|
|
List<? extends JCTree> list = (List) readObject(jCTree, "cases", null);
|
|
boolean isCaseRuleStyle = isCaseRuleStyle((JCTree.JCCase) list.head);
|
|
if (isCaseRuleStyle) {
|
|
this.indent++;
|
|
}
|
|
print(list, "");
|
|
if (isCaseRuleStyle) {
|
|
this.indent--;
|
|
}
|
|
aPrint("}");
|
|
}
|
|
|
|
void printYieldExpression(JCTree jCTree) {
|
|
aPrint("yield ");
|
|
print((JCTree) ((JCTree.JCExpression) readObject(jCTree, "value", null)));
|
|
println(";", jCTree);
|
|
}
|
|
|
|
void printBindingPattern(JCTree jCTree) {
|
|
print((JCTree) ((JCTree.JCExpression) readObject(jCTree, "vartype", null)));
|
|
print(" ");
|
|
print((CharSequence) ((Name) readObject(jCTree, ModelAuditLogEntry.CHANGE_KEY_NAME, null)));
|
|
}
|
|
|
|
public void visitTry(JCTree.JCTry jCTry) {
|
|
aPrint("try ");
|
|
List list = (List) readObject(jCTry, "resources", List.nil());
|
|
int length = list.length();
|
|
switch (length) {
|
|
case 0:
|
|
break;
|
|
case 1:
|
|
print("(");
|
|
JCTree jCTree = (JCTree) list.get(0);
|
|
if (jCTree instanceof JCTree.JCVariableDecl) {
|
|
this.flagMod = -17L;
|
|
printVarDefInline((JCTree.JCVariableDecl) jCTree);
|
|
} else {
|
|
print(jCTree);
|
|
}
|
|
print(") ");
|
|
break;
|
|
default:
|
|
println("(");
|
|
this.indent++;
|
|
int i = 0;
|
|
Iterator it = list.iterator();
|
|
while (it.hasNext()) {
|
|
Object next = it.next();
|
|
align();
|
|
if (next instanceof JCTree.JCVariableDecl) {
|
|
this.flagMod = -17L;
|
|
printVarDefInline((JCTree.JCVariableDecl) next);
|
|
} else {
|
|
print((JCTree) next);
|
|
}
|
|
i++;
|
|
if (i == length) {
|
|
print(") ");
|
|
} else {
|
|
println(";", (JCTree) next);
|
|
}
|
|
}
|
|
this.indent--;
|
|
break;
|
|
}
|
|
println("{");
|
|
this.indent++;
|
|
Iterator it2 = jCTry.body.stats.iterator();
|
|
while (it2.hasNext()) {
|
|
print((JCTree) ((JCTree.JCStatement) it2.next()));
|
|
}
|
|
this.indent--;
|
|
aPrint("}");
|
|
Iterator it3 = jCTry.catchers.iterator();
|
|
while (it3.hasNext()) {
|
|
printCatch((JCTree.JCCatch) it3.next());
|
|
}
|
|
if (jCTry.finalizer != null) {
|
|
println(" finally {");
|
|
this.indent++;
|
|
Iterator it4 = jCTry.finalizer.stats.iterator();
|
|
while (it4.hasNext()) {
|
|
print((JCTree) ((JCTree.JCStatement) it4.next()));
|
|
}
|
|
this.indent--;
|
|
aPrint("}");
|
|
}
|
|
println((JCTree) jCTry);
|
|
}
|
|
|
|
private void printCatch(JCTree.JCCatch jCCatch) {
|
|
print(" catch (");
|
|
printVarDefInline(jCCatch.param);
|
|
println(") {");
|
|
this.indent++;
|
|
Iterator it = jCCatch.body.stats.iterator();
|
|
while (it.hasNext()) {
|
|
print((JCTree) ((JCTree.JCStatement) it.next()));
|
|
}
|
|
this.indent--;
|
|
aPrint("}");
|
|
}
|
|
|
|
public void visitErroneous(JCTree.JCErroneous jCErroneous) {
|
|
print("(ERROR)");
|
|
}
|
|
|
|
private static String operator(JavacTreeMaker.TreeTag treeTag) {
|
|
String str = OPERATORS.get(treeTag);
|
|
return str == null ? "(?op?)" : str;
|
|
}
|
|
|
|
private static String quoteChars(String str) {
|
|
StringBuilder sb = new StringBuilder();
|
|
for (int i = 0; i < str.length(); i++) {
|
|
sb.append(quoteChar(str.charAt(i)));
|
|
}
|
|
return sb.toString();
|
|
}
|
|
|
|
private static String quoteChar(char c) {
|
|
switch (c) {
|
|
case '\b':
|
|
return "\\b";
|
|
case '\t':
|
|
return "\\t";
|
|
case '\n':
|
|
return "\\n";
|
|
case '\f':
|
|
return "\\f";
|
|
case '\r':
|
|
return "\\r";
|
|
case '\"':
|
|
return "\\\"";
|
|
case '\'':
|
|
return "\\'";
|
|
case '\\':
|
|
return "\\\\";
|
|
default:
|
|
return c < ' ' ? String.format("\\%03o", Integer.valueOf(c)) : String.valueOf(c);
|
|
}
|
|
}
|
|
|
|
private static Method getMethod(Class<?> cls, String str, Class<?>... clsArr) {
|
|
try {
|
|
return Permit.getMethod(cls, str, clsArr);
|
|
} catch (NoSuchMethodException e) {
|
|
throw sneakyThrow(e);
|
|
}
|
|
}
|
|
|
|
private static Method getMethod(Class<?> cls, String str, String... strArr) {
|
|
try {
|
|
Class[] clsArr = new Class[strArr.length];
|
|
for (int i = 0; i < strArr.length; i++) {
|
|
clsArr[i] = Class.forName(strArr[i]);
|
|
}
|
|
return Permit.getMethod(cls, str, clsArr);
|
|
} catch (ClassNotFoundException e) {
|
|
throw sneakyThrow(e);
|
|
} catch (NoSuchMethodException e2) {
|
|
throw sneakyThrow(e2);
|
|
}
|
|
}
|
|
|
|
public static JCTree getExtendsClause(JCTree.JCClassDecl jCClassDecl) {
|
|
try {
|
|
return (JCTree) getExtendsClause.invoke(jCClassDecl, new Object[0]);
|
|
} catch (IllegalAccessException e) {
|
|
throw sneakyThrow(e);
|
|
} catch (InvocationTargetException e2) {
|
|
throw sneakyThrow(e2.getCause());
|
|
}
|
|
}
|
|
|
|
static RuntimeException sneakyThrow(Throwable th) {
|
|
if (th == null) {
|
|
throw new NullPointerException("t");
|
|
}
|
|
sneakyThrow0(th);
|
|
return null;
|
|
}
|
|
|
|
private static <T extends Throwable> void sneakyThrow0(Throwable th) throws Throwable {
|
|
throw th;
|
|
}
|
|
|
|
private <T> T readObject(JCTree jCTree, String str, T t) {
|
|
Class<?> cls = jCTree.getClass();
|
|
Map<String, Field> map = reflectionCache.get(cls);
|
|
if (map == null) {
|
|
Map<Class<?>, Map<String, Field>> map2 = reflectionCache;
|
|
HashMap hashMap = new HashMap();
|
|
map = hashMap;
|
|
map2.put(cls, hashMap);
|
|
}
|
|
Field field = map.get(str);
|
|
if (field == null) {
|
|
try {
|
|
field = Permit.getField(cls, str);
|
|
map.put(str, field);
|
|
} catch (Exception unused) {
|
|
return t;
|
|
}
|
|
}
|
|
try {
|
|
return (T) field.get(jCTree);
|
|
} catch (Exception unused2) {
|
|
return t;
|
|
}
|
|
}
|
|
|
|
public void visitTypeBoundKind(JCTree.TypeBoundKind typeBoundKind) {
|
|
print(String.valueOf(typeBoundKind.kind));
|
|
}
|
|
|
|
public void visitTree(JCTree jCTree) {
|
|
String name = jCTree.getClass().getName();
|
|
if (name.endsWith("$JCTypeUnion")) {
|
|
print((List) readObject(jCTree, "alternatives", List.nil()), " | ");
|
|
} else if (name.endsWith("$JCTypeIntersection")) {
|
|
print((List) readObject(jCTree, "bounds", List.nil()), " & ");
|
|
} else if (name.endsWith("$JCMemberReference")) {
|
|
printMemberReference0(jCTree);
|
|
} else if (name.endsWith("$JCLambda")) {
|
|
printLambda0(jCTree);
|
|
} else if (name.endsWith("$JCAnnotatedType")) {
|
|
printAnnotatedType0(jCTree);
|
|
} else if (name.endsWith("$JCPackageDecl")) {
|
|
} else {
|
|
if (name.endsWith("$JCSwitchExpression")) {
|
|
printSwitchExpression(jCTree);
|
|
} else if (name.endsWith("$JCYield")) {
|
|
printYieldExpression(jCTree);
|
|
} else if (name.endsWith("$JCBindingPattern")) {
|
|
printBindingPattern(jCTree);
|
|
} else {
|
|
throw new AssertionError("Unhandled tree type: " + jCTree.getClass() + ": " + jCTree);
|
|
}
|
|
}
|
|
}
|
|
|
|
private boolean isCaseRuleStyle(JCTree.JCCase jCCase) {
|
|
Enum r0;
|
|
return (jCCase == null || (r0 = (Enum) readObject(jCCase, "caseKind", null)) == null || !r0.name().equalsIgnoreCase("RULE")) ? false : true;
|
|
}
|
|
|
|
private boolean isJcAnnotatedType(Object obj) {
|
|
if (obj == null) {
|
|
return false;
|
|
}
|
|
if (this.jcAnnotatedTypeInit) {
|
|
return this.jcAnnotatedTypeClass == obj.getClass();
|
|
}
|
|
Class<?> cls = obj.getClass();
|
|
if (!cls.getName().endsWith("$JCAnnotatedType")) {
|
|
return false;
|
|
}
|
|
this.jcAnnotatedTypeClass = cls;
|
|
this.jcAnnotatedTypeInit = true;
|
|
return true;
|
|
}
|
|
|
|
private void printMemberReference0(JCTree jCTree) {
|
|
print((JCTree) readObject(jCTree, "expr", null));
|
|
print("::");
|
|
List<? extends JCTree> list = (List) readObject(jCTree, "typeargs", List.nil());
|
|
if (list != null && !list.isEmpty()) {
|
|
print("<");
|
|
print(list, ", ");
|
|
print(">");
|
|
}
|
|
print(readObject(jCTree, "mode", new Object()).toString().equals("INVOKE") ? (CharSequence) readObject(jCTree, ModelAuditLogEntry.CHANGE_KEY_NAME, null) : "new");
|
|
}
|
|
|
|
private void printLambda0(JCTree jCTree) {
|
|
List list = (List) readObject(jCTree, "params", List.nil());
|
|
boolean z2 = true;
|
|
int size = list.size();
|
|
try {
|
|
z2 = readObject(jCTree, "paramKind", new Object()).toString().equals("EXPLICIT");
|
|
} catch (Exception unused) {
|
|
}
|
|
boolean z3 = size != 1 || z2;
|
|
if (z3) {
|
|
print("(");
|
|
}
|
|
if (z2) {
|
|
boolean z4 = true;
|
|
Iterator it = list.iterator();
|
|
while (it.hasNext()) {
|
|
JCTree.JCVariableDecl jCVariableDecl = (JCTree.JCVariableDecl) it.next();
|
|
if (!z4) {
|
|
print(", ");
|
|
}
|
|
z4 = false;
|
|
printVarDefInline(jCVariableDecl);
|
|
}
|
|
} else {
|
|
String str = "";
|
|
Iterator it2 = list.iterator();
|
|
while (it2.hasNext()) {
|
|
print(str);
|
|
print((CharSequence) ((JCTree.JCVariableDecl) it2.next()).name);
|
|
str = ", ";
|
|
}
|
|
}
|
|
if (z3) {
|
|
print(")");
|
|
}
|
|
print(" -> ");
|
|
JCTree.JCBlock jCBlock = (JCTree) readObject(jCTree, "body", null);
|
|
if (jCBlock instanceof JCTree.JCBlock) {
|
|
println("{");
|
|
this.indent++;
|
|
print(jCBlock.stats, "");
|
|
this.indent--;
|
|
aPrint("}");
|
|
return;
|
|
}
|
|
print((JCTree) jCBlock);
|
|
}
|
|
|
|
private void printAnnotatedType0(JCTree jCTree) {
|
|
JCTree.JCFieldAccess jCFieldAccess = (JCTree) readObject(jCTree, "underlyingType", null);
|
|
if (jCFieldAccess instanceof JCTree.JCFieldAccess) {
|
|
print((JCTree) jCFieldAccess.selected);
|
|
print(".");
|
|
print((List) readObject(jCTree, "annotations", List.nil()), " ");
|
|
print(" ");
|
|
print((CharSequence) jCFieldAccess.name);
|
|
} else if (jCFieldAccess instanceof JCTree.JCArrayTypeTree) {
|
|
printTypeArray0(jCTree);
|
|
} else {
|
|
print((List) readObject(jCTree, "annotations", List.nil()), " ");
|
|
print(" ");
|
|
print((JCTree) jCFieldAccess);
|
|
}
|
|
}
|
|
|
|
private void printTypeArray0(JCTree jCTree) {
|
|
JCTree jCTree2 = jCTree;
|
|
int i = 0;
|
|
while (true) {
|
|
if (!(jCTree2 instanceof JCTree.JCArrayTypeTree)) {
|
|
if (!isJcAnnotatedType(jCTree2)) {
|
|
break;
|
|
}
|
|
JCTree.JCArrayTypeTree jCArrayTypeTree = (JCTree) readObject(jCTree2, "underlyingType", null);
|
|
if (!(jCArrayTypeTree instanceof JCTree.JCArrayTypeTree)) {
|
|
break;
|
|
}
|
|
jCTree2 = jCArrayTypeTree.elemtype;
|
|
i++;
|
|
} else {
|
|
jCTree2 = ((JCTree.JCArrayTypeTree) jCTree2).elemtype;
|
|
i++;
|
|
}
|
|
}
|
|
print(jCTree2);
|
|
JCTree jCTree3 = jCTree;
|
|
while (true) {
|
|
if (jCTree3 instanceof JCTree.JCArrayTypeTree) {
|
|
i--;
|
|
print((i != 0 || !this.innermostArrayBracketsAreVarargs) ? "[]" : "...");
|
|
jCTree3 = ((JCTree.JCArrayTypeTree) jCTree3).elemtype;
|
|
} else if (isJcAnnotatedType(jCTree3)) {
|
|
JCTree.JCArrayTypeTree jCArrayTypeTree2 = (JCTree) readObject(jCTree3, "underlyingType", null);
|
|
if (jCArrayTypeTree2 instanceof JCTree.JCArrayTypeTree) {
|
|
i--;
|
|
print(" ");
|
|
print((List) readObject(jCTree3, "annotations", List.nil()), " ");
|
|
print(" ");
|
|
print((i != 0 || !this.innermostArrayBracketsAreVarargs) ? "[]" : "...");
|
|
jCTree3 = jCArrayTypeTree2.elemtype;
|
|
} else {
|
|
return;
|
|
}
|
|
} else {
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
static /* synthetic */ int[] $SWITCH_TABLE$lombok$javac$CommentInfo$StartConnection() {
|
|
int[] iArr = $SWITCH_TABLE$lombok$javac$CommentInfo$StartConnection;
|
|
if (iArr != null) {
|
|
return iArr;
|
|
}
|
|
int[] iArr2 = new int[CommentInfo.StartConnection.values().length];
|
|
try {
|
|
iArr2[CommentInfo.StartConnection.AFTER_PREVIOUS.ordinal()] = 4;
|
|
} catch (NoSuchFieldError unused) {
|
|
}
|
|
try {
|
|
iArr2[CommentInfo.StartConnection.DIRECT_AFTER_PREVIOUS.ordinal()] = 3;
|
|
} catch (NoSuchFieldError unused2) {
|
|
}
|
|
try {
|
|
iArr2[CommentInfo.StartConnection.ON_NEXT_LINE.ordinal()] = 2;
|
|
} catch (NoSuchFieldError unused3) {
|
|
}
|
|
try {
|
|
iArr2[CommentInfo.StartConnection.START_OF_LINE.ordinal()] = 1;
|
|
} catch (NoSuchFieldError unused4) {
|
|
}
|
|
$SWITCH_TABLE$lombok$javac$CommentInfo$StartConnection = iArr2;
|
|
return iArr2;
|
|
}
|
|
|
|
static /* synthetic */ int[] $SWITCH_TABLE$lombok$javac$CommentInfo$EndConnection() {
|
|
int[] iArr = $SWITCH_TABLE$lombok$javac$CommentInfo$EndConnection;
|
|
if (iArr != null) {
|
|
return iArr;
|
|
}
|
|
int[] iArr2 = new int[CommentInfo.EndConnection.values().length];
|
|
try {
|
|
iArr2[CommentInfo.EndConnection.AFTER_COMMENT.ordinal()] = 2;
|
|
} catch (NoSuchFieldError unused) {
|
|
}
|
|
try {
|
|
iArr2[CommentInfo.EndConnection.DIRECT_AFTER_COMMENT.ordinal()] = 1;
|
|
} catch (NoSuchFieldError unused2) {
|
|
}
|
|
try {
|
|
iArr2[CommentInfo.EndConnection.ON_NEXT_LINE.ordinal()] = 3;
|
|
} catch (NoSuchFieldError unused3) {
|
|
}
|
|
$SWITCH_TABLE$lombok$javac$CommentInfo$EndConnection = iArr2;
|
|
return iArr2;
|
|
}
|
|
|
|
static /* synthetic */ int[] $SWITCH_TABLE$com$sun$source$tree$Tree$Kind() {
|
|
int[] iArr = $SWITCH_TABLE$com$sun$source$tree$Tree$Kind;
|
|
if (iArr != null) {
|
|
return iArr;
|
|
}
|
|
int[] iArr2 = new int[Tree.Kind.values().length];
|
|
try {
|
|
iArr2[Tree.Kind.AND.ordinal()] = 64;
|
|
} catch (NoSuchFieldError unused) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.AND_ASSIGNMENT.ordinal()] = 77;
|
|
} catch (NoSuchFieldError unused2) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.ANNOTATION.ordinal()] = 1;
|
|
} catch (NoSuchFieldError unused3) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.ARRAY_ACCESS.ordinal()] = 2;
|
|
} catch (NoSuchFieldError unused4) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.ARRAY_TYPE.ordinal()] = 3;
|
|
} catch (NoSuchFieldError unused5) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.ASSERT.ordinal()] = 4;
|
|
} catch (NoSuchFieldError unused6) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.ASSIGNMENT.ordinal()] = 5;
|
|
} catch (NoSuchFieldError unused7) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.BITWISE_COMPLEMENT.ordinal()] = 48;
|
|
} catch (NoSuchFieldError unused8) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.BLOCK.ordinal()] = 6;
|
|
} catch (NoSuchFieldError unused9) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.BOOLEAN_LITERAL.ordinal()] = 84;
|
|
} catch (NoSuchFieldError unused10) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.BREAK.ordinal()] = 7;
|
|
} catch (NoSuchFieldError unused11) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.CASE.ordinal()] = 8;
|
|
} catch (NoSuchFieldError unused12) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.CATCH.ordinal()] = 9;
|
|
} catch (NoSuchFieldError unused13) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.CHAR_LITERAL.ordinal()] = 85;
|
|
} catch (NoSuchFieldError unused14) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.CLASS.ordinal()] = 10;
|
|
} catch (NoSuchFieldError unused15) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.COMPILATION_UNIT.ordinal()] = 11;
|
|
} catch (NoSuchFieldError unused16) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.CONDITIONAL_AND.ordinal()] = 67;
|
|
} catch (NoSuchFieldError unused17) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.CONDITIONAL_EXPRESSION.ordinal()] = 12;
|
|
} catch (NoSuchFieldError unused18) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.CONDITIONAL_OR.ordinal()] = 68;
|
|
} catch (NoSuchFieldError unused19) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.CONTINUE.ordinal()] = 13;
|
|
} catch (NoSuchFieldError unused20) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.DIVIDE.ordinal()] = 51;
|
|
} catch (NoSuchFieldError unused21) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.DIVIDE_ASSIGNMENT.ordinal()] = 70;
|
|
} catch (NoSuchFieldError unused22) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.DOUBLE_LITERAL.ordinal()] = 83;
|
|
} catch (NoSuchFieldError unused23) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.DO_WHILE_LOOP.ordinal()] = 14;
|
|
} catch (NoSuchFieldError unused24) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.EMPTY_STATEMENT.ordinal()] = 32;
|
|
} catch (NoSuchFieldError unused25) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.ENHANCED_FOR_LOOP.ordinal()] = 15;
|
|
} catch (NoSuchFieldError unused26) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.EQUAL_TO.ordinal()] = 62;
|
|
} catch (NoSuchFieldError unused27) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.ERRONEOUS.ordinal()] = 91;
|
|
} catch (NoSuchFieldError unused28) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.EXPRESSION_STATEMENT.ordinal()] = 16;
|
|
} catch (NoSuchFieldError unused29) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.EXTENDS_WILDCARD.ordinal()] = 89;
|
|
} catch (NoSuchFieldError unused30) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.FLOAT_LITERAL.ordinal()] = 82;
|
|
} catch (NoSuchFieldError unused31) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.FOR_LOOP.ordinal()] = 18;
|
|
} catch (NoSuchFieldError unused32) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.GREATER_THAN.ordinal()] = 59;
|
|
} catch (NoSuchFieldError unused33) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.GREATER_THAN_EQUAL.ordinal()] = 61;
|
|
} catch (NoSuchFieldError unused34) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.IDENTIFIER.ordinal()] = 19;
|
|
} catch (NoSuchFieldError unused35) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.IF.ordinal()] = 20;
|
|
} catch (NoSuchFieldError unused36) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.IMPORT.ordinal()] = 21;
|
|
} catch (NoSuchFieldError unused37) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.INSTANCE_OF.ordinal()] = 22;
|
|
} catch (NoSuchFieldError unused38) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.INT_LITERAL.ordinal()] = 80;
|
|
} catch (NoSuchFieldError unused39) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.LABELED_STATEMENT.ordinal()] = 23;
|
|
} catch (NoSuchFieldError unused40) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.LEFT_SHIFT.ordinal()] = 55;
|
|
} catch (NoSuchFieldError unused41) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.LEFT_SHIFT_ASSIGNMENT.ordinal()] = 74;
|
|
} catch (NoSuchFieldError unused42) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.LESS_THAN.ordinal()] = 58;
|
|
} catch (NoSuchFieldError unused43) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.LESS_THAN_EQUAL.ordinal()] = 60;
|
|
} catch (NoSuchFieldError unused44) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.LOGICAL_COMPLEMENT.ordinal()] = 49;
|
|
} catch (NoSuchFieldError unused45) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.LONG_LITERAL.ordinal()] = 81;
|
|
} catch (NoSuchFieldError unused46) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.MEMBER_SELECT.ordinal()] = 17;
|
|
} catch (NoSuchFieldError unused47) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.METHOD.ordinal()] = 24;
|
|
} catch (NoSuchFieldError unused48) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.METHOD_INVOCATION.ordinal()] = 25;
|
|
} catch (NoSuchFieldError unused49) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.MINUS.ordinal()] = 54;
|
|
} catch (NoSuchFieldError unused50) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.MINUS_ASSIGNMENT.ordinal()] = 73;
|
|
} catch (NoSuchFieldError unused51) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.MODIFIERS.ordinal()] = 26;
|
|
} catch (NoSuchFieldError unused52) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.MULTIPLY.ordinal()] = 50;
|
|
} catch (NoSuchFieldError unused53) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.MULTIPLY_ASSIGNMENT.ordinal()] = 69;
|
|
} catch (NoSuchFieldError unused54) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.NEW_ARRAY.ordinal()] = 27;
|
|
} catch (NoSuchFieldError unused55) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.NEW_CLASS.ordinal()] = 28;
|
|
} catch (NoSuchFieldError unused56) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.NOT_EQUAL_TO.ordinal()] = 63;
|
|
} catch (NoSuchFieldError unused57) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.NULL_LITERAL.ordinal()] = 87;
|
|
} catch (NoSuchFieldError unused58) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.OR.ordinal()] = 66;
|
|
} catch (NoSuchFieldError unused59) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.OR_ASSIGNMENT.ordinal()] = 79;
|
|
} catch (NoSuchFieldError unused60) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.OTHER.ordinal()] = 92;
|
|
} catch (NoSuchFieldError unused61) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.PARAMETERIZED_TYPE.ordinal()] = 37;
|
|
} catch (NoSuchFieldError unused62) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.PARENTHESIZED.ordinal()] = 29;
|
|
} catch (NoSuchFieldError unused63) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.PLUS.ordinal()] = 53;
|
|
} catch (NoSuchFieldError unused64) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.PLUS_ASSIGNMENT.ordinal()] = 72;
|
|
} catch (NoSuchFieldError unused65) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.POSTFIX_DECREMENT.ordinal()] = 43;
|
|
} catch (NoSuchFieldError unused66) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.POSTFIX_INCREMENT.ordinal()] = 42;
|
|
} catch (NoSuchFieldError unused67) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.PREFIX_DECREMENT.ordinal()] = 45;
|
|
} catch (NoSuchFieldError unused68) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.PREFIX_INCREMENT.ordinal()] = 44;
|
|
} catch (NoSuchFieldError unused69) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.PRIMITIVE_TYPE.ordinal()] = 30;
|
|
} catch (NoSuchFieldError unused70) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.REMAINDER.ordinal()] = 52;
|
|
} catch (NoSuchFieldError unused71) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.REMAINDER_ASSIGNMENT.ordinal()] = 71;
|
|
} catch (NoSuchFieldError unused72) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.RETURN.ordinal()] = 31;
|
|
} catch (NoSuchFieldError unused73) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.RIGHT_SHIFT.ordinal()] = 56;
|
|
} catch (NoSuchFieldError unused74) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.RIGHT_SHIFT_ASSIGNMENT.ordinal()] = 75;
|
|
} catch (NoSuchFieldError unused75) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.STRING_LITERAL.ordinal()] = 86;
|
|
} catch (NoSuchFieldError unused76) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.SUPER_WILDCARD.ordinal()] = 90;
|
|
} catch (NoSuchFieldError unused77) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.SWITCH.ordinal()] = 33;
|
|
} catch (NoSuchFieldError unused78) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.SYNCHRONIZED.ordinal()] = 34;
|
|
} catch (NoSuchFieldError unused79) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.THROW.ordinal()] = 35;
|
|
} catch (NoSuchFieldError unused80) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.TRY.ordinal()] = 36;
|
|
} catch (NoSuchFieldError unused81) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.TYPE_CAST.ordinal()] = 38;
|
|
} catch (NoSuchFieldError unused82) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.TYPE_PARAMETER.ordinal()] = 39;
|
|
} catch (NoSuchFieldError unused83) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.UNARY_MINUS.ordinal()] = 47;
|
|
} catch (NoSuchFieldError unused84) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.UNARY_PLUS.ordinal()] = 46;
|
|
} catch (NoSuchFieldError unused85) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.UNBOUNDED_WILDCARD.ordinal()] = 88;
|
|
} catch (NoSuchFieldError unused86) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.UNSIGNED_RIGHT_SHIFT.ordinal()] = 57;
|
|
} catch (NoSuchFieldError unused87) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.UNSIGNED_RIGHT_SHIFT_ASSIGNMENT.ordinal()] = 76;
|
|
} catch (NoSuchFieldError unused88) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.VARIABLE.ordinal()] = 40;
|
|
} catch (NoSuchFieldError unused89) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.WHILE_LOOP.ordinal()] = 41;
|
|
} catch (NoSuchFieldError unused90) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.XOR.ordinal()] = 65;
|
|
} catch (NoSuchFieldError unused91) {
|
|
}
|
|
try {
|
|
iArr2[Tree.Kind.XOR_ASSIGNMENT.ordinal()] = 78;
|
|
} catch (NoSuchFieldError unused92) {
|
|
}
|
|
$SWITCH_TABLE$com$sun$source$tree$Tree$Kind = iArr2;
|
|
return iArr2;
|
|
}
|
|
}
|