changeset 3393:3f12167b0a32

Automated merge with http://hg.openjdk.java.net/jdk9/dev/langtools
author wmdietl
date Mon, 09 Jun 2014 21:54:05 -0400
parents 020899586e8b cb0e8e67d555
children 9d57749ed600
files .hgtags src/share/classes/com/sun/source/util/TaskEvent.java src/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java src/share/classes/com/sun/tools/javac/api/JavacTrees.java src/share/classes/com/sun/tools/javac/code/Attribute.java src/share/classes/com/sun/tools/javac/code/Flags.java src/share/classes/com/sun/tools/javac/code/TargetType.java src/share/classes/com/sun/tools/javac/code/Type.java src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java src/share/classes/com/sun/tools/javac/code/Types.java src/share/classes/com/sun/tools/javac/comp/Annotate.java src/share/classes/com/sun/tools/javac/comp/Attr.java src/share/classes/com/sun/tools/javac/comp/Check.java src/share/classes/com/sun/tools/javac/comp/Flow.java src/share/classes/com/sun/tools/javac/comp/Infer.java src/share/classes/com/sun/tools/javac/comp/Lower.java src/share/classes/com/sun/tools/javac/comp/MemberEnter.java src/share/classes/com/sun/tools/javac/comp/Resolve.java src/share/classes/com/sun/tools/javac/comp/TransTypes.java src/share/classes/com/sun/tools/javac/jvm/ClassReader.java src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java src/share/classes/com/sun/tools/javac/jvm/Code.java src/share/classes/com/sun/tools/javac/jvm/Gen.java src/share/classes/com/sun/tools/javac/main/JavaCompiler.java src/share/classes/com/sun/tools/javac/util/Names.java test/tools/javac/annotations/typeAnnotations/TargetTypes.java test/tools/javac/annotations/typeAnnotations/classfile/ClassfileTestHelper.java test/tools/javac/annotations/typeAnnotations/failures/AnnotatedImport.java test/tools/javac/annotations/typeAnnotations/failures/AnnotatedImport.out test/tools/javac/annotations/typeAnnotations/failures/AnnotatedPackage1.java test/tools/javac/annotations/typeAnnotations/failures/AnnotatedPackage1.out test/tools/javac/annotations/typeAnnotations/failures/CantAnnotateStaticClass.java test/tools/javac/annotations/typeAnnotations/failures/CantAnnotateStaticClass2.out test/tools/javac/annotations/typeAnnotations/failures/CantAnnotateStaticClass3.java test/tools/javac/annotations/typeAnnotations/failures/CantAnnotateStaticClass3.out test/tools/javac/annotations/typeAnnotations/failures/common/arrays/MissingAnnotationValue.java test/tools/javac/annotations/typeAnnotations/failures/common/arrays/MissingAnnotationValue.out test/tools/javac/annotations/typeAnnotations/failures/common/innertypeparams/MissingAnnotationValue.java test/tools/javac/annotations/typeAnnotations/failures/common/innertypeparams/MissingAnnotationValue.out test/tools/javac/annotations/typeAnnotations/failures/common/newarray/MissingAnnotationValue.java test/tools/javac/annotations/typeAnnotations/failures/common/newarray/MissingAnnotationValue.out test/tools/javac/annotations/typeAnnotations/failures/common/receiver/MissingAnnotationValue.java test/tools/javac/annotations/typeAnnotations/failures/common/receiver/MissingAnnotationValue.out test/tools/javac/annotations/typeAnnotations/failures/common/typeArgs/MissingAnnotationValue.java test/tools/javac/annotations/typeAnnotations/failures/common/typeArgs/MissingAnnotationValue.out test/tools/javac/annotations/typeAnnotations/failures/common/typeparams/MissingAnnotationValue.java test/tools/javac/annotations/typeAnnotations/failures/common/typeparams/MissingAnnotationValue.out test/tools/javac/annotations/typeAnnotations/failures/common/wildcards/MissingAnnotationValue.java test/tools/javac/annotations/typeAnnotations/failures/common/wildcards/MissingAnnotationValue.out test/tools/javac/annotations/typeAnnotations/newlocations/Expressions.java test/tools/javac/annotations/typeAnnotations/newlocations/NestedTypes.java test/tools/javac/annotations/typeAnnotations/newlocations/RepeatingTypeAnnotations.out test/tools/javac/annotations/typeAnnotations/referenceinfos/ClassExtends.java test/tools/javac/annotations/typeAnnotations/referenceinfos/ClassTypeParam.java test/tools/javac/annotations/typeAnnotations/referenceinfos/Constructors.java test/tools/javac/annotations/typeAnnotations/referenceinfos/Driver.java test/tools/javac/annotations/typeAnnotations/referenceinfos/ExceptionParameters.java test/tools/javac/annotations/typeAnnotations/referenceinfos/Fields.java test/tools/javac/annotations/typeAnnotations/referenceinfos/FromSpecification.java test/tools/javac/annotations/typeAnnotations/referenceinfos/Initializers.java test/tools/javac/annotations/typeAnnotations/referenceinfos/Lambda.java test/tools/javac/annotations/typeAnnotations/referenceinfos/MethodParameters.java test/tools/javac/annotations/typeAnnotations/referenceinfos/MethodReceivers.java test/tools/javac/annotations/typeAnnotations/referenceinfos/MethodReturns.java test/tools/javac/annotations/typeAnnotations/referenceinfos/MethodThrows.java test/tools/javac/annotations/typeAnnotations/referenceinfos/MethodTypeParam.java test/tools/javac/annotations/typeAnnotations/referenceinfos/MultiCatch.java test/tools/javac/annotations/typeAnnotations/referenceinfos/NestedTypes.java test/tools/javac/annotations/typeAnnotations/referenceinfos/NewObjects.java test/tools/javac/annotations/typeAnnotations/referenceinfos/ReferenceInfoUtil.java test/tools/javac/annotations/typeAnnotations/referenceinfos/TypeCasts.java test/tools/javac/annotations/typeAnnotations/referenceinfos/TypeTests.java test/tools/javac/api/6410643/T6410643.java test/tools/javac/processing/model/element/TestAnonClassNames.java test/tools/javac/tree/TreePosTest.java test/tools/javap/output/RepeatingTypeAnnotations.java
diffstat 27 files changed, 328 insertions(+), 139 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Mon Jun 09 15:46:44 2014 -0400
+++ b/.hgtags	Mon Jun 09 21:54:05 2014 -0400
@@ -140,6 +140,7 @@
 1cbe86c11ba69521875c0b0357d7540781eb334d jdk8-b17
 ec2c0973cc31e143cffc05ceb63d98fae76f97d4 jdk8-b16
 ab1b1cc7857716914f2bb20b3128e5a8978290f7 jdk8-b18
+2a2d6ac056cfde7326f309ab73b8cddf518cc729 308-jdk8-sync
 77b2c066084cbc75150efc6603a713c558329813 jdk8-b19
 ffd294128a48cbb90ce8f0569f82b61f1f164a18 jdk8-b20
 bcb21abf1c4177baf4574f99709513dcd4474727 jdk8-b21
--- a/src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java	Mon Jun 09 15:46:44 2014 -0400
+++ b/src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java	Mon Jun 09 21:54:05 2014 -0400
@@ -25,6 +25,7 @@
 
 package com.sun.tools.javac.code;
 
+import java.util.Arrays;
 import java.util.Iterator;
 
 import com.sun.tools.javac.tree.JCTree.JCLambda;
@@ -158,7 +159,7 @@
     // the catch type index.  Then in
     // com.sun.tools.javac.jvm.Code.fillExceptionParameterPositions we
     // use that value to determine the exception table index.
-    private int exception_index = Integer.MIN_VALUE;
+    public int exception_index = Integer.MIN_VALUE;
 
     // If this type annotation is within a lambda expression,
     // store a pointer to the lambda expression tree in order
@@ -389,6 +390,27 @@
     }
 
     /**
+     * Create a new TypeAnnotationPosition with the same values as the input, deeply copied.
+     *
+     * @param tapos The input value.
+     * @return A new copy of the input.
+     */
+    public static TypeAnnotationPosition copy(final TypeAnnotationPosition tapos) {
+        TypeAnnotationPosition res = new TypeAnnotationPosition(tapos.type, tapos.pos, tapos.parameter_index,
+                tapos.onLambda, tapos.type_index, tapos.bound_index, List.from(tapos.location));
+        res.isValidOffset = tapos.isValidOffset;
+        res.exception_index = tapos.exception_index;
+        if (tapos.lvarIndex != null)
+            res.lvarIndex = Arrays.copyOf(tapos.lvarIndex, tapos.lvarIndex.length);
+        if (tapos.lvarLength != null)
+            res.lvarLength = Arrays.copyOf(tapos.lvarLength, tapos.lvarLength.length);
+        if (tapos.lvarOffset != null)
+            res.lvarOffset = Arrays.copyOf(tapos.lvarOffset, tapos.lvarOffset.length);
+        res.offset = tapos.offset;
+        return res;
+    }
+
+    /**
      * Create a {@code TypeAnnotationPosition} for a method return.
      *
      * @param location The type path.
--- a/src/share/classes/com/sun/tools/javac/comp/Check.java	Mon Jun 09 15:46:44 2014 -0400
+++ b/src/share/classes/com/sun/tools/javac/comp/Check.java	Mon Jun 09 21:54:05 2014 -0400
@@ -2790,7 +2790,7 @@
     }
 
     public void validateTypeAnnotation(JCAnnotation a, boolean isTypeParameter) {
-        Assert.checkNonNull(a.type, "annotation tree hasn't been attributed yet: " + a);
+        Assert.checkNonNull(a.type); // , "annotation tree hasn't been attributed yet: " + a);
         validateAnnotationTree(a);
 
         if (a.hasTag(TYPE_ANNOTATION) &&
--- a/src/share/classes/com/sun/tools/javac/model/JavacTypes.java	Mon Jun 09 15:46:44 2014 -0400
+++ b/src/share/classes/com/sun/tools/javac/model/JavacTypes.java	Mon Jun 09 21:54:05 2014 -0400
@@ -123,8 +123,8 @@
             throw new IllegalArgumentException(t.toString());
         Type unboxed = types.unboxedType((Type) t);
         if (! unboxed.isPrimitive())    // only true primitives, not void
-            throw new IllegalArgumentException(t.toString());
-        return (PrimitiveType)unboxed;
+            throw new IllegalArgumentException(String.format("unboxed (%s) is not primitive:  t=%s, this=%s, this.types=%s", unboxed, t, this, this.types));
+        return (PrimitiveType) unboxed;
     }
 
     public TypeMirror capture(TypeMirror t) {
--- a/src/share/classes/com/sun/tools/javac/parser/Scanner.java	Mon Jun 09 15:46:44 2014 -0400
+++ b/src/share/classes/com/sun/tools/javac/parser/Scanner.java	Mon Jun 09 21:54:05 2014 -0400
@@ -30,7 +30,6 @@
 import java.util.ArrayList;
 
 import com.sun.tools.javac.util.Position.LineMap;
-import com.sun.tools.javac.parser.JavaTokenizer.*;
 
 import static com.sun.tools.javac.parser.Tokens.*;
 
--- a/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java	Mon Jun 09 15:46:44 2014 -0400
+++ b/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java	Mon Jun 09 21:54:05 2014 -0400
@@ -47,7 +47,7 @@
 
 /**
  * A rich diagnostic formatter is a formatter that provides better integration
- * with javac's type system. A diagostic is first preprocessed in order to keep
+ * with javac's type system. A diagnostic is first preprocessed in order to keep
  * track of each types/symbols in it; after these informations are collected,
  * the diagnostic is rendered using a standard formatter, whose type/symbol printer
  * has been replaced by a more refined version provided by this rich formatter.
--- a/src/share/classes/javax/annotation/processing/Messager.java	Mon Jun 09 15:46:44 2014 -0400
+++ b/src/share/classes/javax/annotation/processing/Messager.java	Mon Jun 09 21:54:05 2014 -0400
@@ -25,9 +25,10 @@
 
 package javax.annotation.processing;
 
-import javax.annotation.*;
+import javax.lang.model.element.AnnotationMirror;
+import javax.lang.model.element.AnnotationValue;
+import javax.lang.model.element.Element;
 import javax.tools.Diagnostic;
-import javax.lang.model.element.*;
 
 /**
  * A {@code Messager} provides the way for an annotation processor to
--- a/src/share/classes/javax/lang/model/element/Element.java	Mon Jun 09 15:46:44 2014 -0400
+++ b/src/share/classes/javax/lang/model/element/Element.java	Mon Jun 09 21:54:05 2014 -0400
@@ -25,16 +25,11 @@
 
 package javax.lang.model.element;
 
-
 import java.lang.annotation.Annotation;
-import java.lang.annotation.AnnotationTypeMismatchException;
-import java.lang.annotation.IncompleteAnnotationException;
 import java.util.List;
 import java.util.Set;
 
-import javax.lang.model.type.*;
-import javax.lang.model.util.*;
-
+import javax.lang.model.type.TypeMirror;
 
 /**
  * Represents a program element such as a package, class, or method.
--- a/src/share/classes/javax/lang/model/type/TypeMirror.java	Mon Jun 09 15:46:44 2014 -0400
+++ b/src/share/classes/javax/lang/model/type/TypeMirror.java	Mon Jun 09 21:54:05 2014 -0400
@@ -25,8 +25,6 @@
 
 package javax.lang.model.type;
 
-import java.lang.annotation.Annotation;
-import java.util.List;
 import javax.lang.model.element.*;
 import javax.lang.model.util.Types;
 
--- a/src/share/classes/javax/lang/model/type/TypeVariable.java	Mon Jun 09 15:46:44 2014 -0400
+++ b/src/share/classes/javax/lang/model/type/TypeVariable.java	Mon Jun 09 21:54:05 2014 -0400
@@ -25,11 +25,8 @@
 
 package javax.lang.model.type;
 
-
 import javax.lang.model.element.Element;
 import javax.lang.model.element.TypeParameterElement;
-import javax.lang.model.util.Types;
-
 
 /**
  * Represents a type variable.
--- a/src/share/classes/javax/lang/model/type/TypeVisitor.java	Mon Jun 09 15:46:44 2014 -0400
+++ b/src/share/classes/javax/lang/model/type/TypeVisitor.java	Mon Jun 09 21:54:05 2014 -0400
@@ -25,8 +25,6 @@
 
 package javax.lang.model.type;
 
-import javax.lang.model.element.*;
-
 /**
  * A visitor of types, in the style of the
  * visitor design pattern.  Classes implementing this
--- a/src/share/classes/javax/lang/model/util/Elements.java	Mon Jun 09 15:46:44 2014 -0400
+++ b/src/share/classes/javax/lang/model/util/Elements.java	Mon Jun 09 21:54:05 2014 -0400
@@ -25,13 +25,16 @@
 
 package javax.lang.model.util;
 
-
 import java.util.List;
 import java.util.Map;
 
-import javax.lang.model.element.*;
-import javax.lang.model.type.*;
-
+import javax.lang.model.element.AnnotationMirror;
+import javax.lang.model.element.AnnotationValue;
+import javax.lang.model.element.Element;
+import javax.lang.model.element.ExecutableElement;
+import javax.lang.model.element.Name;
+import javax.lang.model.element.PackageElement;
+import javax.lang.model.element.TypeElement;
 
 /**
  * Utility methods for operating on program elements.
--- a/src/share/classes/javax/lang/model/util/Types.java	Mon Jun 09 15:46:44 2014 -0400
+++ b/src/share/classes/javax/lang/model/util/Types.java	Mon Jun 09 21:54:05 2014 -0400
@@ -25,12 +25,19 @@
 
 package javax.lang.model.util;
 
-import java.lang.annotation.Annotation;
-import java.lang.annotation.AnnotationTypeMismatchException;
-import java.lang.annotation.IncompleteAnnotationException;
 import java.util.List;
-import javax.lang.model.element.*;
-import javax.lang.model.type.*;
+
+import javax.lang.model.element.Element;
+import javax.lang.model.element.TypeElement;
+import javax.lang.model.type.ArrayType;
+import javax.lang.model.type.DeclaredType;
+import javax.lang.model.type.ExecutableType;
+import javax.lang.model.type.NoType;
+import javax.lang.model.type.NullType;
+import javax.lang.model.type.PrimitiveType;
+import javax.lang.model.type.TypeMirror;
+import javax.lang.model.type.TypeKind;
+import javax.lang.model.type.WildcardType;
 
 /**
  * Utility methods for operating on types.
--- a/src/share/classes/javax/tools/JavaCompiler.java	Mon Jun 09 15:46:44 2014 -0400
+++ b/src/share/classes/javax/tools/JavaCompiler.java	Mon Jun 09 21:54:05 2014 -0400
@@ -25,7 +25,6 @@
 
 package javax.tools;
 
-import java.io.File;
 import java.io.Writer;
 import java.nio.charset.Charset;
 import java.util.Locale;
--- a/src/share/classes/javax/tools/SimpleJavaFileObject.java	Mon Jun 09 15:46:44 2014 -0400
+++ b/src/share/classes/javax/tools/SimpleJavaFileObject.java	Mon Jun 09 21:54:05 2014 -0400
@@ -25,12 +25,19 @@
 
 package javax.tools;
 
-import java.io.*;
+import java.io.CharArrayReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Reader;
+import java.io.StringReader;
+import java.io.Writer;
 import java.net.URI;
 import java.nio.CharBuffer;
+
 import javax.lang.model.element.Modifier;
 import javax.lang.model.element.NestingKind;
-import javax.tools.JavaFileObject.Kind;
 
 /**
  * Provides simple implementations for most methods in JavaFileObject.
--- a/src/share/classes/javax/tools/StandardJavaFileManager.java	Mon Jun 09 15:46:44 2014 -0400
+++ b/src/share/classes/javax/tools/StandardJavaFileManager.java	Mon Jun 09 21:54:05 2014 -0400
@@ -27,7 +27,6 @@
 
 import java.io.File;
 import java.io.IOException;
-import java.util.*;
 
 /**
  * File manager based on {@linkplain File java.io.File}.  A common way
--- a/test/tools/javac/annotations/typeAnnotations/classfile/T8008762.java	Mon Jun 09 15:46:44 2014 -0400
+++ b/test/tools/javac/annotations/typeAnnotations/classfile/T8008762.java	Mon Jun 09 21:54:05 2014 -0400
@@ -61,12 +61,12 @@
     static class Test {
         Object mtest( Test t){ return null; }
         public void test() {
-          mtest( new Test() {
+            mtest( new Test() {
                 class InnerAnon { // Test1$1$InnerAnon.class
-                  @A @B String ai_data = null;
-                  @A @B String ai_m(){ return null; };
+                    @A @B String ai_data = null;
+                    @A @B String ai_m(){ return null; };
                 }
-               InnerAnon IA = new InnerAnon();
+                InnerAnon IA = new InnerAnon();
             });
         }
         @Retention(RUNTIME) @Target(TYPE_USE) @interface A { }
--- a/test/tools/javac/annotations/typeAnnotations/failures/AnnotatedImport.java	Mon Jun 09 15:46:44 2014 -0400
+++ b/test/tools/javac/annotations/typeAnnotations/failures/AnnotatedImport.java	Mon Jun 09 21:54:05 2014 -0400
@@ -7,6 +7,7 @@
  */
 
 import java.lang.annotation.*;
+
 import java.@A util.List;
 import @A java.util.Map;
 import java.util.@A HashMap;
--- a/test/tools/javac/annotations/typeAnnotations/failures/AnnotatedImport.out	Mon Jun 09 15:46:44 2014 -0400
+++ b/test/tools/javac/annotations/typeAnnotations/failures/AnnotatedImport.out	Mon Jun 09 21:54:05 2014 -0400
@@ -1,7 +1,7 @@
-AnnotatedImport.java:10:13: compiler.err.expected: token.identifier
-AnnotatedImport.java:10:16: compiler.err.expected3: class, interface, enum
-AnnotatedImport.java:11:7: compiler.err.expected: token.identifier
-AnnotatedImport.java:11:11: compiler.err.expected3: class, interface, enum
-AnnotatedImport.java:12:18: compiler.err.expected: token.identifier
-AnnotatedImport.java:12:21: compiler.err.expected3: class, interface, enum
+AnnotatedImport.java:11:13: compiler.err.expected: token.identifier
+AnnotatedImport.java:11:16: compiler.err.expected3: class, interface, enum
+AnnotatedImport.java:12:7: compiler.err.expected: token.identifier
+AnnotatedImport.java:12:11: compiler.err.expected3: class, interface, enum
+AnnotatedImport.java:13:18: compiler.err.expected: token.identifier
+AnnotatedImport.java:13:21: compiler.err.expected3: class, interface, enum
 6 errors
--- a/test/tools/javac/annotations/typeAnnotations/failures/AnnotatedPackage1.java	Mon Jun 09 15:46:44 2014 -0400
+++ b/test/tools/javac/annotations/typeAnnotations/failures/AnnotatedPackage1.java	Mon Jun 09 21:54:05 2014 -0400
@@ -6,7 +6,9 @@
  * @compile/fail/ref=AnnotatedPackage1.out -XDrawDiagnostics AnnotatedPackage1.java
  */
 
-package name.@A p1.p2;
+package name. @A p1.p2;
+
+import java.lang.annotation.*;
 
 import java.lang.annotation.*;
 
--- a/test/tools/javac/annotations/typeAnnotations/failures/AnnotatedPackage1.out	Mon Jun 09 15:46:44 2014 -0400
+++ b/test/tools/javac/annotations/typeAnnotations/failures/AnnotatedPackage1.out	Mon Jun 09 21:54:05 2014 -0400
@@ -1,3 +1,3 @@
 AnnotatedPackage1.java:9:14: compiler.err.expected: token.identifier
-AnnotatedPackage1.java:9:17: compiler.err.expected3: class, interface, enum
+AnnotatedPackage1.java:9:18: compiler.err.expected3: class, interface, enum
 2 errors
--- a/test/tools/javac/annotations/typeAnnotations/failures/CantAnnotateStaticClass3.out	Mon Jun 09 15:46:44 2014 -0400
+++ b/test/tools/javac/annotations/typeAnnotations/failures/CantAnnotateStaticClass3.out	Mon Jun 09 21:54:05 2014 -0400
@@ -1,92 +1,83 @@
 CantAnnotateStaticClass3.java:44:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
 CantAnnotateStaticClass3.java:45:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
 CantAnnotateStaticClass3.java:46:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:52:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:53:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:54:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:56:12: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass3.java:57:12: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass3.java:57:23: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:58:12: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass3.java:58:23: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:59:12: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass3.java:59:23: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:61:12: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass3.java:62:12: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass3.java:63:12: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass3.java:65:12: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass3.java:65:23: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:66:12: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass3.java:66:23: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:67:12: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass3.java:67:23: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:52:16: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:53:16: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:54:16: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:56:14: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:57:23: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:58:23: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:59:23: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:61:21: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:62:21: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:63:21: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:65:25: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:66:25: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:67:25: compiler.err.cant.type.annotate.scoping.1: @Top.TA
 CantAnnotateStaticClass3.java:71:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
 CantAnnotateStaticClass3.java:72:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
 CantAnnotateStaticClass3.java:73:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:79:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:80:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:81:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:79:16: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:80:16: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:81:16: compiler.err.cant.type.annotate.scoping.1: @Top.TB
 CantAnnotateStaticClass3.java:84:22: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:86:22: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:86:24: compiler.err.cant.type.annotate.scoping.1: @Top.TB
 CantAnnotateStaticClass3.java:88:22: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:90:22: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:90:24: compiler.err.cant.type.annotate.scoping.1: @Top.TB
 CantAnnotateStaticClass3.java:92:22: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:94:22: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:120:19: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:121:19: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:122:19: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:128:19: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:129:19: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:130:19: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:132:17: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass3.java:134:17: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass3.java:134:28: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:135:17: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass3.java:135:28: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:136:17: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass3.java:136:28: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:138:17: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass3.java:139:17: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass3.java:140:17: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass3.java:142:17: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass3.java:142:28: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:143:17: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass3.java:143:28: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:144:17: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass3.java:144:28: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:149:19: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:150:19: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:151:19: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:157:19: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:158:19: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:159:19: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:162:27: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:164:27: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:166:27: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:168:27: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:170:27: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:172:27: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:99:23: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:101:23: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:106:23: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:108:23: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:113:23: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:115:23: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:177:40: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:179:46: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:180:46: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:185:40: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:187:46: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:188:46: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:193:40: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:195:46: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:196:46: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:200:38: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass3.java:201:38: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass3.java:201:49: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:202:44: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass3.java:203:44: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass3.java:203:55: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:204:44: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass3.java:204:55: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-91 errors
+CantAnnotateStaticClass3.java:94:24: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:57:12: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:58:12: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:59:12: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:65:12: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:66:12: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:67:12: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:120:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:121:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:122:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:128:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:129:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:130:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:132:14: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:134:17: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:135:17: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:136:17: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:138:14: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:139:14: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:140:14: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:142:17: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:143:17: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:144:17: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:149:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:150:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:151:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:157:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:158:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:159:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:162:22: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:164:22: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:166:22: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:168:22: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:170:22: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:172:22: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:99:18: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:101:18: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:106:18: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:108:18: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:113:18: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:115:18: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:177:35: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:179:41: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:180:41: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:185:35: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:187:41: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:188:41: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:193:35: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:195:41: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:196:41: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:200:35: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:201:38: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:202:41: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:203:44: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:204:44: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+82 errors
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/annotations/typeAnnotations/referenceinfos/Enums.java	Mon Jun 09 21:54:05 2014 -0400
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import static com.sun.tools.classfile.TypeAnnotation.TargetType.*;
+
+/*
+ * @test
+ * bug 8030751
+ * @ignore
+ * @summary Test population of reference info for enums
+ * @author wmdietl
+ * @compile -g Driver.java ReferenceInfoUtil.java Enums.java
+ * @run main Driver Enums
+ */
+public class Enums {
+
+    @TADescription(annotation = "TA", type = FIELD)
+    public String enums1() {
+        return "enum Test { @TA E }";
+    }
+
+    @TADescriptions({
+        @TADescription(annotation = "TA", type = FIELD),
+        @TADescription(annotation = "TB", type = FIELD)
+    })
+    public String enums2() {
+        return "enum Test { @TA E1, @TB E2 }";
+    }
+
+    @TADescription(annotation = "TA", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    public String enums3() {
+        return "enum Test { E(new @TA Object()); Test(Object o) {} }";
+    }
+}
--- a/test/tools/javac/annotations/typeAnnotations/referenceinfos/Fields.java	Mon Jun 09 15:46:44 2014 -0400
+++ b/test/tools/javac/annotations/typeAnnotations/referenceinfos/Fields.java	Mon Jun 09 21:54:05 2014 -0400
@@ -71,6 +71,58 @@
         return "@TC String test @TA [] @TB [];";
     }
 
+    @TADescriptions({
+        @TADescription(annotation = "TA", type = FIELD),
+        @TADescription(annotation = "TB", type = FIELD,
+                genericLocation = { 0, 0 }),
+        @TADescription(annotation = "TC", type = FIELD,
+                genericLocation = { 0, 0, 0, 0 }),
+        @TADescription(annotation = "TD", type = FIELD,
+                genericLocation = { 0, 0, 0, 0, 0, 0 })
+    })
+    public String fieldAsArray2() {
+        return "@TD String @TA [] @TB [] @TC [] test;";
+    }
+
+    @TADescriptions({
+        @TADescription(annotation = "TC", type = FIELD),
+        @TADescription(annotation = "TA", type = FIELD,
+                genericLocation = { 0, 0 }),
+        @TADescription(annotation = "TB", type = FIELD,
+                genericLocation = { 0, 0, 0, 0 }),
+        @TADescription(annotation = "TD", type = FIELD,
+                genericLocation = { 0, 0, 0, 0, 0, 0 })
+    })
+    public String fieldAsArray2aOld() {
+        return "@TD String @TA [] @TB [] test @TC [];";
+    }
+
+    @TADescriptions({
+        @TADescription(annotation = "TB", type = FIELD),
+        @TADescription(annotation = "TC", type = FIELD,
+                genericLocation = { 0, 0 }),
+        @TADescription(annotation = "TA", type = FIELD,
+                genericLocation = { 0, 0, 0, 0 }),
+        @TADescription(annotation = "TD", type = FIELD,
+                genericLocation = { 0, 0, 0, 0, 0, 0 })
+    })
+    public String fieldAsArray2bOld() {
+        return "@TD String @TA [] test @TB [] @TC [];";
+    }
+
+    @TADescriptions({
+        @TADescription(annotation = "TA", type = FIELD),
+        @TADescription(annotation = "TB", type = FIELD,
+                genericLocation = { 0, 0 }),
+        @TADescription(annotation = "TC", type = FIELD,
+                genericLocation = { 0, 0, 0, 0 }),
+        @TADescription(annotation = "TD", type = FIELD,
+                genericLocation = { 0, 0, 0, 0, 0, 0 })
+    })
+    public String fieldAsArray2cOld() {
+        return "@TD String test @TA [] @TB [] @TC [];";
+    }
+
     @TADescriptions({})
     public String fieldWithDeclarationAnnotatin() {
         return "@Decl String test;";
--- a/test/tools/javac/annotations/typeAnnotations/referenceinfos/MethodReturns.java	Mon Jun 09 15:46:44 2014 -0400
+++ b/test/tools/javac/annotations/typeAnnotations/referenceinfos/MethodReturns.java	Mon Jun 09 21:54:05 2014 -0400
@@ -72,6 +72,58 @@
         return "@TC String test() @TA [] @TB [] { return null; }";
     }
 
+    @TADescriptions({
+        @TADescription(annotation = "TA", type = METHOD_RETURN),
+        @TADescription(annotation = "TB", type = METHOD_RETURN,
+                genericLocation = { 0, 0 }),
+        @TADescription(annotation = "TC", type = METHOD_RETURN,
+                genericLocation = { 0, 0, 0, 0 }),
+        @TADescription(annotation = "TD", type = METHOD_RETURN,
+                genericLocation = { 0, 0, 0, 0, 0, 0 })
+    })
+    public String methodReturnAsArray2() {
+        return "@TD String @TA [] @TB [] @TC [] test() { return null; }";
+    }
+
+    @TADescriptions({
+        @TADescription(annotation = "TC", type = METHOD_RETURN),
+        @TADescription(annotation = "TA", type = METHOD_RETURN,
+                genericLocation = { 0, 0 }),
+        @TADescription(annotation = "TB", type = METHOD_RETURN,
+                genericLocation = { 0, 0, 0, 0 }),
+        @TADescription(annotation = "TD", type = METHOD_RETURN,
+                genericLocation = { 0, 0, 0, 0, 0, 0 })
+    })
+    public String methodReturnAsArray2aOld() {
+        return "@TD String @TA [] @TB [] test() @TC [] { return null; } ";
+    }
+
+    @TADescriptions({
+        @TADescription(annotation = "TB", type = METHOD_RETURN),
+        @TADescription(annotation = "TC", type = METHOD_RETURN,
+                genericLocation = { 0, 0 }),
+        @TADescription(annotation = "TA", type = METHOD_RETURN,
+                genericLocation = { 0, 0, 0, 0 }),
+        @TADescription(annotation = "TD", type = METHOD_RETURN,
+                genericLocation = { 0, 0, 0, 0, 0, 0 })
+    })
+    public String methodReturnAsArray2bOld() {
+        return "@TD String @TA [] test() @TB [] @TC [] { return null; } ";
+    }
+
+    @TADescriptions({
+        @TADescription(annotation = "TA", type = METHOD_RETURN),
+        @TADescription(annotation = "TB", type = METHOD_RETURN,
+                genericLocation = { 0, 0 }),
+        @TADescription(annotation = "TC", type = METHOD_RETURN,
+                genericLocation = { 0, 0, 0, 0 }),
+        @TADescription(annotation = "TD", type = METHOD_RETURN,
+                genericLocation = { 0, 0, 0, 0, 0, 0 })
+    })
+    public String methodReturnAsArray2cOld() {
+        return "@TD String test() @TA [] @TB [] @TC [] { return null; } ";
+    }
+
     @TADescriptions({})
     public String methodWithDeclarationAnnotation() {
         return "@Decl String test() { return null; }";
--- a/test/tools/javac/lib/DPrinter.java	Mon Jun 09 15:46:44 2014 -0400
+++ b/test/tools/javac/lib/DPrinter.java	Mon Jun 09 21:54:05 2014 -0400
@@ -403,7 +403,7 @@
                 printType("type", sym.type, Details.SUMMARY);
                 printType("erasure", sym.erasure_field, Details.SUMMARY);
                 sym.accept(symVisitor, null);
-                printAnnotations("annotations", sym.getAnnotations(), Details.SUMMARY);
+                printAnnotations("annotations", sym.getMetadata(), Details.SUMMARY);
                 indent(-1);
             }
         }
@@ -529,9 +529,13 @@
     public class TreeVisitor extends JCTree.Visitor {
         @Override
         public void visitTopLevel(JCCompilationUnit tree) {
-            printList("packageAnnotations", tree.packageAnnotations);
+            printList("packageAnnotations", tree.getPackageAnnotations());
+            printList("defs", tree.defs);
+        }
+
+        @Override
+        public void visitPackageDef(JCPackageDecl tree) {
             printTree("pid", tree.pid);
-            printList("defs", tree.defs);
         }
 
         @Override
@@ -945,12 +949,6 @@
      * visit method for its superclass.
      */
     public class TypeVisitor implements Type.Visitor<Void,Void> {
-        public Void visitAnnotatedType(AnnotatedType type, Void ignore) {
-            printList("typeAnnotations", type.getAnnotationMirrors());
-            printType("underlyingType", type.unannotatedType(), Details.FULL);
-            return visitType(type, null);
-        }
-
         public Void visitArrayType(ArrayType type, Void ignore) {
             printType("elemType", type.elemtype, Details.FULL);
             return visitType(type, null);
--- a/test/tools/javac/processing/model/type/BasicAnnoTests.java	Mon Jun 09 15:46:44 2014 -0400
+++ b/test/tools/javac/processing/model/type/BasicAnnoTests.java	Mon Jun 09 21:54:05 2014 -0400
@@ -25,8 +25,8 @@
  * @test
  * @bug     8013852
  * @summary Annotations on types
+ * @ignore Test will be fixed in Java 8 update release.
  * @library /tools/javac/lib
- * @ignore
  * @build JavacTestingAbstractProcessor DPrinter BasicAnnoTests
  * @compile/process -processor BasicAnnoTests -proc:only BasicAnnoTests.java
  */
@@ -47,6 +47,7 @@
 import javax.lang.model.element.ExecutableElement;
 import javax.lang.model.element.TypeElement;
 import javax.lang.model.type.ArrayType;
+import javax.lang.model.type.DeclaredType;
 import javax.lang.model.type.ExecutableType;
 import javax.lang.model.type.TypeMirror;
 import javax.lang.model.type.TypeVariable;
@@ -234,6 +235,12 @@
             return super.visitWildcard(t, p);
         }
 
+        @Override
+        public R visitDeclared(DeclaredType t, P p) {
+            scan(t.getTypeArguments(), p);
+            return super.visitDeclared(t, p);
+        }
+
         R scan(TypeMirror t) {
             return scan(t, null);
         }
@@ -285,4 +292,10 @@
 
     @Test(posn=3, annoType=TA.class, expect="6")
     public int m3(float a) throws @TA(6) Exception { return 0; }
+
+    @Test(posn=1, annoType=TA.class, expect="7")
+    public java.util.List<@TA(7) String> f7;
+
+    @Test(posn=2, annoType=TA.class, expect="8")
+    public void m8(java.util.List<@TA(8) String> a) { }
 }