--- old/src/share/classes/com/sun/tools/javac/tree/JCTree.java 2011-10-23 21:53:58.211278557 -0700 +++ new/src/share/classes/com/sun/tools/javac/tree/JCTree.java 2011-10-23 21:53:58.143277601 -0700 @@ -79,253 +79,275 @@ public abstract class JCTree implements Tree, Cloneable, DiagnosticPosition { /* Tree tag values, identifying kinds of trees */ - - /** Toplevel nodes, of type TopLevel, representing entire source files. - */ - public static final int TOPLEVEL = 1; - - /** Import clauses, of type Import. - */ - public static final int IMPORT = TOPLEVEL + 1; - - /** Class definitions, of type ClassDef. - */ - public static final int CLASSDEF = IMPORT + 1; - - /** Method definitions, of type MethodDef. - */ - public static final int METHODDEF = CLASSDEF + 1; - - /** Variable definitions, of type VarDef. - */ - public static final int VARDEF = METHODDEF + 1; - - /** The no-op statement ";", of type Skip - */ - public static final int SKIP = VARDEF + 1; - - /** Blocks, of type Block. - */ - public static final int BLOCK = SKIP + 1; - - /** Do-while loops, of type DoLoop. - */ - public static final int DOLOOP = BLOCK + 1; - - /** While-loops, of type WhileLoop. - */ - public static final int WHILELOOP = DOLOOP + 1; - - /** For-loops, of type ForLoop. - */ - public static final int FORLOOP = WHILELOOP + 1; - - /** Foreach-loops, of type ForeachLoop. - */ - public static final int FOREACHLOOP = FORLOOP + 1; - - /** Labelled statements, of type Labelled. - */ - public static final int LABELLED = FOREACHLOOP + 1; - - /** Switch statements, of type Switch. - */ - public static final int SWITCH = LABELLED + 1; - - /** Case parts in switch statements, of type Case. - */ - public static final int CASE = SWITCH + 1; - - /** Synchronized statements, of type Synchonized. - */ - public static final int SYNCHRONIZED = CASE + 1; - - /** Try statements, of type Try. - */ - public static final int TRY = SYNCHRONIZED + 1; - - /** Catch clauses in try statements, of type Catch. - */ - public static final int CATCH = TRY + 1; - - /** Conditional expressions, of type Conditional. - */ - public static final int CONDEXPR = CATCH + 1; - - /** Conditional statements, of type If. - */ - public static final int IF = CONDEXPR + 1; - - /** Expression statements, of type Exec. - */ - public static final int EXEC = IF + 1; - - /** Break statements, of type Break. - */ - public static final int BREAK = EXEC + 1; - - /** Continue statements, of type Continue. - */ - public static final int CONTINUE = BREAK + 1; - - /** Return statements, of type Return. - */ - public static final int RETURN = CONTINUE + 1; - - /** Throw statements, of type Throw. - */ - public static final int THROW = RETURN + 1; - - /** Assert statements, of type Assert. - */ - public static final int ASSERT = THROW + 1; - - /** Method invocation expressions, of type Apply. - */ - public static final int APPLY = ASSERT + 1; - - /** Class instance creation expressions, of type NewClass. - */ - public static final int NEWCLASS = APPLY + 1; - - /** Array creation expressions, of type NewArray. - */ - public static final int NEWARRAY = NEWCLASS + 1; - - /** Parenthesized subexpressions, of type Parens. - */ - public static final int PARENS = NEWARRAY + 1; - - /** Assignment expressions, of type Assign. - */ - public static final int ASSIGN = PARENS + 1; - - /** Type cast expressions, of type TypeCast. - */ - public static final int TYPECAST = ASSIGN + 1; - - /** Type test expressions, of type TypeTest. - */ - public static final int TYPETEST = TYPECAST + 1; - - /** Indexed array expressions, of type Indexed. - */ - public static final int INDEXED = TYPETEST + 1; - - /** Selections, of type Select. - */ - public static final int SELECT = INDEXED + 1; - - /** Simple identifiers, of type Ident. - */ - public static final int IDENT = SELECT + 1; - - /** Literals, of type Literal. - */ - public static final int LITERAL = IDENT + 1; - - /** Basic type identifiers, of type TypeIdent. - */ - public static final int TYPEIDENT = LITERAL + 1; - - /** Array types, of type TypeArray. - */ - public static final int TYPEARRAY = TYPEIDENT + 1; - - /** Parameterized types, of type TypeApply. - */ - public static final int TYPEAPPLY = TYPEARRAY + 1; - - /** Union types, of type TypeUnion - */ - public static final int TYPEUNION = TYPEAPPLY + 1; - - /** Formal type parameters, of type TypeParameter. - */ - public static final int TYPEPARAMETER = TYPEUNION + 1; - - /** Type argument. - */ - public static final int WILDCARD = TYPEPARAMETER + 1; - - /** Bound kind: extends, super, exact, or unbound - */ - public static final int TYPEBOUNDKIND = WILDCARD + 1; - - /** metadata: Annotation. - */ - public static final int ANNOTATION = TYPEBOUNDKIND + 1; - - /** metadata: Modifiers - */ - public static final int MODIFIERS = ANNOTATION + 1; - - public static final int ANNOTATED_TYPE = MODIFIERS + 1; - - /** Error trees, of type Erroneous. - */ - public static final int ERRONEOUS = ANNOTATED_TYPE + 1; - - /** Unary operators, of type Unary. - */ - public static final int POS = ERRONEOUS + 1; // + - public static final int NEG = POS + 1; // - - public static final int NOT = NEG + 1; // ! - public static final int COMPL = NOT + 1; // ~ - public static final int PREINC = COMPL + 1; // ++ _ - public static final int PREDEC = PREINC + 1; // -- _ - public static final int POSTINC = PREDEC + 1; // _ ++ - public static final int POSTDEC = POSTINC + 1; // _ -- - - /** unary operator for null reference checks, only used internally. - */ - public static final int NULLCHK = POSTDEC + 1; - - /** Binary operators, of type Binary. - */ - public static final int OR = NULLCHK + 1; // || - public static final int AND = OR + 1; // && - public static final int BITOR = AND + 1; // | - public static final int BITXOR = BITOR + 1; // ^ - public static final int BITAND = BITXOR + 1; // & - public static final int EQ = BITAND + 1; // == - public static final int NE = EQ + 1; // != - public static final int LT = NE + 1; // < - public static final int GT = LT + 1; // > - public static final int LE = GT + 1; // <= - public static final int GE = LE + 1; // >= - public static final int SL = GE + 1; // << - public static final int SR = SL + 1; // >> - public static final int USR = SR + 1; // >>> - public static final int PLUS = USR + 1; // + - public static final int MINUS = PLUS + 1; // - - public static final int MUL = MINUS + 1; // * - public static final int DIV = MUL + 1; // / - public static final int MOD = DIV + 1; // % - - /** Assignment operators, of type Assignop. - */ - public static final int BITOR_ASG = MOD + 1; // |= - public static final int BITXOR_ASG = BITOR_ASG + 1; // ^= - public static final int BITAND_ASG = BITXOR_ASG + 1; // &= - - public static final int SL_ASG = SL + BITOR_ASG - BITOR; // <<= - public static final int SR_ASG = SL_ASG + 1; // >>= - public static final int USR_ASG = SR_ASG + 1; // >>>= - public static final int PLUS_ASG = USR_ASG + 1; // += - public static final int MINUS_ASG = PLUS_ASG + 1; // -= - public static final int MUL_ASG = MINUS_ASG + 1; // *= - public static final int DIV_ASG = MUL_ASG + 1; // /= - public static final int MOD_ASG = DIV_ASG + 1; // %= - - /** A synthetic let expression, of type LetExpr. - */ - public static final int LETEXPR = MOD_ASG + 1; // ala scheme - + public enum Tag{ + /** For methods that return an invalid tag if a given condition is not met + */ + NO_TAG, + + /** Toplevel nodes, of type TopLevel, representing entire source files. + */ + TOPLEVEL, + + /** Import clauses, of type Import. + */ + IMPORT, + + /** Class definitions, of type ClassDef. + */ + CLASSDEF, + + /** Method definitions, of type MethodDef. + */ + METHODDEF, + + /** Variable definitions, of type VarDef. + */ + VARDEF, + + /** The no-op statement ";", of type Skip + */ + SKIP, + + /** Blocks, of type Block. + */ + BLOCK, + + /** Do-while loops, of type DoLoop. + */ + DOLOOP, + + /** While-loops, of type WhileLoop. + */ + WHILELOOP, + + /** For-loops, of type ForLoop. + */ + FORLOOP, + + /** Foreach-loops, of type ForeachLoop. + */ + FOREACHLOOP, + + /** Labelled statements, of type Labelled. + */ + LABELLED, + + /** Switch statements, of type Switch. + */ + SWITCH, + + /** Case parts in switch statements, of type Case. + */ + CASE, + + /** Synchronized statements, of type Synchonized. + */ + SYNCHRONIZED, + + /** Try statements, of type Try. + */ + TRY, + + /** Catch clauses in try statements, of type Catch. + */ + CATCH, + + /** Conditional expressions, of type Conditional. + */ + CONDEXPR, + + /** Conditional statements, of type If. + */ + IF, + + /** Expression statements, of type Exec. + */ + EXEC, + + /** Break statements, of type Break. + */ + BREAK, + + /** Continue statements, of type Continue. + */ + CONTINUE, + + /** Return statements, of type Return. + */ + RETURN, + + /** Throw statements, of type Throw. + */ + THROW, + + /** Assert statements, of type Assert. + */ + ASSERT, + + /** Method invocation expressions, of type Apply. + */ + APPLY, + + /** Class instance creation expressions, of type NewClass. + */ + NEWCLASS, + + /** Array creation expressions, of type NewArray. + */ + NEWARRAY, + + /** Parenthesized subexpressions, of type Parens. + */ + PARENS, + + /** Assignment expressions, of type Assign. + */ + ASSIGN, + + /** Type cast expressions, of type TypeCast. + */ + TYPECAST, + + /** Type test expressions, of type TypeTest. + */ + TYPETEST, + + /** Indexed array expressions, of type Indexed. + */ + INDEXED, + + /** Selections, of type Select. + */ + SELECT, + + /** Simple identifiers, of type Ident. + */ + IDENT, + + /** Literals, of type Literal. + */ + LITERAL, + + /** Basic type identifiers, of type TypeIdent. + */ + TYPEIDENT, + + /** Array types, of type TypeArray. + */ + TYPEARRAY, + + /** Parameterized types, of type TypeApply. + */ + TYPEAPPLY, + + /** Union types, of type TypeUnion + */ + TYPEUNION, + + /** Formal type parameters, of type TypeParameter. + */ + TYPEPARAMETER, + + /** Type argument. + */ + WILDCARD, + + /** Bound kind: extends, super, exact, or unbound + */ + TYPEBOUNDKIND, + + /** metadata: Annotation. + */ + ANNOTATION, + + /** metadata: Modifiers + */ + MODIFIERS, + + ANNOTATED_TYPE, + + /** Error trees, of type Erroneous. + */ + ERRONEOUS, + + /** Unary operators, of type Unary. + */ + POS, // + + NEG, // - + NOT, // ! + COMPL, // ~ + PREINC, // ++ _ + PREDEC, // -- _ + POSTINC, // _ ++ + POSTDEC, // _ -- + + /** unary operator for null reference checks, only used internally. + */ + NULLCHK, + + /** Binary operators, of type Binary. + */ + OR, // || + AND, // && + BITOR, // | + BITXOR, // ^ + BITAND, // & + EQ, // == + NE, // != + LT, // < + GT, // > + LE, // <= + GE, // >= + SL, // << + SR, // >> + USR, // >>> + PLUS, // + + MINUS, // - + MUL, // * + DIV, // / + MOD, // % + + /** Assignment operators, of type Assignop. + */ + BITOR_ASG(BITOR), // |= + BITXOR_ASG(BITXOR), // ^= + BITAND_ASG(BITAND), // &= + + SL_ASG(SL), // <<= + SR_ASG(SR), // >>= + USR_ASG(USR), // >>>= + PLUS_ASG(PLUS), // += + MINUS_ASG(MINUS), // -= + MUL_ASG(MUL), // *= + DIV_ASG(DIV), // /= + MOD_ASG(MOD), // %= + + /** A synthetic let expression, of type LetExpr. + */ + LETEXPR; // ala scheme + + private Tag noAssignTag; + + private Tag(Tag noAssignTag) + { + this.noAssignTag = noAssignTag; + } + + private Tag() + { + } + + public Tag noAssignOp() + { + if (this.noAssignTag != null) + return noAssignTag; + throw new AssertionError("JCTree.Tag.noAssignOp() method is not available for non assignment tags"); + } + } /** The offset between assignment operators and normal operators. */ - public static final int ASGOffset = BITOR_ASG - BITOR; + //public static final int ASGOffset = BITOR_ASG - BITOR; /* The (encoded) position in the source file. @see util.Position. */ @@ -337,7 +359,7 @@ /* The tag of this node -- one of the constants declared above. */ - public abstract int getTag(); + public abstract JCTree.Tag getTag(); /** Convert a tree to a pretty-printed string. */ @Override @@ -464,10 +486,10 @@ public List getImports() { ListBuffer imports = new ListBuffer(); for (JCTree tree : defs) { - int tag = tree.getTag(); - if (tag == IMPORT) + JCTree.Tag tag = tree.getTag(); + if (tag == JCTree.Tag.IMPORT) imports.append((JCImport)tree); - else if (tag != SKIP) + else if (tag != JCTree.Tag.SKIP) break; } return imports.toList(); @@ -482,7 +504,7 @@ public List getTypeDecls() { List typeDefs; for (typeDefs = defs; !typeDefs.isEmpty(); typeDefs = typeDefs.tail) - if (typeDefs.head.getTag() != IMPORT) + if (typeDefs.head.getTag() != JCTree.Tag.IMPORT) break; return typeDefs; } @@ -492,8 +514,8 @@ } @Override - public int getTag() { - return TOPLEVEL; + public JCTree.Tag getTag() { + return JCTree.Tag.TOPLEVEL; } } @@ -521,8 +543,8 @@ } @Override - public int getTag() { - return IMPORT; + public JCTree.Tag getTag() { + return JCTree.Tag.IMPORT; } } @@ -618,8 +640,8 @@ } @Override - public int getTag() { - return CLASSDEF; + public JCTree.Tag getTag() { + return JCTree.Tag.CLASSDEF; } } @@ -690,8 +712,8 @@ } @Override - public int getTag() { - return METHODDEF; + public JCTree.Tag getTag() { + return JCTree.Tag.METHODDEF; } } @@ -736,8 +758,8 @@ } @Override - public int getTag() { - return VARDEF; + public JCTree.Tag getTag() { + return JCTree.Tag.VARDEF; } } @@ -757,8 +779,8 @@ } @Override - public int getTag() { - return SKIP; + public JCTree.Tag getTag() { + return JCTree.Tag.SKIP; } } @@ -790,8 +812,8 @@ } @Override - public int getTag() { - return BLOCK; + public JCTree.Tag getTag() { + return JCTree.Tag.BLOCK; } } @@ -817,8 +839,8 @@ } @Override - public int getTag() { - return DOLOOP; + public JCTree.Tag getTag() { + return JCTree.Tag.DOLOOP; } } @@ -844,8 +866,8 @@ } @Override - public int getTag() { - return WHILELOOP; + public JCTree.Tag getTag() { + return JCTree.Tag.WHILELOOP; } } @@ -885,8 +907,8 @@ } @Override - public int getTag() { - return FORLOOP; + public JCTree.Tag getTag() { + return JCTree.Tag.FORLOOP; } } @@ -914,8 +936,8 @@ return v.visitEnhancedForLoop(this, d); } @Override - public int getTag() { - return FOREACHLOOP; + public JCTree.Tag getTag() { + return JCTree.Tag.FOREACHLOOP; } } @@ -939,8 +961,8 @@ return v.visitLabeledStatement(this, d); } @Override - public int getTag() { - return LABELLED; + public JCTree.Tag getTag() { + return JCTree.Tag.LABELLED; } } @@ -965,8 +987,8 @@ return v.visitSwitch(this, d); } @Override - public int getTag() { - return SWITCH; + public JCTree.Tag getTag() { + return JCTree.Tag.SWITCH; } } @@ -991,8 +1013,8 @@ return v.visitCase(this, d); } @Override - public int getTag() { - return CASE; + public JCTree.Tag getTag() { + return JCTree.Tag.CASE; } } @@ -1017,8 +1039,8 @@ return v.visitSynchronized(this, d); } @Override - public int getTag() { - return SYNCHRONIZED; + public JCTree.Tag getTag() { + return JCTree.Tag.SYNCHRONIZED; } } @@ -1057,8 +1079,8 @@ return resources; } @Override - public int getTag() { - return TRY; + public JCTree.Tag getTag() { + return JCTree.Tag.TRY; } } @@ -1083,8 +1105,8 @@ return v.visitCatch(this, d); } @Override - public int getTag() { - return CATCH; + public JCTree.Tag getTag() { + return JCTree.Tag.CATCH; } } @@ -1115,8 +1137,8 @@ return v.visitConditionalExpression(this, d); } @Override - public int getTag() { - return CONDEXPR; + public JCTree.Tag getTag() { + return JCTree.Tag.CONDEXPR; } } @@ -1147,8 +1169,8 @@ return v.visitIf(this, d); } @Override - public int getTag() { - return IF; + public JCTree.Tag getTag() { + return JCTree.Tag.IF; } } @@ -1172,8 +1194,8 @@ return v.visitExpressionStatement(this, d); } @Override - public int getTag() { - return EXEC; + public JCTree.Tag getTag() { + return JCTree.Tag.EXEC; } /** Convert a expression-statement tree to a pretty-printed string. */ @@ -1212,8 +1234,8 @@ return v.visitBreak(this, d); } @Override - public int getTag() { - return BREAK; + public JCTree.Tag getTag() { + return JCTree.Tag.BREAK; } } @@ -1237,8 +1259,8 @@ return v.visitContinue(this, d); } @Override - public int getTag() { - return CONTINUE; + public JCTree.Tag getTag() { + return JCTree.Tag.CONTINUE; } } @@ -1260,8 +1282,8 @@ return v.visitReturn(this, d); } @Override - public int getTag() { - return RETURN; + public JCTree.Tag getTag() { + return JCTree.Tag.RETURN; } } @@ -1283,8 +1305,8 @@ return v.visitThrow(this, d); } @Override - public int getTag() { - return THROW; + public JCTree.Tag getTag() { + return JCTree.Tag.THROW; } } @@ -1309,8 +1331,8 @@ return v.visitAssert(this, d); } @Override - public int getTag() { - return ASSERT; + public JCTree.Tag getTag() { + return JCTree.Tag.ASSERT; } } @@ -1352,8 +1374,8 @@ return this; } @Override - public int getTag() { - return(APPLY); + public JCTree.Tag getTag() { + return(JCTree.Tag.APPLY); } } @@ -1402,8 +1424,8 @@ return v.visitNewClass(this, d); } @Override - public int getTag() { - return NEWCLASS; + public JCTree.Tag getTag() { + return JCTree.Tag.NEWCLASS; } } @@ -1438,8 +1460,8 @@ return v.visitNewArray(this, d); } @Override - public int getTag() { - return NEWARRAY; + public JCTree.Tag getTag() { + return JCTree.Tag.NEWARRAY; } } @@ -1461,8 +1483,8 @@ return v.visitParenthesized(this, d); } @Override - public int getTag() { - return PARENS; + public JCTree.Tag getTag() { + return JCTree.Tag.PARENS; } } @@ -1487,8 +1509,8 @@ return v.visitAssignment(this, d); } @Override - public int getTag() { - return ASSIGN; + public JCTree.Tag getTag() { + return JCTree.Tag.ASSIGN; } } @@ -1496,11 +1518,11 @@ * An assignment with "+=", "|=" ... */ public static class JCAssignOp extends JCExpression implements CompoundAssignmentTree { - private int opcode; + private JCTree.Tag opcode; public JCExpression lhs; public JCExpression rhs; public Symbol operator; - protected JCAssignOp(int opcode, JCTree lhs, JCTree rhs, Symbol operator) { + protected JCAssignOp(JCTree.Tag opcode, JCTree lhs, JCTree rhs, Symbol operator) { this.opcode = opcode; this.lhs = (JCExpression)lhs; this.rhs = (JCExpression)rhs; @@ -1520,7 +1542,7 @@ return v.visitCompoundAssignment(this, d); } @Override - public int getTag() { + public JCTree.Tag getTag() { return opcode; } } @@ -1529,10 +1551,10 @@ * A unary operation. */ public static class JCUnary extends JCExpression implements UnaryTree { - private int opcode; + private JCTree.Tag opcode; public JCExpression arg; public Symbol operator; - protected JCUnary(int opcode, JCExpression arg) { + protected JCUnary(JCTree.Tag opcode, JCExpression arg) { this.opcode = opcode; this.arg = arg; } @@ -1549,11 +1571,11 @@ return v.visitUnary(this, d); } @Override - public int getTag() { + public JCTree.Tag getTag() { return opcode; } - public void setTag(int tag) { + public void setTag(JCTree.Tag tag) { opcode = tag; } } @@ -1562,11 +1584,11 @@ * A binary operation. */ public static class JCBinary extends JCExpression implements BinaryTree { - private int opcode; + private JCTree.Tag opcode; public JCExpression lhs; public JCExpression rhs; public Symbol operator; - protected JCBinary(int opcode, + protected JCBinary(JCTree.Tag opcode, JCExpression lhs, JCExpression rhs, Symbol operator) { @@ -1589,7 +1611,7 @@ return v.visitBinary(this, d); } @Override - public int getTag() { + public JCTree.Tag getTag() { return opcode; } } @@ -1615,8 +1637,8 @@ return v.visitTypeCast(this, d); } @Override - public int getTag() { - return TYPECAST; + public JCTree.Tag getTag() { + return JCTree.Tag.TYPECAST; } } @@ -1641,8 +1663,8 @@ return v.visitInstanceOf(this, d); } @Override - public int getTag() { - return TYPETEST; + public JCTree.Tag getTag() { + return JCTree.Tag.TYPETEST; } } @@ -1667,8 +1689,8 @@ return v.visitArrayAccess(this, d); } @Override - public int getTag() { - return INDEXED; + public JCTree.Tag getTag() { + return JCTree.Tag.INDEXED; } } @@ -1698,8 +1720,8 @@ } public Name getIdentifier() { return name; } @Override - public int getTag() { - return SELECT; + public JCTree.Tag getTag() { + return JCTree.Tag.SELECT; } } @@ -1724,8 +1746,8 @@ public R accept(TreeVisitor v, D d) { return v.visitIdentifier(this, d); } - public int getTag() { - return IDENT; + public JCTree.Tag getTag() { + return JCTree.Tag.IDENT; } } @@ -1790,8 +1812,8 @@ return this; } @Override - public int getTag() { - return LITERAL; + public JCTree.Tag getTag() { + return JCTree.Tag.LITERAL; } } @@ -1838,8 +1860,8 @@ return v.visitPrimitiveType(this, d); } @Override - public int getTag() { - return TYPEIDENT; + public JCTree.Tag getTag() { + return JCTree.Tag.TYPEIDENT; } } @@ -1861,8 +1883,8 @@ return v.visitArrayType(this, d); } @Override - public int getTag() { - return TYPEARRAY; + public JCTree.Tag getTag() { + return JCTree.Tag.TYPEARRAY; } } @@ -1889,8 +1911,8 @@ return v.visitParameterizedType(this, d); } @Override - public int getTag() { - return TYPEAPPLY; + public JCTree.Tag getTag() { + return JCTree.Tag.TYPEAPPLY; } } @@ -1917,8 +1939,8 @@ return v.visitUnionType(this, d); } @Override - public int getTag() { - return TYPEUNION; + public JCTree.Tag getTag() { + return JCTree.Tag.TYPEUNION; } } @@ -1947,8 +1969,8 @@ return v.visitTypeParameter(this, d); } @Override - public int getTag() { - return TYPEPARAMETER; + public JCTree.Tag getTag() { + return JCTree.Tag.TYPEPARAMETER; } } @@ -1981,8 +2003,8 @@ return v.visitWildcard(this, d); } @Override - public int getTag() { - return WILDCARD; + public JCTree.Tag getTag() { + return JCTree.Tag.WILDCARD; } } @@ -2002,8 +2024,8 @@ throw new AssertionError("TypeBoundKind is not part of a public API"); } @Override - public int getTag() { - return TYPEBOUNDKIND; + public JCTree.Tag getTag() { + return JCTree.Tag.TYPEBOUNDKIND; } } @@ -2027,8 +2049,8 @@ return v.visitAnnotation(this, d); } @Override - public int getTag() { - return ANNOTATION; + public JCTree.Tag getTag() { + return JCTree.Tag.ANNOTATION; } } @@ -2054,8 +2076,8 @@ return v.visitModifiers(this, d); } @Override - public int getTag() { - return MODIFIERS; + public JCTree.Tag getTag() { + return JCTree.Tag.MODIFIERS; } } @@ -2079,8 +2101,8 @@ return v.visitErroneous(this, d); } @Override - public int getTag() { - return ERRONEOUS; + public JCTree.Tag getTag() { + return JCTree.Tag.ERRONEOUS; } } @@ -2103,8 +2125,8 @@ throw new AssertionError("LetExpr is not part of a public API"); } @Override - public int getTag() { - return LETEXPR; + public JCTree.Tag getTag() { + return JCTree.Tag.LETEXPR; } } @@ -2175,9 +2197,9 @@ List elems); JCParens Parens(JCExpression expr); JCAssign Assign(JCExpression lhs, JCExpression rhs); - JCAssignOp Assignop(int opcode, JCTree lhs, JCTree rhs); - JCUnary Unary(int opcode, JCExpression arg); - JCBinary Binary(int opcode, JCExpression lhs, JCExpression rhs); + JCAssignOp Assignop(JCTree.Tag opcode, JCTree lhs, JCTree rhs); + JCUnary Unary(JCTree.Tag opcode, JCExpression arg); + JCBinary Binary(JCTree.Tag opcode, JCExpression lhs, JCExpression rhs); JCTypeCast TypeCast(JCTree expr, JCExpression type); JCInstanceOf TypeTest(JCExpression expr, JCTree clazz); JCArrayAccess Indexed(JCExpression indexed, JCExpression index);