changeset 2063:406957bfc1e9

merge with jdk8-b87
author mcimadamore
date Wed, 01 May 2013 10:47:01 +0100
parents 70542599122d a1e10f3adc47
children d696217e0089
files .hgtags src/share/classes/com/sun/tools/javac/code/Flags.java src/share/classes/com/sun/tools/javac/code/Symbol.java src/share/classes/com/sun/tools/javac/code/Symtab.java src/share/classes/com/sun/tools/javac/code/Type.java src/share/classes/com/sun/tools/javac/code/Types.java src/share/classes/com/sun/tools/javac/comp/Attr.java src/share/classes/com/sun/tools/javac/comp/DeferredAttr.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/LambdaToMethod.java src/share/classes/com/sun/tools/javac/comp/Lower.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/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/jvm/Items.java src/share/classes/com/sun/tools/javac/main/JavaCompiler.java src/share/classes/com/sun/tools/javac/main/Main.java src/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java src/share/classes/com/sun/tools/javac/parser/JavacParser.java src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java src/share/classes/com/sun/tools/javac/resources/compiler.properties src/share/classes/com/sun/tools/javac/tree/TreeInfo.java src/share/classes/com/sun/tools/javac/util/BaseFileManager.java src/share/classes/com/sun/tools/javac/util/CloseableURLClassLoader.java src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java src/share/classes/com/sun/tools/javadoc/DocEnv.java src/share/classes/com/sun/tools/javadoc/ExecutableMemberDocImpl.java src/share/classes/javax/lang/model/element/Modifier.java test/tools/javac/defaultMethods/DefaultMethodFlags.java test/tools/javac/lambda/BadRecovery.out test/tools/javac/lambda/Intersection01.java test/tools/javac/lambda/Intersection01.out test/tools/javac/lambda/Intersection03.java test/tools/javac/lambda/TargetType01.java test/tools/javac/lambda/TargetType43.out test/tools/javac/lambda/TargetType69.java test/tools/javac/lambda/TargetType70.java test/tools/javac/lambda/TargetType72.java test/tools/javac/lambda/TestInvokeDynamic.java test/tools/javac/lambda/intersection/IntersectionTargetTypeTest.java test/tools/javac/lambdaShapes/org/openjdk/tests/vm/DefaultMethodsTest.java test/tools/javac/types/TypeHarness.java
diffstat 87 files changed, 2095 insertions(+), 396 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Tue Apr 30 17:01:18 2013 +0100
+++ b/.hgtags	Wed May 01 10:47:01 2013 +0100
@@ -211,3 +211,5 @@
 22ba3f92d4ae43bbc19793e854171cae2586f644 jdk8-b83
 cfb65ca92082b2412aed66c8422c2466bde544ef jdk8-b84
 4a48f31735349782ad13980267358c97076adc66 jdk8-b85
+6ab578e141dfd17c4dc03869bb204aafa490c9f4 jdk8-b86
+1329f9c38d93c8caf339d7687df8371d06fe9e56 jdk8-b87
--- a/src/share/classes/com/sun/javadoc/ExecutableMemberDoc.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/javadoc/ExecutableMemberDoc.java	Wed May 01 10:47:01 2013 +0100
@@ -88,13 +88,12 @@
     Parameter[] parameters();
 
     /**
-     * Get the receiver annotations of this executable element.
-     * Return an empty array if there are none.
+     * Get the receiver type of this executable element.
      *
-     * @return the receiver annotations of this executable element.
+     * @return the receiver type of this executable element.
      * @since 1.8
      */
-    AnnotationDesc[] receiverAnnotations();
+    Type receiverType();
 
     /**
      * Return the throws tags in this method.
--- a/src/share/classes/com/sun/javadoc/Type.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/javadoc/Type.java	Wed May 01 10:47:01 2013 +0100
@@ -160,4 +160,13 @@
      * @since 1.5
      */
     AnnotationTypeDoc asAnnotationTypeDoc();
+
+    /**
+     * If this type is an array type, return the element type of the
+     * array. Otherwise, return null.
+     *
+     * @return a <code>Type</code> representing the element type or null.
+     * @since 1.8
+     */
+    Type getElementType();
 }
--- a/src/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java	Wed May 01 10:47:01 2013 +0100
@@ -139,12 +139,24 @@
         }
     }
 
-    protected void addReceiverAnnotations(ExecutableMemberDoc member,
-            Content tree) {
-        if (member.receiverAnnotations().length > 0) {
-            tree.addContent(writer.getSpace());
-            writer.addReceiverAnnotationInfo(member, tree);
-        }
+    /**
+     * Add the receiver annotations information.
+     *
+     * @param member the member to write receiver annotations for.
+     * @param rcvrType the receiver type.
+     * @param descList list of annotation description.
+     * @param tree the content tree to which the information will be added.
+     */
+    protected void addReceiverAnnotations(ExecutableMemberDoc member, Type rcvrType,
+            AnnotationDesc[] descList, Content tree) {
+        writer.addReceiverAnnotationInfo(member, descList, tree);
+        tree.addContent(writer.getSpace());
+        tree.addContent(rcvrType.typeName());
+        LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
+                LinkInfoImpl.CONTEXT_CLASS_SIGNATURE, rcvrType);
+        tree.addContent(new RawHtml(writer.getTypeParameterLinks(linkInfo)));
+        tree.addContent(writer.getSpace());
+        tree.addContent("this");
     }
 
 
@@ -168,14 +180,24 @@
     protected void addParameters(ExecutableMemberDoc member,
             boolean includeAnnotations, Content htmltree) {
         htmltree.addContent("(");
+        String sep = "";
         Parameter[] params = member.parameters();
         String indent = makeSpace(writer.displayLength);
         if (configuration.linksource) {
             //add spaces to offset indentation changes caused by link.
             indent+= makeSpace(member.name().length());
         }
+        Type rcvrType = member.receiverType();
+        if (includeAnnotations && rcvrType instanceof AnnotatedType) {
+            AnnotationDesc[] descList = rcvrType.asAnnotatedType().annotations();
+            if (descList.length > 0) {
+                addReceiverAnnotations(member, rcvrType, descList, htmltree);
+                sep = "," + DocletConstants.NL + indent;
+            }
+        }
         int paramstart;
         for (paramstart = 0; paramstart < params.length; paramstart++) {
+            htmltree.addContent(sep);
             Parameter param = params[paramstart];
             if (!param.name().startsWith("this$")) {
                 if (includeAnnotations) {
--- a/src/share/classes/com/sun/tools/doclets/formats/html/ConstructorWriterImpl.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/ConstructorWriterImpl.java	Wed May 01 10:47:01 2013 +0100
@@ -137,7 +137,6 @@
             addName(constructor.name(), pre);
         }
         addParameters(constructor, pre);
-        writer.addReceiverAnnotationInfo(constructor, pre);
         addExceptions(constructor, pre);
         return pre;
     }
--- a/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java	Wed May 01 10:47:01 2013 +0100
@@ -1860,11 +1860,13 @@
      * Add the annotation types of the executable receiver.
      *
      * @param method the executable to write the receiver annotations for.
+     * @param descList list of annotation description.
      * @param htmltree the documentation tree to which the annotation info will be
      *        added
      */
-    public void addReceiverAnnotationInfo(ExecutableMemberDoc method, Content htmltree) {
-        addAnnotationInfo(method, method.receiverAnnotations(), htmltree);
+    public void addReceiverAnnotationInfo(ExecutableMemberDoc method, AnnotationDesc[] descList,
+            Content htmltree) {
+        addAnnotationInfo(0, method, descList, false, htmltree);
     }
 
     /**
@@ -1915,13 +1917,16 @@
     private boolean addAnnotationInfo(int indent, Doc doc,
             AnnotationDesc[] descList, boolean lineBreak, Content htmltree) {
         List<String> annotations = getAnnotations(indent, descList, lineBreak);
+        String sep ="";
         if (annotations.size() == 0) {
             return false;
         }
         Content annotationContent;
         for (Iterator<String> iter = annotations.iterator(); iter.hasNext();) {
+            htmltree.addContent(sep);
             annotationContent = new RawHtml(iter.next());
             htmltree.addContent(annotationContent);
+            sep = " ";
         }
         return true;
     }
--- a/src/share/classes/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java	Wed May 01 10:47:01 2013 +0100
@@ -157,9 +157,9 @@
             if (!isFirst) {
                 linkInfo.displayLength += 1;
                 output.append(" ");
-                isFirst = false;
             }
             output.append(anno);
+            isFirst = false;
         }
         if (!annos.isEmpty()) {
             linkInfo.displayLength += 1;
--- a/src/share/classes/com/sun/tools/doclets/formats/html/LinkOutputImpl.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/LinkOutputImpl.java	Wed May 01 10:47:01 2013 +0100
@@ -63,6 +63,13 @@
     /**
      * {@inheritDoc}
      */
+    public void insert(int offset, Object o) {
+        output.insert(offset, o.toString());
+    }
+
+    /**
+     * {@inheritDoc}
+     */
     public String toString() {
         return output.toString();
     }
--- a/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java	Wed May 01 10:47:01 2013 +0100
@@ -130,7 +130,6 @@
             addName(method.name(), pre);
         }
         addParameters(method, pre);
-        addReceiverAnnotations(method, pre);
         addExceptions(method, pre);
         return pre;
     }
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/links/LinkFactory.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/links/LinkFactory.java	Wed May 01 10:47:01 2013 +0100
@@ -61,7 +61,7 @@
                 //Just a primitive.
                 linkInfo.displayLength += type.typeName().length();
                 linkOutput.append(type.typeName());
-            } else if (type.asAnnotatedType() != null) {
+            } else if (type.asAnnotatedType() != null && type.dimension().length() == 0) {
                 linkOutput.append(getTypeAnnotationLinks(linkInfo));
                 linkInfo.type = type.asAnnotatedType().underlyingType();
                 linkOutput.append(getLinkOutput(linkInfo));
@@ -141,8 +141,21 @@
                 linkInfo.displayLength += 3;
                 linkOutput.append("...");
             } else {
-                linkInfo.displayLength += type.dimension().length();
-                linkOutput.append(type.dimension());
+                while (type != null && type.dimension().length() > 0) {
+                    linkInfo.displayLength += type.dimension().length();
+                    if (type.asAnnotatedType() != null) {
+                        linkInfo.type = type;
+                        linkOutput.append(" ");
+                        linkOutput.append(getTypeAnnotationLinks(linkInfo));
+                        linkOutput.append("[]");
+                        type = type.asAnnotatedType().underlyingType().getElementType();
+                    } else {
+                        linkOutput.append("[]");
+                        type = type.getElementType();
+                    }
+                }
+                linkInfo.type = type;
+                linkOutput.insert(0, getTypeAnnotationLinks(linkInfo));
             }
             return linkOutput;
         } else if (linkInfo.classDoc != null) {
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/links/LinkOutput.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/links/LinkOutput.java	Wed May 01 10:47:01 2013 +0100
@@ -44,4 +44,12 @@
      * @param o the object to append.
      */
     public void append(Object o);
+
+    /**
+     * Insert the given object into the output sequence.
+     *
+     * @param offset the offset.
+     * @param o the object to be inserted.
+     */
+    public void insert(int offset, Object o);
 }
--- a/src/share/classes/com/sun/tools/doclint/Checker.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclint/Checker.java	Wed May 01 10:47:01 2013 +0100
@@ -122,12 +122,15 @@
     private Deque<TagStackItem> tagStack; // TODO: maybe want to record starting tree as well
     private HtmlTag currHeaderTag;
 
+    private final int implicitHeaderLevel;
+
     // <editor-fold defaultstate="collapsed" desc="Top level">
 
     Checker(Env env) {
         env.getClass();
         this.env = env;
         tagStack = new LinkedList<TagStackItem>();
+        implicitHeaderLevel = env.implicitHeaderLevel;
     }
 
     public Void scan(DocCommentTree tree, TreePath p) {
@@ -386,7 +389,7 @@
 
     private int getHeaderLevel(HtmlTag tag) {
         if (tag == null)
-            return 0;
+            return implicitHeaderLevel;
         switch (tag) {
             case H1: return 1;
             case H2: return 2;
--- a/src/share/classes/com/sun/tools/doclint/DocLint.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclint/DocLint.java	Wed May 01 10:47:01 2013 +0100
@@ -30,6 +30,7 @@
 import java.io.PrintWriter;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.regex.Pattern;
 
 import javax.lang.model.element.Name;
 import javax.tools.StandardLocation;
@@ -72,6 +73,7 @@
     public static final String XMSGS_OPTION = "-Xmsgs";
     public static final String XMSGS_CUSTOM_PREFIX = "-Xmsgs:";
     private static final String STATS = "-stats";
+    public static final String XIMPLICIT_HEADERS = "-XimplicitHeaders:";
 
     // <editor-fold defaultstate="collapsed" desc="Command-line entry point">
     public static void main(String... args) {
@@ -289,6 +291,9 @@
                 env.messages.setOptions(null);
             } else if (arg.startsWith(XMSGS_CUSTOM_PREFIX)) {
                 env.messages.setOptions(arg.substring(arg.indexOf(":") + 1));
+            } else if (arg.matches(XIMPLICIT_HEADERS + "[1-6]")) {
+                char ch = arg.charAt(arg.length() - 1);
+                env.setImplicitHeaders(Character.digit(ch, 10));
             } else
                 throw new IllegalArgumentException(arg);
         }
--- a/src/share/classes/com/sun/tools/doclint/Env.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclint/Env.java	Wed May 01 10:47:01 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -83,6 +83,8 @@
     /** Message handler. */
     final Messages messages;
 
+    int implicitHeaderLevel = 0;
+
     // Utility classes
     DocTrees trees;
     Elements elements;
@@ -102,7 +104,7 @@
     DocCommentTree currDocComment;
     /**
      * The access kind of the declaration containing the comment currently being analyzed.
-     * This is the minimum (most restrictive) access kind of the declaration iteself
+     * This is the minimum (most restrictive) access kind of the declaration itself
      * and that of its containers. For example, a public method in a private class is
      * noted as private.
      */
@@ -128,6 +130,10 @@
         java_lang_Void = elements.getTypeElement("java.lang.Void").asType();
     }
 
+    void setImplicitHeaders(int n) {
+        implicitHeaderLevel = n;
+    }
+
     /** Set the current declaration and its doc comment. */
     void setCurrent(TreePath path, DocCommentTree comment) {
         currPath = path;
--- a/src/share/classes/com/sun/tools/javac/code/Flags.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/code/Flags.java	Wed May 01 10:47:01 2013 +0100
@@ -319,6 +319,7 @@
                                           modifiers.add(Modifier.SYNCHRONIZED);
             if (0 != (flags & NATIVE))    modifiers.add(Modifier.NATIVE);
             if (0 != (flags & STRICTFP))  modifiers.add(Modifier.STRICTFP);
+            if (0 != (flags & DEFAULT))   modifiers.add(Modifier.DEFAULT);
             modifiers = Collections.unmodifiableSet(modifiers);
             modifierSets.put(flags, modifiers);
         }
--- a/src/share/classes/com/sun/tools/javac/code/Symbol.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/code/Symbol.java	Wed May 01 10:47:01 2013 +0100
@@ -453,7 +453,7 @@
         return ElementKind.OTHER;       // most unkind
     }
 
-    public Set<Modifier> getModifiers() {        
+    public Set<Modifier> getModifiers() {
         return Flags.asModifierSet(flags());
     }
 
@@ -495,10 +495,11 @@
         return List.nil();
     }
 
-    public List<TypeSymbol> getTypeParameters() {
-        ListBuffer<TypeSymbol> l = ListBuffer.lb();
+    public List<TypeVariableSymbol> getTypeParameters() {
+        ListBuffer<TypeVariableSymbol> l = ListBuffer.lb();
         for (Type t : type.getTypeArguments()) {
-            l.append(t.tsym);
+            Assert.check(t.tsym.getKind() == ElementKind.TYPE_PARAMETER);
+            l.append((TypeVariableSymbol)t.tsym);
         }
         return l.toList();
     }
@@ -545,19 +546,12 @@
         }
     }
 
-    /** A class for type symbols. Type variables are represented by instances
-     *  of this class, classes and packages by instances of subclasses.
+    /** A base class for Symbols representing types.
      */
-    public static class TypeSymbol
-            extends Symbol implements TypeParameterElement {
-        // Implements TypeParameterElement because type parameters don't
-        // have their own TypeSymbol subclass.
-        // TODO: type parameters should have their own TypeSymbol subclass
-
-        public TypeSymbol(long flags, Name name, Type type, Symbol owner) {
-            super(TYP, flags, name, type, owner);
+    public static abstract class TypeSymbol extends Symbol {
+        public TypeSymbol(int kind, long flags, Name name, Type type, Symbol owner) {
+            super(kind, flags, name, type, owner);
         }
-
         /** form a fully qualified name from a name and an owner
          */
         static public Name formFullName(Name name, Symbol owner) {
@@ -609,11 +603,7 @@
             return this.type.hasTag(TYPEVAR);
         }
 
-        // For type params; overridden in subclasses.
-        public ElementKind getKind() {
-            return ElementKind.TYPE_PARAMETER;
-        }
-
+        @Override
         public java.util.List<Symbol> getEnclosedElements() {
             List<Symbol> list = List.nil();
             if (kind == TYP && type.hasTag(TYPEVAR)) {
@@ -626,23 +616,31 @@
             return list;
         }
 
-        // For type params.
-        // Perhaps not needed if getEnclosingElement can be spec'ed
-        // to do the same thing.
-        // TODO: getGenericElement() might not be needed
+        @Override
+        public <R, P> R accept(Symbol.Visitor<R, P> v, P p) {
+            return v.visitTypeSymbol(this, p);
+        }
+    }
+
+    /**
+     * Type variables are represented by instances of this class.
+     */
+    public static class TypeVariableSymbol
+            extends TypeSymbol implements TypeParameterElement {
+
+        public TypeVariableSymbol(long flags, Name name, Type type, Symbol owner) {
+            super(TYP, flags, name, type, owner);
+        }
+
+        public ElementKind getKind() {
+            return ElementKind.TYPE_PARAMETER;
+        }
+
+        @Override
         public Symbol getGenericElement() {
             return owner;
         }
 
-        public <R, P> R accept(ElementVisitor<R, P> v, P p) {
-            Assert.check(type.hasTag(TYPEVAR)); // else override will be invoked
-            return v.visitTypeParameter(this, p);
-        }
-
-        public <R, P> R accept(Symbol.Visitor<R, P> v, P p) {
-            return v.visitTypeSymbol(this, p);
-        }
-
         public List<Type> getBounds() {
             TypeVar t = (TypeVar)type;
             Type bound = t.getUpperBound();
@@ -657,6 +655,11 @@
                 return ct.interfaces_field;
             }
         }
+
+        @Override
+        public <R, P> R accept(ElementVisitor<R, P> v, P p) {
+            return v.visitTypeParameter(this, p);
+        }
     }
 
     /** A class for package symbols
@@ -669,8 +672,7 @@
         public ClassSymbol package_info; // see bug 6443073
 
         public PackageSymbol(Name name, Type type, Symbol owner) {
-            super(0, name, type, owner);
-            this.kind = PCK;
+            super(PCK, 0, name, type, owner);
             this.members_field = null;
             this.fullname = formFullName(name, owner);
         }
@@ -782,7 +784,7 @@
         public Pool pool;
 
         public ClassSymbol(long flags, Name name, Type type, Symbol owner) {
-            super(flags, name, type, owner);
+            super(TYP, flags, name, type, owner);
             this.members_field = null;
             this.fullname = formFullName(name, owner);
             this.flatname = formFlatName(name, owner);
--- a/src/share/classes/com/sun/tools/javac/code/Symtab.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/code/Symtab.java	Wed May 01 10:47:01 2013 +0100
@@ -404,12 +404,11 @@
                     return messages.getLocalizedString("compiler.misc.unnamed.package");
                 }
             };
-        noSymbol = new TypeSymbol(0, names.empty, Type.noType, rootPackage) {
+        noSymbol = new TypeSymbol(Kinds.NIL, 0, names.empty, Type.noType, rootPackage) {
             public <R, P> R accept(ElementVisitor<R, P> v, P p) {
                 return v.visitUnknown(this, p);
             }
         };
-        noSymbol.kind = Kinds.NIL;
 
         // create the error symbols
         errSymbol = new ClassSymbol(PUBLIC|STATIC|ACYCLIC, names.any, null, rootPackage);
--- a/src/share/classes/com/sun/tools/javac/code/Type.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/code/Type.java	Wed May 01 10:47:01 2013 +0100
@@ -1145,7 +1145,7 @@
 
         public TypeVar(Name name, Symbol owner, Type lower) {
             super(TYPEVAR, null);
-            tsym = new TypeSymbol(0, name, this, owner);
+            tsym = new TypeVariableSymbol(0, name, this, owner);
             this.lower = lower;
         }
 
--- a/src/share/classes/com/sun/tools/javac/code/Types.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/code/Types.java	Wed May 01 10:47:01 2013 +0100
@@ -2629,15 +2629,15 @@
     public List<MethodSymbol> interfaceCandidates(Type site, MethodSymbol ms) {
         Filter<Symbol> filter = new MethodFilter(ms, site);
         List<MethodSymbol> candidates = List.nil();
-        for (Symbol s : membersClosure(site, false).getElements(filter)) {
-            if (!site.tsym.isInterface() && !s.owner.isInterface()) {
-                return List.of((MethodSymbol)s);
-            } else if (!candidates.contains(s)) {
-                candidates = candidates.prepend((MethodSymbol)s);
+            for (Symbol s : membersClosure(site, false).getElements(filter)) {
+                if (!site.tsym.isInterface() && !s.owner.isInterface()) {
+                    return List.of((MethodSymbol)s);
+                } else if (!candidates.contains(s)) {
+                    candidates = candidates.prepend((MethodSymbol)s);
+                }
             }
+            return prune(candidates);
         }
-        return prune(candidates);
-    }
 
     public List<MethodSymbol> prune(List<MethodSymbol> methods) {
         ListBuffer<MethodSymbol> methodsMin = ListBuffer.lb();
--- a/src/share/classes/com/sun/tools/javac/comp/Attr.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/comp/Attr.java	Wed May 01 10:47:01 2013 +0100
@@ -2343,7 +2343,7 @@
                 recoveryInfo :
                 new ResultInfo(VAL, lambdaType.getReturnType(), funcContext);
             localEnv.info.returnResult = bodyResultInfo;
-            
+
             Log.DeferredDiagnosticHandler lambdaDeferredHandler = new Log.DeferredDiagnosticHandler(log);
             try {
                 if (that.getBodyKind() == JCLambda.BodyKind.EXPRESSION) {
@@ -2352,7 +2352,7 @@
                     JCBlock body = (JCBlock)that.body;
                     attribStats(body.stats, localEnv);
                 }
-            
+
                 if (resultInfo.checkContext.deferredAttrContext().mode == AttrMode.SPECULATIVE) {
                     //check for errors in lambda body
                     for (JCDiagnostic deferredDiag : lambdaDeferredHandler.getDiagnostics()) {
@@ -2443,13 +2443,13 @@
                 notionalIntf.tsym.flags_field |= INTERFACE;
                 return notionalIntf.tsym;
             }
-            
+
             private void reportIntersectionError(DiagnosticPosition pos, String key, Object... args) {
                 resultInfo.checkContext.report(pos, diags.fragment("bad.intersection.target.for.functional.expr",
                         diags.fragment(key, args)));
             }
         };
-    
+
         private Type fallbackDescriptorType(JCExpression tree) {
             switch (tree.getTag()) {
                 case LAMBDA:
@@ -2460,20 +2460,24 @@
                                 argtypes.append(param.vartype.type) :
                                 argtypes.append(syms.errType);
                     }
-                    return new MethodType(argtypes, Type.recoveryType, List.of(syms.throwableType), syms.methodClass);
+                    return new MethodType(argtypes, Type.recoveryType,
+                            List.of(syms.throwableType), syms.methodClass);
                 case REFERENCE:
-                    return new MethodType(List.<Type>nil(), Type.recoveryType, List.of(syms.throwableType), syms.methodClass);
+                    return new MethodType(List.<Type>nil(), Type.recoveryType,
+                            List.of(syms.throwableType), syms.methodClass);
                 default:
                     Assert.error("Cannot get here!");
             }
             return null;
         }
 
-        private void checkAccessibleTypes(final DiagnosticPosition pos, final Env<AttrContext> env, final InferenceContext inferenceContext, final Type... ts) {
+        private void checkAccessibleTypes(final DiagnosticPosition pos, final Env<AttrContext> env,
+                final InferenceContext inferenceContext, final Type... ts) {
             checkAccessibleTypes(pos, env, inferenceContext, List.from(ts));
         }
 
-        private void checkAccessibleTypes(final DiagnosticPosition pos, final Env<AttrContext> env, final InferenceContext inferenceContext, final List<Type> ts) {
+        private void checkAccessibleTypes(final DiagnosticPosition pos, final Env<AttrContext> env,
+                final InferenceContext inferenceContext, final List<Type> ts) {
             if (inferenceContext.free(ts)) {
                 inferenceContext.addFreeTypeListener(ts, new FreeTypeListener() {
                     @Override
@@ -2662,7 +2666,7 @@
 
                 JCDiagnostic.DiagnosticType diagKind = targetError ?
                         JCDiagnostic.DiagnosticType.FRAGMENT : JCDiagnostic.DiagnosticType.ERROR;
-                
+
                 JCDiagnostic diag = diags.create(diagKind, log.currentSource(), that,
                         "invalid.mref", Kinds.kindName(that.getMode()), detailsDiag);
 
@@ -2691,7 +2695,7 @@
                 result = that.type = target;
                 return;
             }
-            
+
             if (resultInfo.checkContext.deferredAttrContext().mode == AttrMode.CHECK) {
                 
                 if (that.getMode() == ReferenceMode.INVOKE &&
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/com/sun/tools/javac/comp/CompileStates.java	Wed May 01 10:47:01 2013 +0100
@@ -0,0 +1,92 @@
+/*
+ * 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.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * 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.
+ */
+
+package com.sun.tools.javac.comp;
+
+import java.util.HashMap;
+
+import com.sun.tools.javac.util.Context;
+
+/** Partial map to record which compiler phases have been executed
+ *  for each compilation unit. Used for ATTR and FLOW phases.
+ *
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
+ *  This code and its internal interfaces are subject to change or
+ *  deletion without notice.</b>
+ */
+public class CompileStates extends HashMap<Env<AttrContext>, CompileStates.CompileState> {
+    /** The context key for the compile states. */
+    protected static final Context.Key<CompileStates> compileStatesKey =
+        new Context.Key<CompileStates>();
+
+    /** Get the CompileStates instance for this context. */
+    public static CompileStates instance(Context context) {
+        CompileStates instance = context.get(compileStatesKey);
+        if (instance == null) {
+            instance = new CompileStates(context);
+        }
+        return instance;
+    }
+
+    /** Ordered list of compiler phases for each compilation unit. */
+    public enum CompileState {
+        INIT(0),
+        PARSE(1),
+        ENTER(2),
+        PROCESS(3),
+        ATTR(4),
+        FLOW(5),
+        TRANSTYPES(6),
+        UNLAMBDA(7),
+        LOWER(8),
+        GENERATE(9);
+
+        CompileState(int value) {
+            this.value = value;
+        }
+        public boolean isAfter(CompileState other) {
+            return value > other.value;
+        }
+        public static CompileState max(CompileState a, CompileState b) {
+            return a.value > b.value ? a : b;
+        }
+        private final int value;
+    };
+
+    private static final long serialVersionUID = 1812267524140424433L;
+
+    protected Context context;
+
+    public CompileStates(Context context) {
+        this.context = context;
+        context.put(compileStatesKey, this);
+    }
+
+    public boolean isDone(Env<AttrContext> env, CompileState cs) {
+        CompileState ecs = get(env);
+        return (ecs != null) && !cs.isAfter(ecs);
+    }
+}
--- a/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java	Wed May 01 10:47:01 2013 +0100
@@ -800,9 +800,9 @@
             }
         }
     }
-    
+
     /**
-     * Does the argument expression {@code arg} need speculative type-checking?
+     * Does the argument expression {@code expr} need speculative type-checking?
      */
     boolean isDeferred(Env<AttrContext> env, JCExpression expr) {
         DeferredChecker dc = new DeferredChecker(env);
@@ -815,7 +815,7 @@
      * determines as to whether speculative attribution is necessary.
      */
     enum ArgumentExpressionKind {
-        
+
         /** kind that denotes poly argument expression */
         POLY,
         /** kind that denotes a standalone expression */
@@ -829,14 +829,14 @@
         public final boolean isPoly() {
             return this == POLY;
         }
-        
+
         /**
          * Does this kind denote a primitive standalone expression
          */
         public final boolean isPrimitive() {
             return this == PRIMITIVE;
         }
-        
+
         /**
          * Compute the kind of a standalone expression of a given type
          */
@@ -845,7 +845,7 @@
                     ArgumentExpressionKind.PRIMITIVE :
                     ArgumentExpressionKind.NO_POLY;
         }
-        
+
         /**
          * Compute the kind of a method argument expression given its symbol
          */
@@ -859,19 +859,18 @@
             }
         }
     }
-    
+
     /**
      * Tree scanner used for checking as to whether an argument expression
      * requires speculative attribution
      */
     final class DeferredChecker extends FilterScanner {
-        
+
         Env<AttrContext> env;
         ArgumentExpressionKind result;
 
         public DeferredChecker(Env<AttrContext> env) {
-            super(EnumSet.of(LAMBDA, REFERENCE, PARENS, TYPECAST, CONDEXPR,
-                    NEWCLASS, APPLY, LITERAL));
+            super(deferredCheckerTags);
             this.env = env;
         }
 
@@ -920,7 +919,7 @@
                     name == name.table.names._super) {
                 result = ArgumentExpressionKind.NO_POLY;
                 return;
-            } 
+            }
 
             //slow path
             final JCExpression rec = tree.meth.hasTag(SELECT) ?
@@ -1010,6 +1009,10 @@
         @Override
         void skip(JCTree tree) {
             result = ArgumentExpressionKind.NO_POLY;
-        }        
+        }
     }
+    //where
+    private EnumSet<JCTree.Tag> deferredCheckerTags =
+            EnumSet.of(LAMBDA, REFERENCE, PARENS, TYPECAST,
+                    CONDEXPR, NEWCLASS, APPLY, LITERAL);
 }
--- a/src/share/classes/com/sun/tools/javac/comp/Infer.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/comp/Infer.java	Wed May 01 10:47:01 2013 +0100
@@ -275,7 +275,7 @@
             UndetVar uv = (UndetVar)inferenceContext.asFree(t);
             List<Type> upperBounds = uv.getBounds(InferenceBound.UPPER);
             if (Type.containsAny(upperBounds, vars)) {
-                TypeSymbol fresh_tvar = new TypeSymbol(Flags.SYNTHETIC, uv.qtype.tsym.name, null, uv.qtype.tsym.owner);
+                TypeSymbol fresh_tvar = new TypeVariableSymbol(Flags.SYNTHETIC, uv.qtype.tsym.name, null, uv.qtype.tsym.owner);
                 fresh_tvar.type = new TypeVar(fresh_tvar, types.makeCompoundType(uv.getBounds(InferenceBound.UPPER)), null);
                 todo.append(uv);
                 uv.inst = fresh_tvar.type;
--- a/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java	Wed May 01 10:47:01 2013 +0100
@@ -1323,6 +1323,7 @@
             // the generated lambda method will not have type yet, but the
             // enclosing method's name will have been generated with this same
             // method, so it will be unique and never be overloaded.
+            Assert.check(owner.type != null || directlyEnclosingLambda() != null);
             if (owner.type != null) {
                 int methTypeHash = methodSig(owner.type).hashCode();
                 buf.append(Integer.toHexString(methTypeHash));
--- a/src/share/classes/com/sun/tools/javac/comp/Lower.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/comp/Lower.java	Wed May 01 10:47:01 2013 +0100
@@ -48,6 +48,7 @@
 import static com.sun.tools.javac.code.TypeTag.*;
 import static com.sun.tools.javac.jvm.ByteCodes.*;
 import static com.sun.tools.javac.tree.JCTree.Tag.*;
+import javax.lang.model.type.TypeKind;
 
 /** This pass translates away some syntactic sugar: inner classes,
  *  class literals, assertions, foreach loops, etc.
@@ -3400,8 +3401,11 @@
             if (iterableType.getTypeArguments().nonEmpty())
                 iteratorTarget = types.erasure(iterableType.getTypeArguments().head);
             Type eType = tree.expr.type;
+            while (eType.hasTag(TYPEVAR)) {
+                eType = eType.getUpperBound();
+            }
             tree.expr.type = types.erasure(eType);
-            if (eType.hasTag(TYPEVAR) && eType.getUpperBound().isCompound())
+            if (eType.isCompound())
                 tree.expr = make.TypeCast(types.erasure(iterableType), tree.expr);
             Symbol iterator = lookupMethod(tree.expr.pos(),
                                            names.iterator,
--- a/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Wed May 01 10:47:01 2013 +0100
@@ -631,7 +631,7 @@
                                 List<Type> argtypes,
                                 List<Type> formals,
                                 Warner warn);
-        
+
         /**
          * Retrieve the method check object that will be used during a
          * most specific check.
@@ -672,7 +672,7 @@
             return String.format("([a-z]*\\.)*(%s|%s)", basicKey, inferKey);
         }
     }
-    
+
     /**
      * Dummy method check object. All methods are deemed applicable, regardless
      * of their formal parameter types.
@@ -813,7 +813,7 @@
             ResultInfo mresult = methodCheckResult(varargs, formal, deferredAttrContext, warn);
             mresult.check(pos, actual);
         }
-        
+
         @Override
         public void argumentsAcceptable(final Env<AttrContext> env,
                                     DeferredAttrContext deferredAttrContext,
@@ -3702,7 +3702,7 @@
 
         @Override
         public Symbol baseSymbol() {
-			return delegatedError.baseSymbol();
+            return delegatedError.baseSymbol();
         }
 
         @Override
@@ -3879,7 +3879,7 @@
         private List<Candidate> candidates = List.nil();
 
         MethodResolutionPhase step = null;
-        
+
         MethodCheck methodCheck = resolveMethodCheck;
 
         private boolean internalResolution = false;
--- a/src/share/classes/com/sun/tools/javac/comp/TransTypes.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/comp/TransTypes.java	Wed May 01 10:47:01 2013 +0100
@@ -42,6 +42,7 @@
 import static com.sun.tools.javac.code.TypeTag.FORALL;
 import static com.sun.tools.javac.code.TypeTag.TYPEVAR;
 import static com.sun.tools.javac.code.TypeTag.VOID;
+import static com.sun.tools.javac.comp.CompileStates.CompileState;
 
 /** This pass translates Generic Java to conventional Java.
  *
@@ -80,8 +81,11 @@
      */
     private final boolean addBridges;
 
+    private final CompileStates compileStates;
+
     protected TransTypes(Context context) {
         context.put(transTypesKey, this);
+        compileStates = CompileStates.instance(context);
         names = Names.instance(context);
         log = Log.instance(context);
         syms = Symtab.instance(context);
@@ -965,16 +969,40 @@
 
     private Env<AttrContext> env;
 
+    private static final String statePreviousToFlowAssertMsg =
+            "The current compile state [%s] of class %s is previous to FLOW";
+
     void translateClass(ClassSymbol c) {
         Type st = types.supertype(c.type);
-
         // process superclass before derived
-        if (st.hasTag(CLASS))
+        if (st.hasTag(CLASS)) {
             translateClass((ClassSymbol)st.tsym);
+        }
 
         Env<AttrContext> myEnv = enter.typeEnvs.remove(c);
-        if (myEnv == null)
+        if (myEnv == null) {
             return;
+        }
+
+        /*  The two assertions below are set for early detection of any attempt
+         *  to translate a class that:
+         *
+         *  1) has no compile state being it the most outer class.
+         *     We accept this condition for inner classes.
+         *
+         *  2) has a compile state which is previous to Flow state.
+         */
+        boolean envHasCompState = compileStates.get(myEnv) != null;
+        if (!envHasCompState && c.outermostClass() == c) {
+            Assert.error("No info for outermost class: " + myEnv.enclClass.sym);
+        }
+
+        if (envHasCompState &&
+                CompileState.FLOW.isAfter(compileStates.get(myEnv))) {
+            Assert.error(String.format(statePreviousToFlowAssertMsg,
+                    compileStates.get(myEnv), myEnv.enclClass.sym));
+        }
+
         Env<AttrContext> oldEnv = env;
         try {
             env = myEnv;
--- a/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java	Wed May 01 10:47:01 2013 +0100
@@ -1016,7 +1016,8 @@
 //          log.errWriter.println("enter inner " + c);//DEBUG
             enterInner(c.owner.enclClass());
             pool.put(c);
-            pool.put(c.name);
+            if (c.name != names.empty)
+                pool.put(c.name);
             if (innerClasses == null) {
                 innerClasses = new HashSet<ClassSymbol>();
                 innerClassesQueue = new ListBuffer<ClassSymbol>();
--- a/src/share/classes/com/sun/tools/javac/jvm/Code.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/jvm/Code.java	Wed May 01 10:47:01 2013 +0100
@@ -373,6 +373,17 @@
         Assert.check(alive || state.stacksize == 0);
     }
 
+    /** Emit a ldc (or ldc_w) instruction, taking into account operand size
+    */
+    public void emitLdc(int od) {
+        if (od <= 255) {
+            emitop1(ldc1, od);
+        }
+        else {
+            emitop2(ldc2, od);
+        }
+    }
+
     /** Emit a multinewarray instruction.
      */
     public void emitMultianewarray(int ndims, int type, Type arrayType) {
--- a/src/share/classes/com/sun/tools/javac/jvm/Gen.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/jvm/Gen.java	Wed May 01 10:47:01 2013 +0100
@@ -2230,7 +2230,7 @@
 
         if (tree.name == names._class) {
             Assert.check(target.hasClassLiterals());
-            code.emitop2(ldc2, makeRef(tree.pos(), tree.selected.type));
+            code.emitLdc(makeRef(tree.pos(), tree.selected.type));
             result = items.makeStackItem(pt);
             return;
        }
--- a/src/share/classes/com/sun/tools/javac/jvm/Items.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/jvm/Items.java	Wed May 01 10:47:01 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -571,10 +571,8 @@
             int idx = pool.put(value);
             if (typecode == LONGcode || typecode == DOUBLEcode) {
                 code.emitop2(ldc2w, idx);
-            } else if (idx <= 255) {
-                code.emitop1(ldc1, idx);
             } else {
-                code.emitop2(ldc2, idx);
+                code.emitLdc(idx);
             }
         }
 
--- a/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java	Wed May 01 10:47:01 2013 +0100
@@ -25,6 +25,7 @@
 
 package com.sun.tools.javac.main;
 
+import com.sun.tools.javac.comp.CompileStates;
 import java.io.*;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -61,6 +62,7 @@
 import com.sun.tools.javac.tree.*;
 import com.sun.tools.javac.tree.JCTree.*;
 import com.sun.tools.javac.util.*;
+import com.sun.tools.javac.comp.CompileStates.CompileState;
 import com.sun.tools.javac.util.Log.WriterKind;
 
 import static com.sun.tools.javac.code.TypeTag.CLASS;
@@ -326,6 +328,8 @@
      **/
     protected boolean implicitSourceFilesRead;
 
+    protected CompileStates compileStates;
+
     /** Construct a new compiler using a shared context.
      */
     public JavaCompiler(Context context) {
@@ -348,6 +352,7 @@
 
         fileManager = context.get(JavaFileManager.class);
         parserFactory = ParserFactory.instance(context);
+        compileStates = CompileStates.instance(context);
 
         try {
             // catch completion problems with predefineds
@@ -521,42 +526,6 @@
      */
     public List<Closeable> closeables = List.nil();
 
-    /** Ordered list of compiler phases for each compilation unit. */
-    public enum CompileState {
-        INIT(0),
-        PARSE(1),
-        ENTER(2),
-        PROCESS(3),
-        ATTR(4),
-        FLOW(5),
-        TRANSTYPES(6),
-        UNLAMBDA(7),
-        LOWER(8),
-        GENERATE(9);
-
-        CompileState(int value) {
-            this.value = value;
-        }
-        boolean isAfter(CompileState other) {
-            return value > other.value;
-        }
-        public static CompileState max(CompileState a, CompileState b) {
-            return a.value > b.value ? a : b;
-        }
-        private final int value;
-    };
-    /** Partial map to record which compiler phases have been executed
-     * for each compilation unit. Used for ATTR and FLOW phases.
-     */
-    protected class CompileStates extends HashMap<Env<AttrContext>,CompileState> {
-        private static final long serialVersionUID = 1812267524140424433L;
-        boolean isDone(Env<AttrContext> env, CompileState cs) {
-            CompileState ecs = get(env);
-            return (ecs != null) && !cs.isAfter(ecs);
-        }
-    }
-    private CompileStates compileStates = new CompileStates();
-
     /** The set of currently compiled inputfiles, needed to ensure
      *  we don't accidentally overwrite an input file when -s is set.
      *  initialized by `compile'.
@@ -1395,13 +1364,17 @@
             @Override
             public void visitClassDef(JCClassDecl node) {
                 Type st = types.supertype(node.sym.type);
-                if (st.hasTag(CLASS)) {
+                boolean envForSuperTypeFound = false;
+                while (!envForSuperTypeFound && st.hasTag(CLASS)) {
                     ClassSymbol c = st.tsym.outermostClass();
                     Env<AttrContext> stEnv = enter.getEnv(c);
                     if (stEnv != null && env != stEnv) {
-                        if (dependencies.add(stEnv))
+                        if (dependencies.add(stEnv)) {
                             scan(stEnv.tree);
+                        }
+                        envForSuperTypeFound = true;
                     }
+                    st = types.supertype(st);
                 }
                 super.visitClassDef(node);
             }
--- a/src/share/classes/com/sun/tools/javac/main/Main.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/main/Main.java	Wed May 01 10:47:01 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -498,6 +498,8 @@
                 if (!(doclintOpts.size() == 1
                         && doclintOpts.iterator().next().equals(DocLint.XMSGS_CUSTOM_PREFIX + "none"))) {
                     JavacTask t = BasicJavacTask.instance(context);
+                    // standard doclet normally generates H1, H2
+                    doclintOpts.add(DocLint.XIMPLICIT_HEADERS + "2");
                     new DocLint().init(t, doclintOpts.toArray(new String[doclintOpts.size()]));
                     comp.keepComments = true;
                 }
--- a/src/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java	Wed May 01 10:47:01 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -770,7 +770,7 @@
     * (which is treated as the beginning of the first line).
     * Stops positioned at the closing '/'.
     */
-    protected class BasicComment<U extends UnicodeReader> implements Comment {
+    protected static class BasicComment<U extends UnicodeReader> implements Comment {
 
         CommentStyle cs;
         U comment_reader;
--- a/src/share/classes/com/sun/tools/javac/parser/JavacParser.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/parser/JavacParser.java	Wed May 01 10:47:01 2013 +0100
@@ -171,8 +171,8 @@
 
     protected AbstractEndPosTable newEndPosTable(boolean keepEndPositions) {
         return  keepEndPositions
-                ? new SimpleEndPosTable()
-                : new EmptyEndPosTable();
+                ? new SimpleEndPosTable(this)
+                : new EmptyEndPosTable(this);
     }
 
     protected DocCommentTable newDocCommentTable(boolean keepDocComments, ParserFactory fac) {
@@ -3088,6 +3088,7 @@
             toplevel.docComments = docComments;
         if (keepLineMap)
             toplevel.lineMap = S.getLineMap();
+        this.endPosTable.setParser(null); // remove reference to parser
         toplevel.endPositions = this.endPosTable;
         return toplevel;
     }
@@ -4003,11 +4004,12 @@
     /*
      * a functional source tree and end position mappings
      */
-    protected class SimpleEndPosTable extends AbstractEndPosTable {
+    protected static class SimpleEndPosTable extends AbstractEndPosTable {
 
         private final Map<JCTree, Integer> endPosMap;
 
-        SimpleEndPosTable() {
+        SimpleEndPosTable(JavacParser parser) {
+            super(parser);
             endPosMap = new HashMap<JCTree, Integer>();
         }
 
@@ -4016,12 +4018,12 @@
         }
 
         protected <T extends JCTree> T to(T t) {
-            storeEnd(t, token.endPos);
+            storeEnd(t, parser.token.endPos);
             return t;
         }
 
         protected <T extends JCTree> T toP(T t) {
-            storeEnd(t, S.prevToken().endPos);
+            storeEnd(t, parser.S.prevToken().endPos);
             return t;
         }
 
@@ -4043,7 +4045,11 @@
     /*
      * a default skeletal implementation without any mapping overhead.
      */
-    protected class EmptyEndPosTable extends AbstractEndPosTable {
+    protected static class EmptyEndPosTable extends AbstractEndPosTable {
+
+        EmptyEndPosTable(JavacParser parser) {
+            super(parser);
+        }
 
         protected void storeEnd(JCTree tree, int endpos) { /* empty */ }
 
@@ -4065,13 +4071,21 @@
 
     }
 
-    protected abstract class AbstractEndPosTable implements EndPosTable {
+    protected static abstract class AbstractEndPosTable implements EndPosTable {
+        /**
+         * The current parser.
+         */
+        protected JavacParser parser;
 
         /**
          * Store the last error position.
          */
         protected int errorEndPos;
 
+        public AbstractEndPosTable(JavacParser parser) {
+            this.parser = parser;
+        }
+
         /**
          * Store ending position for a tree, the value of which is the greater
          * of last error position and the given ending position.
@@ -4106,5 +4120,9 @@
                 errorEndPos = errPos;
             }
         }
+
+        protected void setParser(JavacParser parser) {
+            this.parser = parser;
+        }
     }
 }
--- a/src/share/classes/com/sun/tools/javac/parser/JavadocTokenizer.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/parser/JavadocTokenizer.java	Wed May 01 10:47:01 2013 +0100
@@ -206,7 +206,7 @@
          }
      }
 
-     protected class JavadocComment extends JavaTokenizer.BasicComment<DocReader> {
+     protected static class JavadocComment extends JavaTokenizer.BasicComment<DocReader> {
 
         /**
         * Translated and stripped contents of doc comment
--- a/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java	Wed May 01 10:47:01 2013 +0100
@@ -59,7 +59,6 @@
 import com.sun.tools.javac.jvm.*;
 import com.sun.tools.javac.jvm.ClassReader.BadClassFile;
 import com.sun.tools.javac.main.JavaCompiler;
-import com.sun.tools.javac.main.JavaCompiler.CompileState;
 import com.sun.tools.javac.model.JavacElements;
 import com.sun.tools.javac.model.JavacTypes;
 import com.sun.tools.javac.parser.*;
@@ -79,6 +78,7 @@
 import com.sun.tools.javac.util.Options;
 import static com.sun.tools.javac.code.Lint.LintCategory.PROCESSING;
 import static com.sun.tools.javac.main.Option.*;
+import static com.sun.tools.javac.comp.CompileStates.CompileState;
 import static com.sun.tools.javac.util.JCDiagnostic.DiagnosticFlag.*;
 
 /**
--- a/src/share/classes/com/sun/tools/javac/util/BaseFileManager.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/util/BaseFileManager.java	Wed May 01 10:47:01 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -112,9 +112,8 @@
     protected ClassLoader getClassLoader(URL[] urls) {
         ClassLoader thisClassLoader = getClass().getClassLoader();
 
-        // Bug: 6558476
-        // Ideally, ClassLoader should be Closeable, but before JDK7 it is not.
-        // On older versions, try the following, to get a closeable classloader.
+        // Allow the following to specify a closeable classloader
+        // other than URLClassLoader.
 
         // 1: Allow client to specify the class to use via hidden option
         if (classLoaderClass != null) {
@@ -128,19 +127,6 @@
                 // ignore errors loading user-provided class loader, fall through
             }
         }
-
-        // 2: If URLClassLoader implements Closeable, use that.
-        if (Closeable.class.isAssignableFrom(URLClassLoader.class))
-            return new URLClassLoader(urls, thisClassLoader);
-
-        // 3: Try using private reflection-based CloseableURLClassLoader
-        try {
-            return new CloseableURLClassLoader(urls, thisClassLoader);
-        } catch (Throwable t) {
-            // ignore errors loading workaround class loader, fall through
-        }
-
-        // 4: If all else fails, use plain old standard URLClassLoader
         return new URLClassLoader(urls, thisClassLoader);
     }
 
--- a/src/share/classes/com/sun/tools/javac/util/CloseableURLClassLoader.java	Tue Apr 30 17:01:18 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +0,0 @@
-/*
- * Copyright (c) 2007, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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.
- */
-
-package com.sun.tools.javac.util;
-
-import java.io.Closeable;
-import java.io.IOException;
-import java.lang.reflect.Field;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.ArrayList;
-import java.util.jar.JarFile;
-
-/**
- * A URLClassLoader that also implements Closeable.
- * Reflection is used to access internal data structures in the URLClassLoader,
- * since no public API exists for this purpose. Therefore this code is somewhat
- * fragile. Caveat emptor.
- * @throws Error if the internal data structures are not as expected.
- *
- *  <p><b>This is NOT part of any supported API.
- *  If you write code that depends on this, you do so at your own risk.
- *  This code and its internal interfaces are subject to change or
- *  deletion without notice.</b>
- */
-public class CloseableURLClassLoader
-        extends URLClassLoader implements Closeable {
-    public CloseableURLClassLoader(URL[] urls, ClassLoader parent) throws Error {
-        super(urls, parent);
-        try {
-            getLoaders(); //proactive check that URLClassLoader is as expected
-        } catch (Throwable t) {
-            throw new Error("cannot create CloseableURLClassLoader", t);
-        }
-    }
-
-    /**
-     * Close any jar files that may have been opened by the class loader.
-     * Reflection is used to access the jar files in the URLClassLoader's
-     * internal data structures.
-     * @throws java.io.IOException if the jar files cannot be found for any
-     * reson, or if closing the jar file itself causes an IOException.
-     */
-    @Override
-    public void close() throws IOException {
-        try {
-            for (Object l: getLoaders()) {
-                if (l.getClass().getName().equals("sun.misc.URLClassPath$JarLoader")) {
-                    Field jarField = l.getClass().getDeclaredField("jar");
-                    JarFile jar = (JarFile) getField(l, jarField);
-                    if (jar != null) {
-                        //System.err.println("CloseableURLClassLoader: closing " + jar);
-                        jar.close();
-                    }
-                }
-            }
-        } catch (Throwable t) {
-            IOException e = new IOException("cannot close class loader");
-            e.initCause(t);
-            throw e;
-        }
-    }
-
-    private ArrayList<?> getLoaders()
-            throws NoSuchFieldException, IllegalArgumentException, IllegalAccessException
-    {
-        Field ucpField = URLClassLoader.class.getDeclaredField("ucp");
-        Object urlClassPath = getField(this, ucpField);
-        if (urlClassPath == null)
-            throw new AssertionError("urlClassPath not set in URLClassLoader");
-        Field loadersField = urlClassPath.getClass().getDeclaredField("loaders");
-        return (ArrayList<?>) getField(urlClassPath, loadersField);
-    }
-
-    private Object getField(Object o, Field f)
-            throws IllegalArgumentException, IllegalAccessException {
-        boolean prev = f.isAccessible();
-        try {
-            f.setAccessible(true);
-            return f.get(o);
-        } finally {
-            f.setAccessible(prev);
-        }
-    }
-
-}
--- a/src/share/classes/com/sun/tools/javac/util/Pair.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/util/Pair.java	Wed May 01 10:47:01 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -25,6 +25,8 @@
 
 package com.sun.tools.javac.util;
 
+import java.util.Objects;
+
 /** A generic class for pairs.
  *
  *  <p><b>This is NOT part of any supported API.
@@ -46,15 +48,11 @@
         return "Pair[" + fst + "," + snd + "]";
     }
 
-    private static boolean equals(Object x, Object y) {
-        return (x == null && y == null) || (x != null && x.equals(y));
-    }
-
     public boolean equals(Object other) {
         return
             other instanceof Pair<?,?> &&
-            equals(fst, ((Pair<?,?>)other).fst) &&
-            equals(snd, ((Pair<?,?>)other).snd);
+            Objects.equals(fst, ((Pair<?,?>)other).fst) &&
+            Objects.equals(snd, ((Pair<?,?>)other).snd);
     }
 
     public int hashCode() {
--- a/src/share/classes/com/sun/tools/javadoc/AbstractTypeImpl.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/javadoc/AbstractTypeImpl.java	Wed May 01 10:47:01 2013 +0100
@@ -61,6 +61,10 @@
         return type.tsym.getQualifiedName().toString();
     }
 
+    public com.sun.javadoc.Type getElementType() {
+        return null;
+    }
+
     public String simpleTypeName() {
         return type.tsym.name.toString();
     }
--- a/src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java	Wed May 01 10:47:01 2013 +0100
@@ -108,6 +108,10 @@
         this.tsym = sym;
     }
 
+    public com.sun.javadoc.Type getElementType() {
+        return null;
+    }
+
     /**
      * Returns the flags in terms of javac's flags
      */
--- a/src/share/classes/com/sun/tools/javadoc/DocEnv.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/javadoc/DocEnv.java	Wed May 01 10:47:01 2013 +0100
@@ -810,6 +810,8 @@
 
         JavacTask t = BasicJavacTask.instance(context);
         doclint = new DocLint();
+        // standard doclet normally generates H1, H2
+        doclintOpts.add(DocLint.XIMPLICIT_HEADERS + "2");
         doclint.init(t, doclintOpts.toArray(new String[doclintOpts.size()]), false);
     }
 
--- a/src/share/classes/com/sun/tools/javadoc/ExecutableMemberDocImpl.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/javadoc/ExecutableMemberDocImpl.java	Wed May 01 10:47:01 2013 +0100
@@ -199,22 +199,15 @@
         return result;
     }
 
-    public AnnotationDesc[] receiverAnnotations() {
-        // TODO: change how receiver annotations are output!
+    /**
+     * Get the receiver type of this executable element.
+     *
+     * @return the receiver type of this executable element.
+     * @since 1.8
+     */
+    public com.sun.javadoc.Type receiverType() {
         Type recvtype = sym.type.asMethodType().recvtype;
-        if (recvtype == null) {
-            return new AnnotationDesc[0];
-        }
-        if (!recvtype.isAnnotated()) {
-            return new AnnotationDesc[0];
-        }
-        List<? extends Compound> typeAnnos = ((com.sun.tools.javac.code.Type.AnnotatedType)recvtype).typeAnnotations;
-        AnnotationDesc result[] = new AnnotationDesc[typeAnnos.length()];
-        int i = 0;
-        for (Attribute.Compound a : typeAnnos) {
-            result[i++] = new AnnotationDescImpl(env, a);
-        }
-        return result;
+        return (recvtype != null) ? TypeMaker.getType(env, recvtype, false, true) : null;
     }
 
     /**
--- a/src/share/classes/com/sun/tools/javadoc/PrimitiveType.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/javadoc/PrimitiveType.java	Wed May 01 10:47:01 2013 +0100
@@ -63,6 +63,10 @@
         return name;
     }
 
+    public com.sun.javadoc.Type getElementType() {
+        return null;
+    }
+
     /**
      * Return qualified name of type excluding any dimension information.
      *<p>
--- a/src/share/classes/com/sun/tools/javadoc/TypeMaker.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/com/sun/tools/javadoc/TypeMaker.java	Wed May 01 10:47:01 2013 +0100
@@ -222,6 +222,10 @@
 
         private com.sun.javadoc.Type skipArraysCache = null;
 
+        public com.sun.javadoc.Type getElementType() {
+            return TypeMaker.getType(env, env.types.elemtype(arrayType));
+        }
+
         private com.sun.javadoc.Type skipArrays() {
             if (skipArraysCache == null) {
                 Type t;
--- a/src/share/classes/javax/annotation/processing/AbstractProcessor.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/javax/annotation/processing/AbstractProcessor.java	Wed May 01 10:47:01 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -28,6 +28,7 @@
 import java.util.Set;
 import java.util.HashSet;
 import java.util.Collections;
+import java.util.Objects;
 import javax.lang.model.element.*;
 import javax.lang.model.SourceVersion;
 import javax.tools.Diagnostic;
@@ -146,8 +147,7 @@
     public synchronized void init(ProcessingEnvironment processingEnv) {
         if (initialized)
             throw new IllegalStateException("Cannot call init more than once.");
-        if (processingEnv == null)
-            throw new NullPointerException("Tool provided null ProcessingEnvironment");
+        Objects.requireNonNull(processingEnv, "Tool provided null ProcessingEnvironment");
 
         this.processingEnv = processingEnv;
         initialized = true;
--- a/src/share/classes/javax/lang/model/element/Modifier.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/src/share/classes/javax/lang/model/element/Modifier.java	Wed May 01 10:47:01 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -53,6 +53,11 @@
     /** The modifier {@code protected} */       PROTECTED,
     /** The modifier {@code private} */         PRIVATE,
     /** The modifier {@code abstract} */        ABSTRACT,
+    /**
+     * The modifier {@code default}
+     * @since 1.8
+     */
+     DEFAULT,
     /** The modifier {@code static} */          STATIC,
     /** The modifier {@code final} */           FINAL,
     /** The modifier {@code transient} */       TRANSIENT,
--- a/test/com/sun/javadoc/testAnnotationOptional/TestAnnotationOptional.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/test/com/sun/javadoc/testAnnotationOptional/TestAnnotationOptional.java	Wed May 01 10:47:01 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
--- a/test/com/sun/javadoc/testAnnotationOptional/pkg/AnnotationOptional.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/test/com/sun/javadoc/testAnnotationOptional/pkg/AnnotationOptional.java	Wed May 01 10:47:01 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/javadoc/testTypeAnnotations/TestTypeAnnotations.java	Wed May 01 10:47:01 2013 +0100
@@ -0,0 +1,421 @@
+/*
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug      8005091 8009686
+ * @summary  Make sure that type annotations are displayed correctly
+ * @author   Bhavesh Patel
+ * @library  ../lib/
+ * @build    JavadocTester TestTypeAnnotations
+ * @run main TestTypeAnnotations
+ */
+
+public class TestTypeAnnotations extends JavadocTester {
+
+    //Test information.
+    private static final String BUG_ID = "8005091-8009686";
+
+    //Javadoc arguments.
+    private static final String[] ARGS = new String[] {
+        "-d", BUG_ID, "-sourcepath", SRC_DIR, "-private", "typeannos"
+    };
+
+    //Input for string search tests.
+    private static final String[][] NEGATED_TEST = NO_TEST;
+    private static final String[][] TEST = {
+        // Test for type annotations on Class Extends (ClassExtends.java).
+        /* @ignore 8012173
+        {BUG_ID + FS + "typeannos" + FS + "MyClass.html",
+            "extends <a href=\"../typeannos/ClassExtA.html\" title=\"annotation " +
+            "in typeannos\">@ClassExtA</a> <a href=\"../typeannos/ParameterizedClass.html\" " +
+            "title=\"class in typeannos\">ParameterizedClass</a>&lt;<a href=\"" +
+            "../typeannos/ClassExtB.html\" title=\"annotation in typeannos\">" +
+            "@ClassExtB</a> java.lang.String&gt;"
+        },
+        */
+        /* @ignore 8012173
+        {BUG_ID + FS + "typeannos" + FS + "MyClass.html",
+            "implements <a href=\"../typeannos/ClassExtB.html\" title=\"" +
+            "annotation in typeannos\">@ClassExtB</a> java.lang.CharSequence, " +
+            "<a href=\"../typeannos/ClassExtA.html\" title=\"annotation in " +
+            "typeannos\">@ClassExtA</a> <a href=\"../typeannos/ParameterizedInterface.html\" " +
+            "title=\"interface in typeannos\">ParameterizedInterface</a>&lt;" +
+            "<a href=\"../typeannos/ClassExtB.html\" title=\"annotation in " +
+            "typeannos\">@ClassExtB</a> java.lang.String&gt;</pre>"
+        },
+        */
+        /* @ignore 8012173
+        {BUG_ID + FS + "typeannos" + FS + "MyInterface.html",
+            "extends <a href=\"../typeannos/ClassExtA.html\" title=\"annotation " +
+            "in typeannos\">@ClassExtA</a> <a href=\"../typeannos/" +
+            "ParameterizedInterface.html\" title=\"interface in typeannos\">" +
+            "ParameterizedInterface</a>&lt;<a href=\"../typeannos/ClassExtA.html\" " +
+            "title=\"annotation in typeannos\">@ClassExtA</a> java.lang.String&gt;, " +
+            "<a href=\"../typeannos/ClassExtB.html\" title=\"annotation in " +
+            "typeannos\">@ClassExtB</a> java.lang.CharSequence</pre>"
+        },
+        */
+
+        // Test for type annotations on Class Parameters (ClassParameters.java).
+        {BUG_ID + FS + "typeannos" + FS + "ExtendsBound.html",
+            "class <span class=\"strong\">ExtendsBound&lt;K extends <a " +
+            "href=\"../typeannos/ClassParamA.html\" title=\"annotation in " +
+            "typeannos\">@ClassParamA</a> java.lang.String&gt;</span>"
+        },
+        /* @ignore 8012173
+        {BUG_ID + FS + "typeannos" + FS + "ExtendsGeneric.html",
+            "<pre> class <span class=\"strong\">ExtendsGeneric&lt;K extends " +
+            "<a href=\"../typeannos/ClassParamA.html\" title=\"annotation in " +
+            "typeannos\">@ClassParamA</a> <a href=\"../typeannos/Unannotated.html\" " +
+            "title=\"class in typeannos\">Unannotated</a>&lt;<a href=\"" +
+            "../typeannos/ClassParamB.html\" title=\"annotation in typeannos\">" +
+            "@ClassParamB</a> java.lang.String&gt;&gt;</span>"
+        },
+        */
+        {BUG_ID + FS + "typeannos" + FS + "TwoBounds.html",
+            "<pre> class <span class=\"strong\">TwoBounds&lt;K extends <a href=\"" +
+            "../typeannos/ClassParamA.html\" title=\"annotation in typeannos\">" +
+            "@ClassParamA</a> java.lang.String,V extends <a href=\"../typeannos/" +
+            "ClassParamB.html\" title=\"annotation in typeannos\">@ClassParamB" +
+            "</a> java.lang.String&gt;</span>"
+        },
+        {BUG_ID + FS + "typeannos" + FS + "Complex1.html",
+            "class <span class=\"strong\">Complex1&lt;K extends <a href=\"../" +
+            "typeannos/ClassParamA.html\" title=\"annotation in typeannos\">" +
+            "@ClassParamA</a> java.lang.String & java.lang.Runnable&gt;</span>"
+        },
+        {BUG_ID + FS + "typeannos" + FS + "Complex2.html",
+            "class <span class=\"strong\">Complex2&lt;K extends java.lang." +
+            "String & <a href=\"../typeannos/ClassParamB.html\" title=\"" +
+            "annotation in typeannos\">@ClassParamB</a> java.lang.Runnable&gt;</span>"
+        },
+        {BUG_ID + FS + "typeannos" + FS + "ComplexBoth.html",
+            "class <span class=\"strong\">ComplexBoth&lt;K extends <a href=\"" +
+            "../typeannos/ClassParamA.html\" title=\"annotation in typeannos\"" +
+            ">@ClassParamA</a> java.lang.String & <a href=\"../typeannos/" +
+            "ClassParamA.html\" title=\"annotation in typeannos\">@ClassParamA" +
+            "</a> java.lang.Runnable&gt;</span>"
+        },
+
+        // Test for type annotations on fields (Fields.java).
+        /* @ignore 8012173
+        {BUG_ID + FS + "typeannos" + FS + "DefaultScope.html",
+            "<pre><a href=\"../typeannos/Parameterized.html\" title=\"class in " +
+            "typeannos\">Parameterized</a>&lt;<a href=\"../typeannos/FldA.html\" " +
+            "title=\"annotation in typeannos\">@FldA</a> java.lang.String,<a " +
+            "href=\"../typeannos/FldB.html\" title=\"annotation in typeannos\">" +
+            "@FldB</a> java.lang.String&gt; bothTypeArgs</pre>"
+        },
+        */
+        {BUG_ID + FS + "typeannos" + FS + "DefaultScope.html",
+            "<pre><a href=\"../typeannos/FldA.html\" title=\"annotation in " +
+            "typeannos\">@FldA</a> java.lang.String <a href=\"../typeannos/" +
+            "FldB.html\" title=\"annotation in typeannos\">@FldB</a> [] " +
+            "array1Deep</pre>"
+        },
+        {BUG_ID + FS + "typeannos" + FS + "DefaultScope.html",
+            "<pre>java.lang.String[] <a href=\"../typeannos/FldB.html\" " +
+            "title=\"annotation in typeannos\">@FldB</a> [] array2SecondOld</pre>"
+        },
+        {BUG_ID + FS + "typeannos" + FS + "DefaultScope.html",
+            "<pre><a href=\"../typeannos/FldD.html\" title=\"annotation in " +
+            "typeannos\">@FldD</a> java.lang.String <a href=\"../typeannos/" +
+            "FldC.html\" title=\"annotation in typeannos\">@FldC</a> <a href=\"" +
+            "../typeannos/FldA.html\" title=\"annotation in typeannos\">@FldA" +
+            "</a> [] <a href=\"../typeannos/FldC.html\" title=\"annotation in " +
+            "typeannos\">@FldC</a> <a href=\"../typeannos/FldB.html\" title=\"" +
+            "annotation in typeannos\">@FldB</a> [] array2Deep</pre>"
+        },
+        /* @ignore 8012173
+        {BUG_ID + FS + "typeannos" + FS + "ModifiedScoped.html",
+            "<pre>public final&nbsp;<a href=\"../typeannos/Parameterized.html\" " +
+            "title=\"class in typeannos\">Parameterized</a>&lt;<a href=\"../" +
+            "typeannos/FldA.html\" title=\"annotation in typeannos\">@FldA</a> " +
+            "<a href=\"../typeannos/Parameterized.html\" title=\"class in " +
+            "typeannos\">Parameterized</a>&lt;<a href=\"../typeannos/FldA.html\" " +
+            "title=\"annotation in typeannos\">@FldA</a> java.lang.String,<a " +
+            "href=\"../typeannos/FldB.html\" title=\"annotation in typeannos\">" +
+            "@FldB</a> java.lang.String&gt;,<a href=\"../typeannos/FldB.html\" " +
+            "title=\"annotation in typeannos\">@FldB</a> java.lang.String&gt; " +
+            "nestedParameterized</pre>"
+        },
+        */
+        {BUG_ID + FS + "typeannos" + FS + "ModifiedScoped.html",
+            "<pre>public final&nbsp;<a href=\"../typeannos/FldA.html\" " +
+            "title=\"annotation in typeannos\">@FldA</a> java.lang.String[][] " +
+            "array2</pre>"
+        },
+
+        // Test for type annotations on method return types (MethodReturnType.java).
+        {BUG_ID + FS + "typeannos" + FS + "MtdDefaultScope.html",
+            "<pre>public&nbsp;&lt;T&gt;&nbsp;<a href=\"../typeannos/MRtnA.html\" " +
+            "title=\"annotation in typeannos\">@MRtnA</a> java.lang.String" +
+            "&nbsp;method()</pre>"
+        },
+        {BUG_ID + FS + "typeannos" + FS + "MtdDefaultScope.html",
+            "<pre><a href=\"../typeannos/MRtnA.html\" title=\"annotation in " +
+            "typeannos\">@MRtnA</a> java.lang.String <a href=\"../typeannos/" +
+            "MRtnA.html\" title=\"annotation in typeannos\">@MRtnA</a> [] <a " +
+            "href=\"../typeannos/MRtnB.html\" title=\"annotation in typeannos\">" +
+            "@MRtnB</a> []&nbsp;array2Deep()</pre>"
+        },
+        {BUG_ID + FS + "typeannos" + FS + "MtdDefaultScope.html",
+            "<pre><a href=\"../typeannos/MRtnA.html\" title=\"annotation in " +
+            "typeannos\">@MRtnA</a> java.lang.String[][]&nbsp;array2()</pre>"
+        },
+        /* @ignore 8012173
+        {BUG_ID + FS + "typeannos" + FS + "MtdModifiedScoped.html",
+            "<pre>public final&nbsp;<a href=\"../typeannos/MtdParameterized.html\" " +
+            "title=\"class in typeannos\">MtdParameterized</a>&lt;<a href=\"../" +
+            "typeannos/MRtnA.html\" title=\"annotation in typeannos\">@MRtnA</a> " +
+            "<a href=\"../typeannos/MtdParameterized.html\" title=\"class in " +
+            "typeannos\">MtdParameterized</a>&lt;<a href=\"../typeannos/MRtnA." +
+            "html\" title=\"annotation in typeannos\">@MRtnA</a> java.lang." +
+            "String,<a href=\"../typeannos/MRtnB.html\" title=\"annotation in " +
+            "typeannos\">@MRtnB</a> java.lang.String&gt;,<a href=\"../typeannos/" +
+            "MRtnB.html\" title=\"annotation in typeannos\">@MRtnB</a> java." +
+            "lang.String&gt;&nbsp;nestedMtdParameterized()</pre>"
+        },
+        */
+
+        // Test for type annotations on method type parameters (MethodTypeParameters.java).
+        {BUG_ID + FS + "typeannos" + FS + "UnscopedUnmodified.html",
+            "<pre>&lt;K extends <a href=\"../typeannos/MTyParamA.html\" title=\"" +
+            "annotation in typeannos\">@MTyParamA</a> java.lang.String&gt;" +
+            "&nbsp;void&nbsp;methodExtends()</pre>"
+        },
+        /* @ignore 8012173
+        {BUG_ID + FS + "typeannos" + FS + "UnscopedUnmodified.html",
+            "<pre>&lt;K extends <a href=\"../typeannos/MTyParamA.html\" title=\"" +
+            "annotation in typeannos\">@MTyParamA</a> <a href=\"../typeannos/" +
+            "MtdTyParameterized.html\" title=\"class in typeannos\">" +
+            "MtdTyParameterized</a>&lt;<a href=\"../typeannos/MTyParamB.html\" " +
+            "title=\"annotation in typeannos\">@MTyParamB</a> java.lang.String" +
+            "&gt;&gt;&nbsp;void&nbsp;nestedExtends()</pre>"
+        },
+        */
+        {BUG_ID + FS + "typeannos" + FS + "PublicModifiedMethods.html",
+            "<pre>public final&nbsp;&lt;K extends <a href=\"../typeannos/" +
+            "MTyParamA.html\" title=\"annotation in typeannos\">@MTyParamA</a> " +
+            "java.lang.String&gt;&nbsp;void&nbsp;methodExtends()</pre>"
+        },
+        /* @ignore 8012173
+        {BUG_ID + FS + "typeannos" + FS + "PublicModifiedMethods.html",
+            "<pre>public final&nbsp;&lt;K extends <a href=\"../typeannos/" +
+            "MTyParamA.html\" title=\"annotation in typeannos\">@MTyParamA</a> " +
+            "java.lang.String,V extends <a href=\"../typeannos/MTyParamA.html\" " +
+            "title=\"annotation in typeannos\">@MTyParamA</a> <a href=\"../" +
+            "typeannos/MtdTyParameterized.html\" title=\"class in typeannos\">" +
+            "MtdTyParameterized</a>&lt;<a href=\"../typeannos/MTyParamB.html\" " +
+            "title=\"annotation in typeannos\">@MTyParamB</a> java.lang.String" +
+            "&gt;&gt;&nbsp;void&nbsp;dual()</pre>"
+        },
+        */
+
+        // Test for type annotations on parameters (Parameters.java).
+        {BUG_ID + FS + "typeannos" + FS + "Parameters.html",
+            "<pre>void&nbsp;unannotated(<a href=\"../typeannos/" +
+            "ParaParameterized.html\" title=\"class in typeannos\">" +
+            "ParaParameterized</a>&lt;java.lang.String,java.lang.String&gt;" +
+            "&nbsp;a)</pre>"
+        },
+        /* @ignore 8012173
+        {BUG_ID + FS + "typeannos" + FS + "Parameters.html",
+            "<pre>void&nbsp;nestedParaParameterized(<a href=\"../typeannos/" +
+            "ParaParameterized.html\" title=\"class in typeannos\">" +
+            "ParaParameterized</a>&lt;<a href=\"../typeannos/ParamA.html\" " +
+            "title=\"annotation in typeannos\">@ParamA</a> <a href=\"../" +
+            "typeannos/ParaParameterized.html\" title=\"class in typeannos\">" +
+            "ParaParameterized</a>&lt;<a href=\"../typeannos/ParamA.html\" " +
+            "title=\"annotation in typeannos\">@ParamA</a> java.lang.String," +
+            "<a href=\"../typeannos/ParamB.html\" title=\"annotation in " +
+            "typeannos\">@ParamB</a> java.lang.String&gt;,<a href=\"../" +
+            "typeannos/ParamB.html\" title=\"annotation in typeannos\">@ParamB" +
+            "</a> java.lang.String&gt;&nbsp;a)</pre>"
+        },
+        */
+        {BUG_ID + FS + "typeannos" + FS + "Parameters.html",
+            "<pre>void&nbsp;array2Deep(<a href=\"../typeannos/ParamA.html\" " +
+            "title=\"annotation in typeannos\">@ParamA</a> java.lang.String " +
+            "<a href=\"../typeannos/ParamA.html\" title=\"annotation in " +
+            "typeannos\">@ParamA</a> [] <a href=\"../typeannos/ParamB.html\" " +
+            "title=\"annotation in typeannos\">@ParamB</a> []&nbsp;a)</pre>"
+        },
+
+        // Test for type annotations on throws (Throws.java).
+        {BUG_ID + FS + "typeannos" + FS + "ThrDefaultUnmodified.html",
+            "<pre>void&nbsp;oneException()" + NL +
+            "            throws <a href=\"../typeannos/ThrA.html\" title=\"" +
+            "annotation in typeannos\">@ThrA</a> java.lang.Exception</pre>"
+        },
+        {BUG_ID + FS + "typeannos" + FS + "ThrDefaultUnmodified.html",
+            "<pre>void&nbsp;twoExceptions()" + NL +
+            "             throws <a href=\"../typeannos/ThrA.html\" title=\"" +
+            "annotation in typeannos\">@ThrA</a> java.lang.RuntimeException," + NL +
+            "                    <a href=\"../typeannos/ThrA.html\" title=\"" +
+            "annotation in typeannos\">@ThrA</a> java.lang.Exception</pre>"
+        },
+        {BUG_ID + FS + "typeannos" + FS + "ThrPublicModified.html",
+            "<pre>public final&nbsp;void&nbsp;oneException(java.lang.String&nbsp;a)" + NL +
+            "                        throws <a href=\"../typeannos/ThrA.html\" " +
+            "title=\"annotation in typeannos\">@ThrA</a> java.lang.Exception</pre>"
+        },
+        {BUG_ID + FS + "typeannos" + FS + "ThrPublicModified.html",
+            "<pre>public final&nbsp;void&nbsp;twoExceptions(java.lang.String&nbsp;a)" + NL +
+            "                         throws <a href=\"../typeannos/ThrA.html\" " +
+            "title=\"annotation in typeannos\">@ThrA</a> java.lang.RuntimeException," + NL +
+            "                                <a href=\"../typeannos/ThrA.html\" " +
+            "title=\"annotation in typeannos\">@ThrA</a> java.lang.Exception</pre>"
+        },
+        {BUG_ID + FS + "typeannos" + FS + "ThrWithValue.html",
+            "<pre>void&nbsp;oneException()" + NL +
+            "            throws <a href=\"../typeannos/ThrB.html\" title=\"" +
+            "annotation in typeannos\">@ThrB</a>(<a href=\"../typeannos/" +
+            "ThrB.html#value()\">value</a>=\"m\") java.lang.Exception</pre>"
+        },
+        {BUG_ID + FS + "typeannos" + FS + "ThrWithValue.html",
+            "<pre>void&nbsp;twoExceptions()" + NL +
+            "             throws <a href=\"../typeannos/ThrB.html\" title=\"" +
+            "annotation in typeannos\">@ThrB</a>(<a href=\"../typeannos/" +
+            "ThrB.html#value()\">value</a>=\"m\") java.lang.RuntimeException," + NL +
+            "                    <a href=\"../typeannos/ThrA.html\" title=\"" +
+            "annotation in typeannos\">@ThrA</a> java.lang.Exception</pre>"
+        },
+
+        // Test for type annotations on type parameters (TypeParameters.java).
+        {BUG_ID + FS + "typeannos" + FS + "TestMethods.html",
+            "<pre>&lt;K,V extends <a href=\"../typeannos/TyParaA.html\" title=\"" +
+            "annotation in typeannos\">@TyParaA</a> java.lang.String&gt;&nbsp;" +
+            "void&nbsp;secondAnnotated()</pre>"
+        },
+
+        // Test for type annotations on wildcard type (Wildcards.java).
+        {BUG_ID + FS + "typeannos" + FS + "BoundTest.html",
+            "<pre>void&nbsp;wcExtends(<a href=\"../typeannos/MyList.html\" " +
+            "title=\"class in typeannos\">MyList</a>&lt;? extends <a href=\"" +
+            "../typeannos/WldA.html\" title=\"annotation in typeannos\">@WldA" +
+            "</a> java.lang.String&gt;&nbsp;l)</pre>"
+        },
+        {BUG_ID + FS + "typeannos" + FS + "BoundTest.html",
+            "<pre><a href=\"../typeannos/MyList.html\" title=\"class in " +
+            "typeannos\">MyList</a>&lt;? super <a href=\"../typeannos/WldA.html\" " +
+            "title=\"annotation in typeannos\">@WldA</a> java.lang.String&gt;" +
+            "&nbsp;returnWcSuper()</pre>"
+        },
+        {BUG_ID + FS + "typeannos" + FS + "BoundWithValue.html",
+            "<pre>void&nbsp;wcSuper(<a href=\"../typeannos/MyList.html\" title=\"" +
+            "class in typeannos\">MyList</a>&lt;? super <a href=\"../typeannos/" +
+            "WldB.html\" title=\"annotation in typeannos\">@WldB</a>(<a href=\"" +
+            "../typeannos/WldB.html#value()\">value</a>=\"m\") java.lang." +
+            "String&gt;&nbsp;l)</pre>"
+        },
+        {BUG_ID + FS + "typeannos" + FS + "BoundWithValue.html",
+            "<pre><a href=\"../typeannos/MyList.html\" title=\"class in " +
+            "typeannos\">MyList</a>&lt;? extends <a href=\"../typeannos/WldB." +
+            "html\" title=\"annotation in typeannos\">@WldB</a>(<a href=\"../" +
+            "typeannos/WldB.html#value()\">value</a>=\"m\") java.lang.String" +
+            "&gt;&nbsp;returnWcExtends()</pre>"
+        },
+
+        // Test for receiver annotations (Receivers.java).
+        {BUG_ID + FS + "typeannos" + FS + "DefaultUnmodified.html",
+            "<pre>void&nbsp;withException(<a href=\"../typeannos/RcvrA.html\" " +
+            "title=\"annotation in typeannos\">@RcvrA</a>&nbsp;" +
+            "DefaultUnmodified&nbsp;this)" + NL + "             throws java." +
+            "lang.Exception</pre>"
+        },
+        {BUG_ID + FS + "typeannos" + FS + "DefaultUnmodified.html",
+            "<pre>java.lang.String&nbsp;nonVoid(<a href=\"../typeannos/RcvrA." +
+            "html\" title=\"annotation in typeannos\">@RcvrA</a> <a href=\"../" +
+            "typeannos/RcvrB.html\" title=\"annotation in typeannos\">@RcvrB" +
+            "</a>(<a href=\"../typeannos/RcvrB.html#value()\">value</a>=\"m\")" +
+            "&nbsp;DefaultUnmodified&nbsp;this)</pre>"
+        },
+        {BUG_ID + FS + "typeannos" + FS + "DefaultUnmodified.html",
+            "<pre>&lt;T extends java.lang.Runnable&gt;&nbsp;void&nbsp;accept(" +
+            "<a href=\"../typeannos/RcvrA.html\" title=\"annotation in " +
+            "typeannos\">@RcvrA</a>&nbsp;DefaultUnmodified&nbsp;this," + NL +
+            "                                         T&nbsp;r)" + NL +
+            "      throws java.lang.Exception</pre>"
+        },
+        {BUG_ID + FS + "typeannos" + FS + "PublicModified.html",
+            "<pre>public final&nbsp;java.lang.String&nbsp;nonVoid(<a href=\"" +
+            "../typeannos/RcvrA.html\" title=\"annotation in typeannos\">" +
+            "@RcvrA</a>&nbsp;PublicModified&nbsp;this)</pre>"
+        },
+        {BUG_ID + FS + "typeannos" + FS + "PublicModified.html",
+            "<pre>public final&nbsp;&lt;T extends java.lang.Runnable&gt;&nbsp;" +
+            "void&nbsp;accept(<a href=\"../typeannos/RcvrA.html\" title=\"" +
+            "annotation in typeannos\">@RcvrA</a>&nbsp;PublicModified&nbsp;this," + NL +
+            "                                         T&nbsp;r)" + NL +
+            "                  throws java.lang.Exception</pre>"
+        },
+        {BUG_ID + FS + "typeannos" + FS + "WithValue.html",
+            "<pre>&lt;T extends java.lang.Runnable&gt;&nbsp;void&nbsp;accept(" +
+            "<a href=\"../typeannos/RcvrB.html\" title=\"annotation in " +
+            "typeannos\">@RcvrB</a>(<a href=\"../typeannos/RcvrB.html#value()\">" +
+            "value</a>=\"m\")&nbsp;WithValue&nbsp;this," + NL +
+            "                                         T&nbsp;r)" + NL +
+            "      throws java.lang.Exception</pre>"
+        },
+        {BUG_ID + FS + "typeannos" + FS + "WithFinal.html",
+            "<pre>java.lang.String&nbsp;nonVoid(<a href=\"../typeannos/RcvrB." +
+            "html\" title=\"annotation in typeannos\">@RcvrB</a>(<a href=\"../" +
+            "typeannos/RcvrB.html#value()\">value</a>=\"m\")&nbsp;WithFinal" +
+            "&nbsp;this)</pre>"
+        },
+        {BUG_ID + FS + "typeannos" + FS + "WithBody.html",
+            "<pre>void&nbsp;field(<a href=\"../typeannos/RcvrA.html\" title=\"" +
+            "annotation in typeannos\">@RcvrA</a>&nbsp;WithBody&nbsp;this)</pre>"
+        },
+        {BUG_ID + FS + "typeannos" + FS + "Generic2.html",
+            "<pre>void&nbsp;test2(<a href=\"../typeannos/RcvrA.html\" title=\"" +
+            "annotation in typeannos\">@RcvrA</a>&nbsp;Generic2&lt;X&gt;&nbsp;this)</pre>"
+        }
+    };
+
+    /**
+     * The entry point of the test.
+     * @param args the array of command line arguments.
+     */
+    public static void main(String[] args) {
+        TestTypeAnnotations tester = new TestTypeAnnotations();
+        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.printSummary();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getBugId() {
+        return BUG_ID;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getBugName() {
+        return getClass().getName();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/javadoc/testTypeAnnotations/typeannos/ClassExtends.java	Wed May 01 10:47:01 2013 +0100
@@ -0,0 +1,45 @@
+/*
+ * 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.
+ */
+
+package typeannos;
+
+import java.lang.annotation.*;
+
+/*
+ * This class is replicated from test/tools/javac/annotations/typeAnnotations/newlocations.
+ */
+abstract class MyClass extends @ClassExtA ParameterizedClass<@ClassExtB String>
+  implements @ClassExtB CharSequence, @ClassExtA ParameterizedInterface<@ClassExtB String> { }
+
+interface MyInterface extends @ClassExtA ParameterizedInterface<@ClassExtA String>,
+                              @ClassExtB CharSequence { }
+
+class ParameterizedClass<K> {}
+interface ParameterizedInterface<K> {}
+
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface ClassExtA {}
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface ClassExtB {}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/javadoc/testTypeAnnotations/typeannos/ClassParameters.java	Wed May 01 10:47:01 2013 +0100
@@ -0,0 +1,60 @@
+/*
+ * 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.
+ */
+
+package typeannos;
+
+import java.lang.annotation.*;
+
+/*
+ * This class is replicated from test/tools/javac/annotations/typeAnnotations/newlocations.
+ */
+class Unannotated<K> { }
+
+class ExtendsBound<K extends @ClassParamA String> { }
+class ExtendsGeneric<K extends @ClassParamA Unannotated<@ClassParamB String>> { }
+class TwoBounds<K extends @ClassParamA String, V extends @ClassParamB String> { }
+
+class Complex1<K extends @ClassParamA String&Runnable> { }
+class Complex2<K extends String & @ClassParamB Runnable> { }
+class ComplexBoth<K extends @ClassParamA String & @ClassParamA Runnable> { }
+
+class ClassParamOuter {
+    void inner() {
+        class LUnannotated<K> { }
+
+        class LExtendsBound<K extends @ClassParamA String> { }
+        class LExtendsGeneric<K extends @ClassParamA LUnannotated<@ClassParamB String>> { }
+        class LTwoBounds<K extends @ClassParamA String, V extends @ClassParamB String> { }
+
+        class LComplex1<K extends @ClassParamA String&Runnable> { }
+        class LComplex2<K extends String & @ClassParamB Runnable> { }
+        class LComplexBoth<K extends @ClassParamA String & @ClassParamA Runnable> { }
+    }
+}
+
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface ClassParamA { }
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface ClassParamB { }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/javadoc/testTypeAnnotations/typeannos/Fields.java	Wed May 01 10:47:01 2013 +0100
@@ -0,0 +1,82 @@
+/*
+ * 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.
+ */
+
+package typeannos;
+
+import java.lang.annotation.*;
+
+/*
+ * This class is replicated from test/tools/javac/annotations/typeAnnotations/newlocations.
+ */
+class DefaultScope {
+    Parameterized<String, String> unannotated;
+    Parameterized<@FldA String, String> firstTypeArg;
+    Parameterized<String, @FldA String> secondTypeArg;
+    Parameterized<@FldA String, @FldB String> bothTypeArgs;
+
+    Parameterized<@FldA Parameterized<@FldA String, @FldB String>, @FldB String>
+    nestedParameterized;
+
+    @FldA String [] array1;
+    @FldA String @FldB [] array1Deep;
+    @FldA String [] [] array2;
+    @FldD String @FldC @FldA [] @FldC @FldB [] array2Deep;
+    String @FldA [] [] array2First;
+    String [] @FldB [] array2Second;
+
+    // Old-style array syntax
+    String array2FirstOld @FldA [];
+    String array2SecondOld [] @FldB [];
+}
+
+class ModifiedScoped {
+    public final Parameterized<String, String> unannotated = null;
+    public final Parameterized<@FldA String, String> firstTypeArg = null;
+    public final Parameterized<String, @FldA String> secondTypeArg = null;
+    public final Parameterized<@FldA String, @FldB String> bothTypeArgs = null;
+
+    public final Parameterized<@FldA Parameterized<@FldA String, @FldB String>, @FldB String>
+    nestedParameterized = null;
+
+    public final @FldA String [] array1 = null;
+    public final @FldA String @FldB [] array1Deep = null;
+    public final @FldA String [] [] array2 = null;
+    public final @FldA String @FldA [] @FldB [] array2Deep = null;
+    public final String @FldA [] [] array2First = null;
+    public final String [] @FldB [] array2Second = null;
+}
+
+class Parameterized<K, V> { }
+
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface FldA { }
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface FldB { }
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface FldC { }
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface FldD { }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/javadoc/testTypeAnnotations/typeannos/MethodReturnType.java	Wed May 01 10:47:01 2013 +0100
@@ -0,0 +1,78 @@
+/*
+ * 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.
+ */
+
+package typeannos;
+
+import java.lang.annotation.*;
+
+/*
+ * This class is replicated from test/tools/javac/annotations/typeAnnotations/newlocations.
+ */
+class MtdDefaultScope {
+    MtdParameterized<String, String> unannotated() { return null; }
+    MtdParameterized<@MRtnA String, String> firstTypeArg() { return null; }
+    MtdParameterized<String, @MRtnA String> secondTypeArg() { return null; }
+    MtdParameterized<@MRtnA String, @MRtnB String> bothTypeArgs() { return null; }
+
+    MtdParameterized<@MRtnA MtdParameterized<@MRtnA String, @MRtnB String>, @MRtnB String>
+    nestedMtdParameterized() { return null; }
+
+    public <T> @MRtnA String method() { return null; }
+
+    @MRtnA String [] array1() { return null; }
+    @MRtnA String @MRtnB [] array1Deep() { return null; }
+    @MRtnA String [] [] array2() { return null; }
+    @MRtnA String @MRtnA [] @MRtnB [] array2Deep() { return null; }
+    String @MRtnA [] [] array2First() { return null; }
+    String [] @MRtnB [] array2Second() { return null; }
+
+    // Old-style array syntax
+    String array2FirstOld() @MRtnA [] { return null; }
+    String array2SecondOld() [] @MRtnB [] { return null; }
+}
+
+class MtdModifiedScoped {
+    public final MtdParameterized<String, String> unannotated() { return null; }
+    public final MtdParameterized<@MRtnA String, String> firstTypeArg() { return null; }
+    public final MtdParameterized<String, @MRtnA String> secondTypeArg() { return null; }
+    public final MtdParameterized<@MRtnA String, @MRtnB String> bothTypeArgs() { return null; }
+
+    public final MtdParameterized<@MRtnA MtdParameterized<@MRtnA String, @MRtnB String>, @MRtnB String>
+    nestedMtdParameterized() { return null; }
+
+    public final @MRtnA String [] array1() { return null; }
+    public final @MRtnA String @MRtnB [] array1Deep() { return null; }
+    public final @MRtnA String [] [] array2() { return null; }
+    public final @MRtnA String @MRtnA [] @MRtnB [] array2Deep() { return null; }
+    public final String @MRtnA [] [] array2First() { return null; }
+    public final String [] @MRtnB [] array2Second() { return null; }
+}
+
+class MtdParameterized<K, V> { }
+
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface MRtnA { }
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface MRtnB { }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/javadoc/testTypeAnnotations/typeannos/MethodTypeParameters.java	Wed May 01 10:47:01 2013 +0100
@@ -0,0 +1,52 @@
+/*
+ * 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.
+ */
+
+package typeannos;
+
+import java.lang.annotation.*;
+
+/*
+ * This class is replicated from test/tools/javac/annotations/typeAnnotations/newlocations.
+ */
+class UnscopedUnmodified {
+    <K extends @MTyParamA String> void methodExtends() {}
+    <K extends @MTyParamA MtdTyParameterized<@MTyParamB String>> void nestedExtends() {}
+    <K extends @MTyParamA String, V extends @MTyParamA MtdTyParameterized<@MTyParamB String>> void dual() {}
+    <K extends String, V extends MtdTyParameterized<@MTyParamB String>> void dualOneAnno() {}
+}
+
+class PublicModifiedMethods {
+    public final <K extends @MTyParamA String> void methodExtends() {}
+    public final <K extends @MTyParamA MtdTyParameterized<@MTyParamB String>> void nestedExtends() {}
+    public final <K extends @MTyParamA String, V extends @MTyParamA MtdTyParameterized<@MTyParamB String>> void dual() {}
+    public final <K extends String, V extends MtdTyParameterized<@MTyParamB String>> void dualOneAnno() {}
+}
+
+class MtdTyParameterized<K> { }
+
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface MTyParamA { }
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface MTyParamB { }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/javadoc/testTypeAnnotations/typeannos/Parameters.java	Wed May 01 10:47:01 2013 +0100
@@ -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.
+ */
+
+package typeannos;
+
+import java.lang.annotation.*;
+
+/*
+ * This class is replicated from test/tools/javac/annotations/typeAnnotations/newlocations.
+ */
+class Parameters {
+    void unannotated(ParaParameterized<String, String> a) {}
+    void firstTypeArg(ParaParameterized<@ParamA String, String> a) {}
+    void secondTypeArg(ParaParameterized<String, @ParamA String> a) {}
+    void bothTypeArgs(ParaParameterized<@ParamA String, @ParamB String> both) {}
+
+    void nestedParaParameterized(ParaParameterized<@ParamA ParaParameterized<@ParamA String, @ParamB String>, @ParamB String> a) {}
+
+    void array1(@ParamA String [] a) {}
+    void array1Deep(@ParamA String @ParamB [] a) {}
+    void array2(@ParamA String [] [] a) {}
+    void array2Deep(@ParamA String @ParamA [] @ParamB [] a) {}
+    void array2First(String @ParamA [] [] a) {}
+    void array2Second(String [] @ParamB [] a) {}
+}
+
+class ParaParameterized<K, V> { }
+
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface ParamA { }
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface ParamB { }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/javadoc/testTypeAnnotations/typeannos/Receivers.java	Wed May 01 10:47:01 2013 +0100
@@ -0,0 +1,131 @@
+/*
+ * 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.
+ */
+
+package typeannos;
+
+import java.lang.annotation.*;
+
+/*
+ * This class is replicated from test/tools/javac/annotations/typeAnnotations/newlocations.
+ */
+class DefaultUnmodified {
+    void plain(@RcvrA DefaultUnmodified this) { }
+    <T> void generic(@RcvrA DefaultUnmodified this) { }
+    void withException(@RcvrA DefaultUnmodified this) throws Exception { }
+    String nonVoid(@RcvrA @RcvrB("m") DefaultUnmodified this) { return null; }
+    <T extends Runnable> void accept(@RcvrA DefaultUnmodified this, T r) throws Exception { }
+}
+
+class PublicModified {
+    public final void plain(@RcvrA PublicModified this) { }
+    public final <T> void generic(@RcvrA PublicModified this) { }
+    public final void withException(@RcvrA PublicModified this) throws Exception { }
+    public final String nonVoid(@RcvrA PublicModified this) { return null; }
+    public final <T extends Runnable> void accept(@RcvrA PublicModified this, T r) throws Exception { }
+}
+
+class WithValue {
+    void plain(@RcvrB("m") WithValue this) { }
+    <T> void generic(@RcvrB("m") WithValue this) { }
+    void withException(@RcvrB("m") WithValue this) throws Exception { }
+    String nonVoid(@RcvrB("m") WithValue this) { return null; }
+    <T extends Runnable> void accept(@RcvrB("m") WithValue this, T r) throws Exception { }
+}
+
+class WithFinal {
+    void plain(final @RcvrB("m") WithFinal this) { }
+    <T> void generic(final @RcvrB("m") WithFinal this) { }
+    void withException(final @RcvrB("m") WithFinal this) throws Exception { }
+    String nonVoid(final @RcvrB("m") WithFinal this) { return null; }
+    <T extends Runnable> void accept(final @RcvrB("m") WithFinal this, T r) throws Exception { }
+}
+
+class WithBody {
+    Object f;
+
+    void field(@RcvrA WithBody this) {
+        this.f = null;
+    }
+    void meth(@RcvrA WithBody this) {
+        this.toString();
+    }
+}
+
+class Generic1<X> {
+    void test1(Generic1<X> this) {}
+    void test2(@RcvrA Generic1<X> this) {}
+    void test3(Generic1<@RcvrA X> this) {}
+    void test4(@RcvrA Generic1<@RcvrA X> this) {}
+}
+
+class Generic2<@RcvrA X> {
+    void test1(Generic2<X> this) {}
+    void test2(@RcvrA Generic2<X> this) {}
+    void test3(Generic2<@RcvrA X> this) {}
+    void test4(@RcvrA Generic2<@RcvrA X> this) {}
+}
+
+class Generic3<X extends @RcvrA Object> {
+    void test1(Generic3<X> this) {}
+    void test2(@RcvrA Generic3<X> this) {}
+    void test3(Generic3<@RcvrA X> this) {}
+    void test4(@RcvrA Generic3<@RcvrA X> this) {}
+}
+
+class Generic4<X extends @RcvrA Object> {
+    <Y> void test1(Generic4<X> this) {}
+    <Y> void test2(@RcvrA Generic4<X> this) {}
+    <Y> void test3(Generic4<@RcvrA X> this) {}
+    <Y> void test4(@RcvrA Generic4<@RcvrA X> this) {}
+}
+
+class Outer {
+    class Inner {
+        void none(Outer.Inner this) {}
+        void outer(@RcvrA Outer.Inner this) {}
+        void inner(Outer. @RcvrB("i") Inner this) {}
+        void both(@RcvrA Outer.@RcvrB("i") Inner this) {}
+
+        void innerOnlyNone(Inner this) {}
+        void innerOnly(@RcvrA Inner this) {}
+    }
+}
+
+class GenericOuter<S, T> {
+    class GenericInner<U, V> {
+        void none(GenericOuter<S, T>.GenericInner<U, V> this) {}
+        void outer(@RcvrA GenericOuter<S, T>.GenericInner<U, V> this) {}
+        void inner(GenericOuter<S, T>. @RcvrB("i") GenericInner<U, V> this) {}
+        void both(@RcvrA GenericOuter<S, T>.@RcvrB("i") GenericInner<U, V> this) {}
+
+        void innerOnlyNone(GenericInner<U, V> this) {}
+        void innerOnly(@RcvrA GenericInner<U, V> this) {}
+    }
+}
+
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface RcvrA {}
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface RcvrB { String value(); }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/javadoc/testTypeAnnotations/typeannos/Throws.java	Wed May 01 10:47:01 2013 +0100
@@ -0,0 +1,51 @@
+/*
+ * 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.
+ */
+
+package typeannos;
+
+import java.lang.annotation.*;
+
+/*
+ * This class is replicated from test/tools/javac/annotations/typeAnnotations/newlocations.
+ */
+class ThrDefaultUnmodified {
+    void oneException() throws @ThrA Exception {}
+    void twoExceptions() throws @ThrA RuntimeException, @ThrA Exception {}
+}
+
+class ThrPublicModified {
+    public final void oneException(String a) throws @ThrA Exception {}
+    public final void twoExceptions(String a) throws @ThrA RuntimeException, @ThrA Exception {}
+}
+
+class ThrWithValue {
+    void oneException() throws @ThrB("m") Exception {}
+    void twoExceptions() throws @ThrB(value="m") RuntimeException, @ThrA Exception {}
+}
+
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface ThrA {}
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface ThrB { String value(); }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/javadoc/testTypeAnnotations/typeannos/TypeParameters.java	Wed May 01 10:47:01 2013 +0100
@@ -0,0 +1,60 @@
+/*
+ * 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.
+ */
+
+package typeannos;
+
+import java.lang.annotation.*;
+
+/*
+ * This class is replicated from test/tools/javac/annotations/typeAnnotations/newlocations.
+ */
+class TypUnannotated<K> { }
+class OneAnnotated<@TyParaA K> { }
+class TwoAnnotated<@TyParaA K, @TyParaA V> { }
+class SecondAnnotated<K, @TyParaA V extends String> { }
+
+class TestMethods {
+    <K> void unannotated() { }
+    <@TyParaA K> void oneAnnotated() { }
+    <@TyParaA K, @TyParaB("m") V> void twoAnnotated() { }
+    <K, @TyParaA V extends @TyParaA String> void secondAnnotated() { }
+}
+
+class UnannotatedB<K> { }
+class OneAnnotatedB<@TyParaB("m") K> { }
+class TwoAnnotatedB<@TyParaB("m") K, @TyParaB("m") V> { }
+class SecondAnnotatedB<K, @TyParaB("m") V extends @TyParaB("m") String> { }
+
+class OneAnnotatedC<@TyParaC K> { }
+class TwoAnnotatedC<@TyParaC K, @TyParaC V> { }
+class SecondAnnotatedC<K, @TyParaC V extends String> { }
+
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface TyParaA { }
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface TyParaB { String value(); }
+@Target(ElementType.TYPE_USE)
+@Documented
+@interface TyParaC { }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/javadoc/testTypeAnnotations/typeannos/Varargs.java	Wed May 01 10:47:01 2013 +0100
@@ -0,0 +1,42 @@
+/*
+ * 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.
+ */
+package typeannos;
+
+import java.lang.annotation.*;
+
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface VarArgA {}
+
+/*
+ * This class is replicated from test/tools/javac/annotations/typeAnnotations/newlocations.
+ */
+class Varargs {
+
+    // Handle annotations on a varargs element type
+    void varargPlain(Object @VarArgA... objs) {
+    }
+
+    void varargGeneric(Class<?> @VarArgA ... clz) {
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/javadoc/testTypeAnnotations/typeannos/Wildcards.java	Wed May 01 10:47:01 2013 +0100
@@ -0,0 +1,74 @@
+/*
+ * 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.
+ */
+
+package typeannos;
+
+import java.lang.annotation.*;
+
+/*
+ * This class is replicated from test/tools/javac/annotations/typeAnnotations/newlocations.
+ */
+class BoundTest {
+    void wcExtends(MyList<? extends @WldA String> l) { }
+    void wcSuper(MyList<? super @WldA String> l) { }
+
+    MyList<? extends @WldA String> returnWcExtends() { return null; }
+    MyList<? super @WldA String> returnWcSuper() { return null; }
+    MyList<? extends @WldA MyList<? super @WldB("m") String>> complex() { return null; }
+}
+
+class BoundWithValue {
+    void wcExtends(MyList<? extends @WldB("m") String> l) { }
+    void wcSuper(MyList<? super @WldB(value="m") String> l) { }
+
+    MyList<? extends @WldB("m") String> returnWcExtends() { return null; }
+    MyList<? super @WldB(value="m") String> returnWcSuper() { return null; }
+    MyList<? extends @WldB("m") MyList<? super @WldB("m") String>> complex() { return null; }
+}
+
+class SelfTest {
+    void wcExtends(MyList<@WldA ?> l) { }
+    void wcSuper(MyList<@WldA ?> l) { }
+
+    MyList<@WldA ?> returnWcExtends() { return null; }
+    MyList<@WldA ?> returnWcSuper() { return null; }
+    MyList<@WldA ? extends @WldA MyList<@WldB("m") ?>> complex() { return null; }
+}
+
+class SelfWithValue {
+    void wcExtends(MyList<@WldB("m") ?> l) { }
+    void wcSuper(MyList<@WldB(value="m") ?> l) { }
+
+    MyList<@WldB("m") ?> returnWcExtends() { return null; }
+    MyList<@WldB(value="m") ?> returnWcSuper() { return null; }
+    MyList<@WldB("m") ? extends MyList<@WldB("m") ? super String>> complex() { return null; }
+}
+
+class MyList<K> { }
+
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface WldA { }
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
+@Documented
+@interface WldB { String value(); }
--- a/test/com/sun/javadoc/typeAnnotations/smoke/TestSmoke.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/test/com/sun/javadoc/typeAnnotations/smoke/TestSmoke.java	Wed May 01 10:47:01 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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
--- a/test/com/sun/javadoc/typeAnnotations/smoke/pkg/TargetTypes.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/test/com/sun/javadoc/typeAnnotations/smoke/pkg/TargetTypes.java	Wed May 01 10:47:01 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/T4965689/ClassLiteralWastesByteTest.java	Wed May 01 10:47:01 2013 +0100
@@ -0,0 +1,66 @@
+/*
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 4965689
+ * @summary class literal code wastes a byte
+ */
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.nio.file.Paths;
+
+public class ClassLiteralWastesByteTest {
+
+    private static final String assertionErrorMsg =
+            "Instead of ldc_w, ldc instruction should have been generated";
+
+    public static void main(String[] args) {
+        new ClassLiteralWastesByteTest().run();
+    }
+
+    void run() {
+        check("-c", Paths.get(System.getProperty("test.classes"),
+                "test.class").toString());
+    }
+
+    void check(String... params) {
+        StringWriter s;
+        String out;
+        try (PrintWriter pw = new PrintWriter(s = new StringWriter())) {
+            com.sun.tools.javap.Main.run(params, pw);
+            out = s.toString();
+        }
+        if (out.contains("ldc_w")) {
+            throw new AssertionError(assertionErrorMsg);
+        }
+    }
+
+}
+
+class test {
+    void m() {
+        Class<?> aClass = test.class;
+    }
+}
--- a/test/tools/javac/T5053846/MethodRefDupInConstantPoolTest.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/test/tools/javac/T5053846/MethodRefDupInConstantPoolTest.java	Wed May 01 10:47:01 2013 +0100
@@ -23,8 +23,9 @@
 
 /*
  * @test
- * @bug 5053846
+ * @bug 5053846 8011432
  * @summary javac: MethodRef entries are duplicated in the constant pool
+ * @summary javac, compiler regression iterable + captured type
  */
 
 import java.io.PrintWriter;
@@ -43,9 +44,13 @@
 
     void run() {
         check("-v", Paths.get(System.getProperty("test.classes"),
-                "TestHelper1.class").toString());
+                this.getClass().getSimpleName() + "$TestHelper1.class").toString());
         check("-v", Paths.get(System.getProperty("test.classes"),
-                "TestHelper2.class").toString());
+                this.getClass().getSimpleName() + "$TestHelper2.class").toString());
+        check("-v", Paths.get(System.getProperty("test.classes"),
+                this.getClass().getSimpleName() + "$TestHelper3.class").toString());
+        check("-v", Paths.get(System.getProperty("test.classes"),
+                this.getClass().getSimpleName() + "$TestHelper4.class").toString());
     }
 
     void check(String... params) {
@@ -68,24 +73,38 @@
         int end = out.indexOf("{");
         return out.substring(start, end);
     }
-}
 
-class TestHelper1 {
-    void m() {
-        Vector v = new Vector();
-        Iterator iter = v.iterator();
-        while (iter.hasNext()) {
-            Object o = iter.next();
-            Object o2 = o;
-        }
-        for (Object o: v) {
-            Object o2 = o;
+    class TestHelper1 {
+        void m() {
+            Vector v = new Vector();
+            Iterator iter = v.iterator();
+            while (iter.hasNext()) {
+                Object o = iter.next();
+                Object o2 = o;
+            }
+            for (Object o: v) {
+                Object o2 = o;
+            }
         }
     }
-}
 
-class TestHelper2<X extends Number & Iterable<String>> {
-    void test(X x) {
-        for (String s : x) { }
+    class TestHelper2<X extends Number & Iterable<String>> {
+        void test(X x) {
+            for (String s : x) { }
+        }
+    }
+
+    interface Data extends Iterable<String> {}
+
+    class TestHelper3<X extends Number & Iterable<? extends Data>> {
+        void test(X x) {
+            for (Data s : x) { }
+        }
+    }
+
+    class TestHelper4 {
+         void test(Iterable<? extends Data> t) {
+             for(Object a: t.iterator().next());
+         }
     }
 }
--- a/test/tools/javac/T6558476.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/test/tools/javac/T6558476.java	Wed May 01 10:47:01 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -23,6 +23,8 @@
 
 /*
  * @test
+ * @bug 6558476
+ * @summary com/sun/tools/javac/Main.compile don't release file handles on return
  * @run main/othervm -Xmx512m -Xms512m  T6558476
  */
 
@@ -70,8 +72,7 @@
 
     public static void main(String[] args) throws IOException {
         File javaHomeDir = new File(System.getProperty("java.home"));
-        File tmpDir = new File(System.getProperty("java.io.tmpdir"));
-        File outputDir = new File(tmpDir, "outputDir" + new Random().nextInt(65536));
+        File outputDir = new File("outputDir" + new Random().nextInt(65536));
         outputDir.mkdir();
         outputDir.deleteOnExit();
 
--- a/test/tools/javac/T6900149.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/test/tools/javac/T6900149.java	Wed May 01 10:47:01 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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
@@ -39,7 +39,7 @@
         JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
         StandardJavaFileManager fm =
                 compiler.getStandardFileManager(null, null, null);
-        File emptyFile = File.createTempFile("Empty", ".java");
+        File emptyFile = createTempFile("Empty.java");
         File[] files = new File[] { emptyFile, emptyFile };
         CompilationTask task = compiler.getTask(null, fm, diag,
                 null, null, fm.getJavaFileObjects(files));
@@ -47,4 +47,10 @@
             throw new AssertionError("compilation failed");
         }
     }
+
+    private static File createTempFile(String path) throws IOException {
+        File f = new File(path);
+        try (FileWriter out = new FileWriter(f)) { }
+        return f;
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/T8010659/CompilerCrashWhenMixingBinariesAndSourcesTest.java	Wed May 01 10:47:01 2013 +0100
@@ -0,0 +1,66 @@
+/*
+ * 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.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8010659
+ * @summary Javac Crashes while building OpenJFX
+ * @library /tools/javac/lib
+ * @build ToolBox
+ * @run main CompilerCrashWhenMixingBinariesAndSourcesTest
+ */
+
+public class CompilerCrashWhenMixingBinariesAndSourcesTest {
+    private static final String ASource =
+            "class A {\n" +
+            "        void test() {new B(){};}\n" +
+            "}";
+    private static final String BSource =
+            "class B extends C {}";
+    private static final String CSource =
+            "class C extends D {\n" +
+            "        String m(int i) {return null;}\n" +
+            "}";
+    private static final String DSource =
+            "class D {\n" +
+            "        Object m(int i) {return null;}\n" +
+            "}";
+
+    public static void main (String[] args) throws Exception{
+        ToolBox.JavaToolArgs javacParams = new ToolBox.JavaToolArgs()
+                .setSources(ASource, BSource, CSource, DSource);
+        ToolBox.javac(javacParams);
+
+        ToolBox.rm("A.class");
+        ToolBox.rm("A$1.class");
+        ToolBox.rm("C.class");
+        ToolBox.rm("D.class");
+
+        javacParams = new ToolBox.JavaToolArgs()
+                .setOptions("-cp", ".")
+                .setSources(ASource, CSource, DSource);
+        ToolBox.javac(javacParams);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/T8011181/EmptyUTF8ForInnerClassNameTest.java	Wed May 01 10:47:01 2013 +0100
@@ -0,0 +1,81 @@
+/*
+ * 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.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8011181
+ * @summary javac, empty UTF8 entry generated for inner class
+ */
+
+import java.io.BufferedInputStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+import com.sun.tools.javac.util.Assert;
+import com.sun.tools.classfile.ClassFile;
+
+import static com.sun.tools.classfile.ConstantPool.CONSTANT_Utf8;
+import static com.sun.tools.classfile.ConstantPool.CONSTANT_Utf8_info;
+import static com.sun.tools.classfile.ConstantPool.CPInfo;
+
+public class EmptyUTF8ForInnerClassNameTest {
+
+    public static void main(String[] args) throws Exception {
+        new EmptyUTF8ForInnerClassNameTest().run();
+    }
+
+    void run() throws Exception {
+        checkClassFile(Paths.get(System.getProperty("test.classes"),
+                this.getClass().getName() + "$1.class"));
+        checkClassFile(Paths.get(System.getProperty("test.classes"),
+                this.getClass().getName() + "$EnumPlusSwitch.class"));
+    }
+
+    void checkClassFile(final Path path) throws Exception {
+        ClassFile classFile = ClassFile.read(
+                new BufferedInputStream(Files.newInputStream(path)));
+        for (CPInfo cpInfo : classFile.constant_pool.entries()) {
+            if (cpInfo.getTag() == CONSTANT_Utf8) {
+                CONSTANT_Utf8_info utf8Info = (CONSTANT_Utf8_info)cpInfo;
+                Assert.check(utf8Info.value.length() > 0,
+                        "UTF8 with length 0 found at class " + classFile.getName());
+            }
+        }
+    }
+
+    static class EnumPlusSwitch {
+        enum E {E1}
+
+        public int m (E e) {
+            switch (e) {
+                case E1:
+                    return 0;
+            }
+            return -1;
+        }
+    }
+
+}
--- a/test/tools/javac/annotations/typeAnnotations/TypeProcOnly.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/test/tools/javac/annotations/typeAnnotations/TypeProcOnly.java	Wed May 01 10:47:01 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -32,12 +32,12 @@
 import com.sun.source.util.JavacTask;
 import com.sun.source.util.TaskEvent;
 import com.sun.source.util.TaskListener;
-import com.sun.source.util.TreePath;
 import com.sun.tools.javac.main.JavaCompiler;
-import com.sun.tools.javac.main.JavaCompiler.CompileState;
 import com.sun.tools.javac.processing.JavacProcessingEnvironment;
 import com.sun.tools.javac.util.Context;
 
+import static com.sun.tools.javac.comp.CompileStates.CompileState;
+
 /*
  * @test
  * @summary test that type processors are run when -proc:only is passed.
--- a/test/tools/javac/annotations/typeAnnotations/packageanno/PackageProcessor.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/test/tools/javac/annotations/typeAnnotations/packageanno/PackageProcessor.java	Wed May 01 10:47:01 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -31,12 +31,12 @@
 import com.sun.source.util.JavacTask;
 import com.sun.source.util.TaskEvent;
 import com.sun.source.util.TaskListener;
-import com.sun.source.util.TreePath;
 import com.sun.tools.javac.main.JavaCompiler;
-import com.sun.tools.javac.main.JavaCompiler.CompileState;
 import com.sun.tools.javac.processing.JavacProcessingEnvironment;
 import com.sun.tools.javac.util.Context;
 
+import static com.sun.tools.javac.comp.CompileStates.CompileState;
+
 /*
  * @test
  * @summary test that package annotations are available to type processors.
--- a/test/tools/javac/defaultMethods/DefaultMethodFlags.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/test/tools/javac/defaultMethods/DefaultMethodFlags.java	Wed May 01 10:47:01 2013 +0100
@@ -77,21 +77,35 @@
                 }
             }
         });
-        
+
         task.analyze();
     }
-    
+
     void checkDefaultInterface(TypeElement te) {
         System.err.println("Checking " + te.getSimpleName());
         Assert.check(te.getModifiers().contains(Modifier.ABSTRACT));
         for (Element e : te.getEnclosedElements()) {
-            if (e.getSimpleName().toString().equals("m")) {
-                Assert.check(!e.getModifiers().contains(Modifier.ABSTRACT));
+            if (e.getSimpleName().toString().matches("(\\w)_(default|static|abstract)")) {
+                boolean abstractExpected = false;
+                String methodKind = e.getSimpleName().toString().substring(2);
+                switch (methodKind) {
+                    case "default":
+                    case "static":
+                        break;
+                    case "abstract":
+                        abstractExpected = true;
+                        break;
+                    default:
+                        Assert.error("Cannot get here!" + methodKind);
+                }
+                Assert.check(e.getModifiers().contains(Modifier.ABSTRACT) == abstractExpected);
             }
         }
     }
 }
 
 interface I {
-    default void m() { }
+    default void m_default() { }
+    static void m_static() { }
+    void m_abstract();
 }
--- a/test/tools/javac/diags/CheckExamples.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/test/tools/javac/diags/CheckExamples.java	Wed May 01 10:47:01 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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
@@ -34,6 +34,8 @@
  */
 
 import java.io.*;
+import java.nio.file.*;
+import java.nio.file.attribute.BasicFileAttributes;
 import java.util.*;
 
 /**
@@ -53,7 +55,27 @@
      * Standard entry point.
      */
     public static void main(String... args) throws Exception {
-        new CheckExamples().run();
+        boolean jtreg = (System.getProperty("test.src") != null);
+        Path tmpDir;
+        boolean deleteOnExit;
+        if (jtreg) {
+            // use standard jtreg scratch directory: the current directory
+            tmpDir = Paths.get(System.getProperty("user.dir"));
+            deleteOnExit = false;
+        } else {
+            tmpDir = Files.createTempDirectory(Paths.get(System.getProperty("java.io.tmpdir")),
+                    CheckExamples.class.getName());
+            deleteOnExit = true;
+        }
+        Example.setTempDir(tmpDir.toFile());
+
+        try {
+            new CheckExamples().run();
+        } finally {
+            if (deleteOnExit) {
+                clean(tmpDir);
+            }
+        }
     }
 
     /**
@@ -190,6 +212,25 @@
 
     int errors;
 
+    /**
+     * Clean the contents of a directory.
+     */
+    static void clean(Path dir) throws IOException {
+        Files.walkFileTree(dir, new SimpleFileVisitor<Path>() {
+            @Override
+            public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
+                Files.delete(file);
+                return super.visitFile(file, attrs);
+            }
+
+            @Override
+            public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException {
+                if (exc == null) Files.delete(dir);
+                return super.postVisitDirectory(dir, exc);
+            }
+        });
+    }
+
     static class Counts {
         static String[] prefixes = {
             "compiler.err.",
--- a/test/tools/javac/diags/RunExamples.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/test/tools/javac/diags/RunExamples.java	Wed May 01 10:47:01 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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
@@ -33,7 +33,8 @@
  */
 
 import java.io.*;
-import java.text.SimpleDateFormat;
+import java.nio.file.*;
+import java.nio.file.attribute.BasicFileAttributes;
 import java.util.*;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -56,16 +57,18 @@
 public class RunExamples {
     public static void main(String... args) throws Exception {
         jtreg = (System.getProperty("test.src") != null);
-        File tmpDir;
+        Path tmpDir;
+        boolean deleteOnExit;
         if (jtreg) {
             // use standard jtreg scratch directory: the current directory
-            tmpDir = new File(System.getProperty("user.dir"));
+            tmpDir = Paths.get(System.getProperty("user.dir"));
+            deleteOnExit = false;
         } else {
-            tmpDir = new File(System.getProperty("java.io.tmpdir"),
-                    RunExamples.class.getName()
-                    + (new SimpleDateFormat("yyMMddHHmmss")).format(new Date()));
+            tmpDir = Files.createTempDirectory(Paths.get(System.getProperty("java.io.tmpdir")),
+                    RunExamples.class.getName());
+            deleteOnExit = true;
         }
-        Example.setTempDir(tmpDir);
+        Example.setTempDir(tmpDir.toFile());
 
         RunExamples r = new RunExamples();
 
@@ -73,15 +76,8 @@
             if (r.run(args))
                 return;
         } finally {
-            /* VERY IMPORTANT NOTE. In jtreg mode, tmpDir is set to the
-             * jtreg scratch directory, which is the current directory.
-             * In case someone is faking jtreg mode, make sure to only
-             * clean tmpDir when it is reasonable to do so.
-             */
-            if (tmpDir.isDirectory() &&
-                    tmpDir.getName().startsWith(RunExamples.class.getName())) {
-                if (clean(tmpDir))
-                    tmpDir.delete();
+            if (deleteOnExit) {
+                clean(tmpDir);
             }
         }
 
@@ -203,14 +199,20 @@
     /**
      * Clean the contents of a directory.
      */
-    static boolean clean(File dir) {
-        boolean ok = true;
-        for (File f: dir.listFiles()) {
-            if (f.isDirectory())
-                ok &= clean(f);
-            ok &= f.delete();
-        }
-        return ok;
+    static void clean(Path dir) throws IOException {
+        Files.walkFileTree(dir, new SimpleFileVisitor<Path>() {
+            @Override
+            public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
+                Files.delete(file);
+                return super.visitFile(file, attrs);
+            }
+
+            @Override
+            public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException {
+                if (exc == null) Files.delete(dir);
+                return super.postVisitDirectory(dir, exc);
+            }
+        });
     }
 
     static abstract class Runner {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/BadArgTypesInLambda.java	Wed May 01 10:47:01 2013 +0100
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+
+// key: compiler.err.cant.apply.symbol
+// key: compiler.misc.no.conforming.assignment.exists
+// key: compiler.misc.bad.arg.types.in.lambda
+
+class BadArgTypesInLambda {
+    interface SAM {
+        void m(Integer i);
+    }
+
+    void g(SAM s) { }
+
+    void test() {
+        g(x->{ String s = x; });
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/doclint/ImplicitHeadersTest.java	Wed May 01 10:47:01 2013 +0100
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8006346
+ * @summary doclint should make allowance for headers generated by standard doclet
+ * @compile -Xdoclint:all/public ImplicitHeadersTest.java
+ */
+
+/**
+ * <h3> Header </h3>
+ */
+public class ImplicitHeadersTest { }
+
--- a/test/tools/javac/lambda/Intersection01.out	Tue Apr 30 17:01:18 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-Intersection01.java:36:45: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: java.io.Serializable, (compiler.misc.no.abstracts: kindname.interface, java.io.Serializable))
-Intersection01.java:38:45: compiler.err.prob.found.req: (compiler.misc.not.a.functional.intf.1: java.io.Serializable, (compiler.misc.no.abstracts: kindname.interface, java.io.Serializable))
-2 errors
--- a/test/tools/javac/lambda/Intersection03.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/test/tools/javac/lambda/Intersection03.java	Wed May 01 10:47:01 2013 +0100
@@ -29,14 +29,14 @@
 import java.util.*;
 
 public class Intersection03 {
-    
+
     static int assertionCount = 0;
-    
+
     static void assertTrue(boolean cond) {
         assertionCount++;
         if (!cond) throw new AssertionError();
     }
-    
+
     public static void main(String[] args) {
         try {
             Runnable r = (List<?> & Runnable)new ArrayList<String>();
--- a/test/tools/javac/lambda/TargetType70.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/test/tools/javac/lambda/TargetType70.java	Wed May 01 10:47:01 2013 +0100
@@ -28,7 +28,7 @@
  * @compile TargetType70.java
  */
 class TargetType70  {
-    
+
     static class Sup {}
     static class Sub extends Sup {}
 
@@ -44,7 +44,7 @@
         GenSub(T f) { super(f); }
     }
 
-    <T extends Sup> void m(I<? extends GenSup<T>, T> o1, T o2) { }       
+    <T extends Sup> void m(I<? extends GenSup<T>, T> o1, T o2) { }
 
     void test(Sub sub) {
         m(GenSub::new, sub);
--- a/test/tools/javac/lambda/TargetType72.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/test/tools/javac/lambda/TargetType72.java	Wed May 01 10:47:01 2013 +0100
@@ -31,7 +31,7 @@
 import java.util.concurrent.Callable;
 
 class TargetType72 {
-    
+
     Callable<Number> c = id(id(()->{ if (true) throw new java.io.IOException(); return 0; }));
 
     <Z> Z id(Z z) { return null; }
--- a/test/tools/javac/lambda/TestInvokeDynamic.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/test/tools/javac/lambda/TestInvokeDynamic.java	Wed May 01 10:47:01 2013 +0100
@@ -350,14 +350,14 @@
                         bsm_ref.getNameAndTypeInfo().getType() + " " +
                         asBSMSignatureString());
             }
-            
+
             LineNumberTable_attribute lnt =
                     (LineNumberTable_attribute)ea.attributes.get(Attribute.LineNumberTable);
 
-            if (lnt == null) {                
+            if (lnt == null) {
                 throw new Error("No LineNumberTable attribute");
             }
-            if (lnt.line_number_table_length != 2) {                
+            if (lnt.line_number_table_length != 2) {
                 throw new Error("Wrong number of entries in LineNumberTable");
             }
         } catch (Exception e) {
--- a/test/tools/javac/lambda/intersection/IntersectionTargetTypeTest.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/test/tools/javac/lambda/intersection/IntersectionTargetTypeTest.java	Wed May 01 10:47:01 2013 +0100
@@ -55,7 +55,7 @@
         DEFAULT_M(false),
         ABSTRACT_G(true),
         DEFAULT_G(false);
-        
+
         boolean isAbstract;
 
         MethodKind(boolean isAbstract) {
@@ -297,7 +297,7 @@
                 "\nExpected error: " + errorExpected);
         }
     }
-    
+
     List<MethodKind> mergeMethods(List<MethodKind> l1, List<MethodKind> l2) {
         List<MethodKind> mergedMethods = new ArrayList<>(l1);
         for (MethodKind mk2 : l2) {
@@ -317,7 +317,7 @@
                     add = false;
                     break;
             }
-            if (add) {                
+            if (add) {
                 mergedMethods.add(mk2);
             }
         }
--- a/test/tools/javac/processing/model/element/TestExecutableElement.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/test/tools/javac/processing/model/element/TestExecutableElement.java	Wed May 01 10:47:01 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8005046
+ * @bug 8005046 8011052
  * @summary Test basic properties of javax.lang.element.Element
  * @author  Joseph D. Darcy
  * @library /tools/javac/lib
@@ -35,6 +35,7 @@
 import java.util.Formatter;
 import java.util.Set;
 import java.util.Objects;
+import java.util.regex.*;
 import javax.annotation.processing.*;
 import javax.lang.model.SourceVersion;
 import static javax.lang.model.SourceVersion.*;
@@ -79,9 +80,39 @@
 
         boolean methodIsDefault = method.isDefault();
 
+        if (expectedDefault) {
+            if (!method.getModifiers().contains(Modifier.DEFAULT)) {
+                messager.printMessage(ERROR,
+                                      "Modifier \"default\" not present as expected.",
+                                      method);
+            }
+
+            // Check printing output
+            java.io.Writer stringWriter = new java.io.StringWriter();
+            eltUtils.printElements(stringWriter, method);
+            Pattern p = Pattern.compile(expectedIsDefault.expectedTextRegex(), Pattern.DOTALL);
+
+            if (! p.matcher(stringWriter.toString()).matches()) {
+                messager.printMessage(ERROR,
+                                      new Formatter().format("Unexpected printing ouptput:%n\tgot %s,%n\texpected pattern %s.",
+                                                             stringWriter.toString(),
+                                                             expectedIsDefault.expectedTextRegex()).toString(),
+                                      method);
+            }
+
+            System.out.println("\t" + stringWriter.toString());
+
+        } else {
+            if (method.getModifiers().contains(Modifier.DEFAULT)) {
+                messager.printMessage(ERROR,
+                                      "Modifier \"default\" present when not expected.",
+                                      method);
+            }
+        }
+
         if (methodIsDefault != expectedDefault) {
             messager.printMessage(ERROR,
-                                  new Formatter().format("Unexpected Executable.isDefault result: got %s, expected %s",
+                                  new Formatter().format("Unexpected Executable.isDefault result: got ``%s'', expected ``%s''.",
                                                          expectedDefault,
                                                          methodIsDefault).toString(),
                                   method);
@@ -98,6 +129,7 @@
 @Target(ElementType.METHOD)
 @interface IsDefault {
     boolean value();
+    String expectedTextRegex() default "";
 }
 
 /**
@@ -108,6 +140,6 @@
     boolean process(Set<? extends TypeElement> annotations,
                     RoundEnvironment roundEnv);
 
-    @IsDefault(true)
-    default void quux() {};
+    @IsDefault(value=true, expectedTextRegex="\\s*@IsDefault\\(.*\\)\\s*default strictfp void quux\\(\\);\\s*$")
+    default strictfp void quux() {};
 }
--- a/test/tools/javac/scope/7017664/CompoundScopeTest.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/test/tools/javac/scope/7017664/CompoundScopeTest.java	Wed May 01 10:47:01 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -147,7 +147,7 @@
         Scope createScope(int nelems) {
             Scope s = new Scope(symtab.noSymbol);
             for (int i = 0 ; i < nelems ; i++) {
-                Symbol sym = new TypeSymbol(0, names.fromString("s" + i), null, null);
+                Symbol sym = new TypeVariableSymbol(0, names.fromString("s" + i), null, null);
                 s.enter(sym);
                 elems = elems.prepend(sym);
                 List<Symbol> shadowed = shadowedMap.get(sym.name);
--- a/test/tools/javac/types/TypeHarness.java	Tue Apr 30 17:01:18 2013 +0100
+++ b/test/tools/javac/types/TypeHarness.java	Wed May 01 10:47:01 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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
@@ -309,7 +309,7 @@
         }
 
         public TypeVar TypeVariable(Type bound) {
-            TypeSymbol tvsym = new TypeSymbol(0, syntheticName(), null, predef.noSymbol);
+            TypeSymbol tvsym = new TypeVariableSymbol(0, syntheticName(), null, predef.noSymbol);
             tvsym.type = new TypeVar(tvsym, bound, null);
             return (TypeVar)tvsym.type;
         }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javadoc/doclint/ImplicitHeadersTest.java	Wed May 01 10:47:01 2013 +0100
@@ -0,0 +1,45 @@
+/*
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8006346
+ * @summary doclint should make allowance for headers generated by standard doclet
+ */
+
+import java.io.File;
+
+/**
+ * <h3> Header </h3>
+ */
+public class ImplicitHeadersTest {
+    public static void main(String... args) {
+        File testSrc = new File(System.getProperty("test.src"));
+        File testFile = new File(testSrc, ImplicitHeadersTest.class.getSimpleName() + ".java");
+        String[] javadocArgs = { "-d", "out", testFile.getPath() };
+        int rc = com.sun.tools.javadoc.Main.execute(javadocArgs);
+        if (rc != 0)
+            throw new Error("unexpected exit: rc=" + rc);
+    }
+}
+