diff -r ca063536e4a6 -r 03944ee4fac4 src/share/classes/com/sun/tools/javac/tree/JCTree.java --- a/src/share/classes/com/sun/tools/javac/tree/JCTree.java Fri Jun 26 12:22:40 2009 -0700 +++ b/src/share/classes/com/sun/tools/javac/tree/JCTree.java Fri Jun 26 18:51:39 2009 -0700 @@ -256,9 +256,11 @@ */ 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 = MODIFIERS + 1; + public static final int ERRONEOUS = ANNOTATED_TYPE + 1; /** Unary operators, of type Unary. */ @@ -622,6 +624,7 @@ public JCExpression restype; public List typarams; public List params; + public List receiverAnnotations; public List thrown; public JCBlock body; public JCExpression defaultValue; // for annotation types @@ -631,6 +634,7 @@ JCExpression restype, List typarams, List params, + List receiver, List thrown, JCBlock body, JCExpression defaultValue, @@ -641,6 +645,7 @@ this.restype = restype; this.typarams = typarams; this.params = params; + this.receiverAnnotations = (receiver != null ? receiver : List.nil()); this.thrown = thrown; this.body = body; this.defaultValue = defaultValue; @@ -659,6 +664,7 @@ public List getParameters() { return params; } + public List getReceiverAnnotations() { return receiverAnnotations; } public List getThrows() { return thrown; } @@ -1371,6 +1377,8 @@ public static class JCNewArray extends JCExpression implements NewArrayTree { public JCExpression elemtype; public List dims; + public List annotations; + public List> dimAnnotations; public List elems; protected JCNewArray(JCExpression elemtype, List dims, @@ -1378,6 +1386,8 @@ { this.elemtype = elemtype; this.dims = dims; + this.annotations = List.nil(); + this.dimAnnotations = List.nil(); this.elems = elems; } @Override @@ -1860,9 +1870,11 @@ public static class JCTypeParameter extends JCTree implements TypeParameterTree { public Name name; public List bounds; - protected JCTypeParameter(Name name, List bounds) { + public List annotations; + protected JCTypeParameter(Name name, List bounds, List annotations) { this.name = name; this.bounds = bounds; + this.annotations = annotations; } @Override public void accept(Visitor v) { v.visitTypeParameter(this); } @@ -1872,6 +1884,9 @@ public List getBounds() { return bounds; } + public List getAnnotations() { + return annotations; + } @Override public R accept(TreeVisitor v, D d) { return v.visitTypeParameter(this, d); @@ -1962,6 +1977,16 @@ } } + public static class JCTypeAnnotation extends JCAnnotation { + public TypeAnnotationPosition annotation_position; + public Attribute.TypeCompound attribute_field; + + protected JCTypeAnnotation(JCTree annotationType, List args) { + super(annotationType, args); + this.annotation_position = new TypeAnnotationPosition(); + } + } + public static class JCModifiers extends JCTree implements com.sun.source.tree.ModifiersTree { public long flags; public List annotations; @@ -1989,6 +2014,33 @@ } } + public static class JCAnnotatedType extends JCExpression implements com.sun.source.tree.AnnotatedTypeTree { + public List annotations; + public JCExpression underlyingType; + protected JCAnnotatedType(List annotations, JCExpression underlyingType) { + this.annotations = annotations; + this.underlyingType = underlyingType; + } + @Override + public void accept(Visitor v) { v.visitAnnotatedType(this); } + + public Kind getKind() { return Kind.ANNOTATED_TYPE; } + public List getAnnotations() { + return annotations; + } + public JCExpression getUnderlyingType() { + return underlyingType; + } + @Override + public R accept(TreeVisitor v, D d) { + return v.visitAnnotatedType(this, d); + } + @Override + public int getTag() { + return ANNOTATED_TYPE; + } + } + public static class JCErroneous extends JCExpression implements com.sun.source.tree.ErroneousTree { public List errs; @@ -2056,6 +2108,7 @@ JCExpression restype, List typarams, List params, + List receiver, List thrown, JCBlock body, JCExpression defaultValue); @@ -2172,6 +2225,7 @@ public void visitTypeBoundKind(TypeBoundKind that) { visitTree(that); } public void visitAnnotation(JCAnnotation that) { visitTree(that); } public void visitModifiers(JCModifiers that) { visitTree(that); } + public void visitAnnotatedType(JCAnnotatedType that) { visitTree(that); } public void visitErroneous(JCErroneous that) { visitTree(that); } public void visitLetExpr(LetExpr that) { visitTree(that); }