changeset 1804:48c6e6ab7c81 jdk8-b94

Merge
author lana
date Mon, 10 Jun 2013 17:04:18 -0700
parents 888386fddc09 79fd9cfa55f2
children 4cb113623127
files
diffstat 54 files changed, 1337 insertions(+), 338 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/tools/doclets/formats/html/ConfigurationImpl.java	Thu Jun 06 09:55:26 2013 -0700
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/ConfigurationImpl.java	Mon Jun 10 17:04:18 2013 -0700
@@ -324,8 +324,19 @@
             option.startsWith("-xdoclint:")) {
             return 1;
         } else if (option.equals("-help")) {
+            // Uugh: first, this should not be hidden inside optionLength,
+            // and second, we should not be writing directly to stdout.
+            // But we have no access to a DocErrorReporter, which would
+            // allow use of reporter.printNotice
             System.out.println(getText("doclet.usage"));
             return 1;
+        } else if (option.equals("-x")) {
+            // Uugh: first, this should not be hidden inside optionLength,
+            // and second, we should not be writing directly to stdout.
+            // But we have no access to a DocErrorReporter, which would
+            // allow use of reporter.printNotice
+            System.out.println(getText("doclet.X.usage"));
+            return 1;
         } else if (option.equals("-footer") ||
                    option.equals("-header") ||
                    option.equals("-packagesheader") ||
--- a/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard.properties	Thu Jun 06 09:55:26 2013 -0700
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard.properties	Mon Jun 10 17:04:18 2013 -0700
@@ -186,45 +186,50 @@
 doclet.Same_package_name_used=Package name format used twice: {0}
 doclet.exception_encountered=Exception encountered while processing {1}\n{0}
 doclet.usage=Provided by Standard doclet:\n\
-  -d <directory>                    Destination directory for output files\n\
-  -use                              Create class and package usage pages\n\
-  -version                          Include @version paragraphs\n\
-  -author                           Include @author paragraphs\n\
-  -docfilessubdirs                  Recursively copy doc-file subdirectories\n\
-  -splitindex                       Split index into one file per letter\n\
-  -windowtitle <text>               Browser window title for the documenation\n\
-  -doctitle <html-code>             Include title for the overview page\n\
-  -header <html-code>               Include header text for each page\n\
-  -footer <html-code>               Include footer text for each page\n\
-  -top    <html-code>               Include top text for each page\n\
-  -bottom <html-code>               Include bottom text for each page\n\
-  -link <url>                       Create links to javadoc output at <url>\n\
-  -linkoffline <url> <url2>         Link to docs at <url> using package list at <url2>\n\
-  -excludedocfilessubdir <name1>:.. Exclude any doc-files subdirectories with given name.\n\
-  -group <name> <p1>:<p2>..         Group specified packages together in overview page\n\
-  -nocomment                        Supress description and tags, generate only declarations.\n\
-  -nodeprecated                     Do not include @deprecated information\n\
-  -noqualifier <name1>:<name2>:...  Exclude the list of qualifiers from the output.\n\
-  -nosince                          Do not include @since information\n\
-  -notimestamp                      Do not include hidden time stamp\n\
-  -nodeprecatedlist                 Do not generate deprecated list\n\
-  -notree                           Do not generate class hierarchy\n\
-  -noindex                          Do not generate index\n\
-  -nohelp                           Do not generate help link\n\
-  -nonavbar                         Do not generate navigation bar\n\
-  -serialwarn                       Generate warning about @serial tag\n\
-  -tag <name>:<locations>:<header>  Specify single argument custom tags\n\
-  -taglet                           The fully qualified name of Taglet to register\n\
-  -tagletpath                       The path to Taglets\n\
-  -Xdocrootparent <url>             Replaces all appearances of @docRoot followed by /.. in doc comments with <url>\n\
-  -charset <charset>                Charset for cross-platform viewing of generated documentation.\n\
-  -helpfile <file>                  Include file that help link links to\n\
-  -linksource                       Generate source in HTML\n\
-  -sourcetab <tab length>           Specify the number of spaces each tab takes up in the source\n\
-  -keywords                         Include HTML meta tags with package, class and member info\n\
-  -stylesheetfile <path>            File to change style of the generated documentation\n\
-  -docencoding <name>               Output encoding name
+\  -d <directory>                   Destination directory for output files\n\
+\  -use                             Create class and package usage pages\n\
+\  -version                         Include @version paragraphs\n\
+\  -author                          Include @author paragraphs\n\
+\  -docfilessubdirs                 Recursively copy doc-file subdirectories\n\
+\  -splitindex                      Split index into one file per letter\n\
+\  -windowtitle <text>              Browser window title for the documentation\n\
+\  -doctitle <html-code>            Include title for the overview page\n\
+\  -header <html-code>              Include header text for each page\n\
+\  -footer <html-code>              Include footer text for each page\n\
+\  -top    <html-code>              Include top text for each page\n\
+\  -bottom <html-code>              Include bottom text for each page\n\
+\  -link <url>                      Create links to javadoc output at <url>\n\
+\  -linkoffline <url> <url2>        Link to docs at <url> using package list at <url2>\n\
+\  -excludedocfilessubdir <name1>:.. Exclude any doc-files subdirectories with given name.\n\
+\  -group <name> <p1>:<p2>..        Group specified packages together in overview page\n\
+\  -nocomment                       Suppress description and tags, generate only declarations.\n\
+\  -nodeprecated                    Do not include @deprecated information\n\
+\  -noqualifier <name1>:<name2>:... Exclude the list of qualifiers from the output.\n\
+\  -nosince                         Do not include @since information\n\
+\  -notimestamp                     Do not include hidden time stamp\n\
+\  -nodeprecatedlist                Do not generate deprecated list\n\
+\  -notree                          Do not generate class hierarchy\n\
+\  -noindex                         Do not generate index\n\
+\  -nohelp                          Do not generate help link\n\
+\  -nonavbar                        Do not generate navigation bar\n\
+\  -serialwarn                      Generate warning about @serial tag\n\
+\  -tag <name>:<locations>:<header> Specify single argument custom tags\n\
+\  -taglet                          The fully qualified name of Taglet to register\n\
+\  -tagletpath                      The path to Taglets\n\
+\  -charset <charset>               Charset for cross-platform viewing of generated documentation.\n\
+\  -helpfile <file>                 Include file that help link links to\n\
+\  -linksource                      Generate source in HTML\n\
+\  -sourcetab <tab length>          Specify the number of spaces each tab takes up in the source\n\
+\  -keywords                        Include HTML meta tags with package, class and member info\n\
+\  -stylesheetfile <path>           File to change style of the generated documentation\n\
+\  -docencoding <name>              Specify the character encoding for the output
 
 
-
-
+# L10N: do not localize these words: all none accessibility html missing reference syntax
+doclet.X.usage=Provided by standard doclet:\n\
+\  -Xdocrootparent <url>            Replaces all appearances of @docRoot followed\n\
+\                                   by /.. in doc comments with <url>\n\
+\  -Xdoclint                        Enable recommended checks for problems in javadoc comments\n\
+\  -Xdoclint:(all|none|[-]<group>) \n\
+\        Enable or disable specific checks for problems in javadoc comments,\n\
+\        where <group> is one of accessibility, html, missing, reference, or syntax.\n
--- a/src/share/classes/com/sun/tools/doclint/Checker.java	Thu Jun 06 09:55:26 2013 -0700
+++ b/src/share/classes/com/sun/tools/doclint/Checker.java	Mon Jun 10 17:04:18 2013 -0700
@@ -531,6 +531,17 @@
                             }
                         }
                         break;
+
+                    case VALUE:
+                        if (currTag == HtmlTag.LI) {
+                            String v = getAttrValue(tree);
+                            if (v == null || v.isEmpty()) {
+                                env.messages.error(HTML, tree, "dc.attr.lacks.value");
+                            } else if (!validNumber.matcher(v).matches()) {
+                                env.messages.error(HTML, tree, "dc.attr.not.number");
+                            }
+                        }
+                        break;
                 }
             }
         }
@@ -543,6 +554,8 @@
     // http://www.w3.org/TR/html401/types.html#type-name
     private static final Pattern validName = Pattern.compile("[A-Za-z][A-Za-z0-9-_:.]*");
 
+    private static final Pattern validNumber = Pattern.compile("-?[0-9]+");
+
     // pattern to remove leading {@docRoot}/?
     private static final Pattern docRoot = Pattern.compile("(?i)(\\{@docRoot *\\}/?)?(.*)");
 
--- a/src/share/classes/com/sun/tools/doclint/DocLint.java	Thu Jun 06 09:55:26 2013 -0700
+++ b/src/share/classes/com/sun/tools/doclint/DocLint.java	Mon Jun 10 17:04:18 2013 -0700
@@ -77,13 +77,14 @@
 
     // <editor-fold defaultstate="collapsed" desc="Command-line entry point">
     public static void main(String... args) {
+        DocLint dl = new DocLint();
         try {
-            new DocLint().run(args);
+            dl.run(args);
         } catch (BadArgs e) {
             System.err.println(e.getMessage());
             System.exit(1);
         } catch (IOException e) {
-            System.err.println(e);
+            System.err.println(dl.localize("dc.main.ioerror", e.getLocalizedMessage()));
             System.exit(2);
         }
     }
@@ -92,9 +93,10 @@
 
     // <editor-fold defaultstate="collapsed" desc="Simple API">
 
-    public static class BadArgs extends Exception {
+    public class BadArgs extends Exception {
         private static final long serialVersionUID = 0;
         BadArgs(String code, Object... args) {
+            super(localize(code, args));
             this.code = code;
             this.args = args;
         }
@@ -124,7 +126,7 @@
 
         if (javacFiles.isEmpty()) {
             if (!needHelp)
-                out.println("no files given");
+                out.println(localize("dc.main.no.files.given"));
         }
 
         JavacTool tool = JavacTool.create();
@@ -204,49 +206,9 @@
     }
 
     void showHelp(PrintWriter out) {
-        out.println("Usage:");
-        out.println("    doclint [options] source-files...");
-        out.println("");
-        out.println("Options:");
-        out.println("  -Xmsgs  ");
-        out.println("    Same as -Xmsgs:all");
-        out.println("  -Xmsgs:values");
-        out.println("    Specify categories of issues to be checked, where 'values'");
-        out.println("    is a comma-separated list of any of the following:");
-        out.println("      reference      show places where comments contain incorrect");
-        out.println("                     references to Java source code elements");
-        out.println("      syntax         show basic syntax errors within comments");
-        out.println("      html           show issues with HTML tags and attributes");
-        out.println("      accessibility  show issues for accessibility");
-        out.println("      missing        show issues with missing documentation");
-        out.println("      all            all of the above");
-        out.println("    Precede a value with '-' to negate it");
-        out.println("    Categories may be qualified by one of:");
-        out.println("      /public /protected /package /private");
-        out.println("    For positive categories (not beginning with '-')");
-        out.println("    the qualifier applies to that access level and above.");
-        out.println("    For negative categories (beginning with '-')");
-        out.println("    the qualifier applies to that access level and below.");
-        out.println("    If a qualifier is missing, the category applies to");
-        out.println("    all access levels.");
-        out.println("    For example, -Xmsgs:all,-syntax/private");
-        out.println("    This will enable all messages, except syntax errors");
-        out.println("    in the doc comments of private methods.");
-        out.println("    If no -Xmsgs options are provided, the default is");
-        out.println("    equivalent to -Xmsgs:all/protected, meaning that");
-        out.println("    all messages are reported for protected and public");
-        out.println("    declarations only. ");
-        out.println("  -stats");
-        out.println("    Report statistics on the reported issues.");
-        out.println("  -h -help --help -usage -?");
-        out.println("    Show this message.");
-        out.println("");
-        out.println("The following javac options are also supported");
-        out.println("  -bootclasspath, -classpath, -sourcepath, -Xmaxerrs, -Xmaxwarns");
-        out.println("");
-        out.println("To run doclint on part of a project, put the compiled classes for your");
-        out.println("project on the classpath (or bootclasspath), then specify the source files");
-        out.println("to be checked on the command line.");
+        String msg = localize("dc.main.usage");
+        for (String line: msg.split("\n"))
+            out.println(line);
     }
 
     List<File> splitPath(String path) {
@@ -353,6 +315,11 @@
         return false;
     }
 
+    private String localize(String code, Object... args) {
+        Messages m = (env != null) ? env.messages : new Messages(null);
+        return m.localize(code, args);
+    }
+
     // <editor-fold defaultstate="collapsed" desc="DeclScanner">
 
     static abstract class DeclScanner extends TreePathScanner<Void, Void> {
--- a/src/share/classes/com/sun/tools/doclint/HtmlTag.java	Thu Jun 06 09:55:26 2013 -0700
+++ b/src/share/classes/com/sun/tools/doclint/HtmlTag.java	Mon Jun 10 17:04:18 2013 -0700
@@ -131,7 +131,8 @@
             attrs(AttrKind.USE_CSS, ALIGN, HSPACE, VSPACE, BORDER)),
 
     LI(BlockType.LIST_ITEM, EndKind.OPTIONAL,
-            EnumSet.of(Flag.ACCEPTS_BLOCK, Flag.ACCEPTS_INLINE)),
+            EnumSet.of(Flag.ACCEPTS_BLOCK, Flag.ACCEPTS_INLINE),
+            attrs(AttrKind.OK, VALUE)),
 
     LINK(BlockType.OTHER, EndKind.NONE),
 
@@ -339,6 +340,7 @@
         TARGET,
         TYPE,
         VALIGN,
+        VALUE,
         VSPACE,
         WIDTH;
 
--- a/src/share/classes/com/sun/tools/doclint/resources/doclint.properties	Thu Jun 06 09:55:26 2013 -0700
+++ b/src/share/classes/com/sun/tools/doclint/resources/doclint.properties	Mon Jun 10 17:04:18 2013 -0700
@@ -26,6 +26,7 @@
 dc.anchor.already.defined = anchor already defined: {0}
 dc.anchor.value.missing = no value given for anchor
 dc.attr.lacks.value = attribute lacks value
+dc.attr.not.number = attribute value is not a number
 dc.attr.obsolete = attribute obsolete: {0}
 dc.attr.obsolete.use.css = attribute obsolete, use CSS instead: {0}
 dc.attr.repeated = repeated attribute: {0}
@@ -66,3 +67,50 @@
 dc.tag.start.unmatched = end tag missing: </{0}>
 dc.tag.unknown = unknown tag: {0}
 dc.text.not.allowed = text not allowed in <{0}> element
+
+dc.main.ioerror=IO error: {0}
+dc.main.no.files.given=No files given
+dc.main.usage=\
+Usage:\n\
+\    doclint [options] source-files...\n\
+\n\
+Options:\n\
+\  -Xmsgs  \n\
+\    Same as -Xmsgs:all\n\
+\  -Xmsgs:values\n\
+\    Specify categories of issues to be checked, where ''values''\n\
+\    is a comma-separated list of any of the following:\n\
+\      reference      show places where comments contain incorrect\n\
+\                     references to Java source code elements\n\
+\      syntax         show basic syntax errors within comments\n\
+\      html           show issues with HTML tags and attributes\n\
+\      accessibility  show issues for accessibility\n\
+\      missing        show issues with missing documentation\n\
+\      all            all of the above\n\
+\    Precede a value with ''-'' to negate it\n\
+\    Categories may be qualified by one of:\n\
+\      /public /protected /package /private\n\
+\    For positive categories (not beginning with ''-'')\n\
+\    the qualifier applies to that access level and above.\n\
+\    For negative categories (beginning with ''-'')\n\
+\    the qualifier applies to that access level and below.\n\
+\    If a qualifier is missing, the category applies to\n\
+\    all access levels.\n\
+\    For example, -Xmsgs:all,-syntax/private\n\
+\    This will enable all messages, except syntax errors\n\
+\    in the doc comments of private methods.\n\
+\    If no -Xmsgs options are provided, the default is\n\
+\    equivalent to -Xmsgs:all/protected, meaning that\n\
+\    all messages are reported for protected and public\n\
+\    declarations only. \n\
+\  -stats\n\
+\    Report statistics on the reported issues.\n\
+\  -h -help --help -usage -?\n\
+\    Show this message.\n\
+\n\
+The following javac options are also supported\n\
+\  -bootclasspath, -classpath, -sourcepath, -Xmaxerrs, -Xmaxwarns\n\
+\n\
+To run doclint on part of a project, put the compiled classes for your\n\
+project on the classpath (or bootclasspath), then specify the source files\n\
+to be checked on the command line.
--- a/src/share/classes/com/sun/tools/javac/code/Lint.java	Thu Jun 06 09:55:26 2013 -0700
+++ b/src/share/classes/com/sun/tools/javac/code/Lint.java	Mon Jun 10 17:04:18 2013 -0700
@@ -68,19 +68,11 @@
 
     /**
      * Returns the result of combining the values in this object with
-     * the given annotations.
+     * the metadata on the given symbol.
      */
-    public Lint augment(Annotations annots) {
-        return augmentor.augment(this, annots.getDeclarationAttributes());
-    }
-
-    /**
-     * Returns the result of combining the values in this object with
-     * the given annotations and flags.
-     */
-    public Lint augment(Annotations annots, long flags) {
-        Lint l = augmentor.augment(this, annots.getDeclarationAttributes());
-        if ((flags & DEPRECATED) != 0) {
+    public Lint augment(Symbol sym) {
+        Lint l = augmentor.augment(this, sym.getDeclarationAttributes());
+        if (sym.isDeprecated()) {
             if (l == this)
                 l = new Lint(this);
             l.values.remove(LintCategory.DEPRECATION);
--- a/src/share/classes/com/sun/tools/javac/code/Symbol.java	Thu Jun 06 09:55:26 2013 -0700
+++ b/src/share/classes/com/sun/tools/javac/code/Symbol.java	Mon Jun 10 17:04:18 2013 -0700
@@ -32,6 +32,7 @@
 import javax.tools.JavaFileObject;
 
 import com.sun.tools.javac.code.Type.*;
+import com.sun.tools.javac.comp.Annotate;
 import com.sun.tools.javac.comp.Attr;
 import com.sun.tools.javac.comp.AttrContext;
 import com.sun.tools.javac.comp.Env;
@@ -74,35 +75,6 @@
      */
     public long flags() { return flags_field; }
 
-    /** The attributes of this symbol are contained in this
-     * Annotations. The Annotations instance is NOT immutable.
-     */
-    public final Annotations annotations = new Annotations(this);
-
-    /** An accessor method for the attributes of this symbol.
-     *  Attributes of class symbols should be accessed through the accessor
-     *  method to make sure that the class symbol is loaded.
-     */
-    public List<Attribute.Compound> getRawAttributes() {
-        return annotations.getDeclarationAttributes();
-    }
-
-    /** An accessor method for the type attributes of this symbol.
-     *  Attributes of class symbols should be accessed through the accessor
-     *  method to make sure that the class symbol is loaded.
-     */
-    public List<Attribute.TypeCompound> getRawTypeAttributes() {
-        return annotations.getTypeAttributes();
-    }
-
-    /** Fetch a particular annotation from a symbol. */
-    public Attribute.Compound attribute(Symbol anno) {
-        for (Attribute.Compound a : getRawAttributes()) {
-            if (a.type.tsym == anno) return a;
-        }
-        return null;
-    }
-
     /** The name of this symbol in Utf8 representation.
      */
     public Name name;
@@ -123,6 +95,146 @@
      */
     public Type erasure_field;
 
+    // <editor-fold defaultstate="collapsed" desc="annotations">
+
+    /** The attributes of this symbol are contained in this
+     * Annotations. The Annotations instance is NOT immutable.
+     */
+    protected Annotations annotations;
+
+    /** An accessor method for the attributes of this symbol.
+     *  Attributes of class symbols should be accessed through the accessor
+     *  method to make sure that the class symbol is loaded.
+     */
+    public List<Attribute.Compound> getRawAttributes() {
+        return (annotations == null)
+                ? List.<Attribute.Compound>nil()
+                : annotations.getDeclarationAttributes();
+    }
+
+    /** An accessor method for the type attributes of this symbol.
+     *  Attributes of class symbols should be accessed through the accessor
+     *  method to make sure that the class symbol is loaded.
+     */
+    public List<Attribute.TypeCompound> getRawTypeAttributes() {
+        return (annotations == null)
+                ? List.<Attribute.TypeCompound>nil()
+                : annotations.getTypeAttributes();
+    }
+
+    /** Fetch a particular annotation from a symbol. */
+    public Attribute.Compound attribute(Symbol anno) {
+        for (Attribute.Compound a : getRawAttributes()) {
+            if (a.type.tsym == anno) return a;
+        }
+        return null;
+    }
+
+    public boolean annotationsPendingCompletion() {
+        return annotations == null ? false : annotations.pendingCompletion();
+    }
+
+    public void appendAttributes(List<Attribute.Compound> l) {
+        if (l.nonEmpty()) {
+            initedAnnos().append(l);
+        }
+    }
+
+    public void appendClassInitTypeAttributes(List<Attribute.TypeCompound> l) {
+        if (l.nonEmpty()) {
+            initedAnnos().appendClassInitTypeAttributes(l);
+        }
+    }
+
+    public void appendInitTypeAttributes(List<Attribute.TypeCompound> l) {
+        if (l.nonEmpty()) {
+            initedAnnos().appendInitTypeAttributes(l);
+        }
+    }
+
+    public void appendTypeAttributesWithCompletion(final Annotate.AnnotateRepeatedContext<Attribute.TypeCompound> ctx) {
+        initedAnnos().appendTypeAttributesWithCompletion(ctx);
+    }
+
+    public void appendUniqueTypeAttributes(List<Attribute.TypeCompound> l) {
+        if (l.nonEmpty()) {
+            initedAnnos().appendUniqueTypes(l);
+        }
+    }
+
+    public List<Attribute.TypeCompound> getClassInitTypeAttributes() {
+        return (annotations == null)
+                ? List.<Attribute.TypeCompound>nil()
+                : annotations.getClassInitTypeAttributes();
+    }
+
+    public List<Attribute.TypeCompound> getInitTypeAttributes() {
+        return (annotations == null)
+                ? List.<Attribute.TypeCompound>nil()
+                : annotations.getInitTypeAttributes();
+    }
+
+    public List<Attribute.Compound> getDeclarationAttributes() {
+        return (annotations == null)
+                ? List.<Attribute.Compound>nil()
+                : annotations.getDeclarationAttributes();
+    }
+
+    public boolean hasAnnotations() {
+        return (annotations != null && !annotations.isEmpty());
+    }
+
+    public boolean hasTypeAnnotations() {
+        return (annotations != null && !annotations.isTypesEmpty());
+    }
+
+    public void prependAttributes(List<Attribute.Compound> l) {
+        if (l.nonEmpty()) {
+            initedAnnos().prepend(l);
+        }
+    }
+
+    public void resetAnnotations() {
+        initedAnnos().reset();
+    }
+
+    public void setAttributes(Symbol other) {
+        if (annotations != null || other.annotations != null) {
+            initedAnnos().setAttributes(other.annotations);
+        }
+    }
+
+    public void setDeclarationAttributes(List<Attribute.Compound> a) {
+        if (annotations != null || a.nonEmpty()) {
+            initedAnnos().setDeclarationAttributes(a);
+        }
+    }
+
+    public void setDeclarationAttributesWithCompletion(final Annotate.AnnotateRepeatedContext<Attribute.Compound> ctx) {
+        initedAnnos().setDeclarationAttributesWithCompletion(ctx);
+    }
+
+    public void setTypeAttributes(List<Attribute.TypeCompound> a) {
+        if (annotations != null || a.nonEmpty()) {
+            if (annotations == null)
+                annotations = new Annotations(this);
+            annotations.setTypeAttributes(a);
+        }
+    }
+
+    private Annotations initedAnnos() {
+        if (annotations == null)
+            annotations = new Annotations(this);
+        return annotations;
+    }
+
+    /** This method is intended for debugging only. */
+    public Annotations getAnnotations() {
+        return annotations;
+    }
+
+    // </editor-fold>
+
     /** Construct a symbol with given kind, flags, name, type and owner.
      */
     public Symbol(int kind, long flags, Name name, Type type, Symbol owner) {
@@ -207,6 +319,10 @@
         }
     }
 
+    public boolean isDeprecated() {
+        return (flags_field & DEPRECATED) != 0;
+    }
+
     public boolean isStatic() {
         return
             (flags() & STATIC) != 0 ||
@@ -726,8 +842,9 @@
         }
 
         private void mergeAttributes() {
-            if (annotations.isEmpty() &&
-                !package_info.annotations.isEmpty()) {
+            if (annotations == null &&
+                package_info.annotations != null) {
+                annotations = new Annotations(this);
                 annotations.setAttributes(package_info.annotations);
             }
         }
--- a/src/share/classes/com/sun/tools/javac/code/TypeAnnotations.java	Thu Jun 06 09:55:26 2013 -0700
+++ b/src/share/classes/com/sun/tools/javac/code/TypeAnnotations.java	Mon Jun 10 17:04:18 2013 -0700
@@ -271,8 +271,8 @@
                 }
             }
 
-            sym.annotations.reset();
-            sym.annotations.setDeclarationAttributes(declAnnos.toList());
+            sym.resetAnnotations();
+            sym.setDeclarationAttributes(declAnnos.toList());
 
             if (typeAnnos.isEmpty()) {
                 return;
@@ -284,7 +284,7 @@
                 // When type is null, put the type annotations to the symbol.
                 // This is used for constructor return annotations, for which
                 // no appropriate type exists.
-                sym.annotations.appendUniqueTypes(typeAnnotations);
+                sym.appendUniqueTypeAttributes(typeAnnotations);
                 return;
             }
 
@@ -318,7 +318,7 @@
                 sym.type = type;
             }
 
-            sym.annotations.appendUniqueTypes(typeAnnotations);
+            sym.appendUniqueTypeAttributes(typeAnnotations);
 
             if (sym.getKind() == ElementKind.PARAMETER ||
                     sym.getKind() == ElementKind.LOCAL_VARIABLE ||
@@ -326,7 +326,7 @@
                     sym.getKind() == ElementKind.EXCEPTION_PARAMETER) {
                 // Make sure all type annotations from the symbol are also
                 // on the owner.
-                sym.owner.annotations.appendUniqueTypes(sym.getRawTypeAttributes());
+                sym.owner.appendUniqueTypeAttributes(sym.getRawTypeAttributes());
             }
         }
 
@@ -855,7 +855,7 @@
                             Assert.error("Found unexpected type annotation for variable: " + v + " with kind: " + v.getKind());
                     }
                     if (v.getKind() != ElementKind.FIELD) {
-                        v.owner.annotations.appendUniqueTypes(v.getRawTypeAttributes());
+                        v.owner.appendUniqueTypeAttributes(v.getRawTypeAttributes());
                     }
                     return;
 
--- a/src/share/classes/com/sun/tools/javac/comp/Attr.java	Thu Jun 06 09:55:26 2013 -0700
+++ b/src/share/classes/com/sun/tools/javac/comp/Attr.java	Mon Jun 10 17:04:18 2013 -0700
@@ -757,11 +757,10 @@
         // env.info.enclVar.attributes_field might not yet have been evaluated, and so might be
         // null. In that case, calling augment will throw an NPE. To avoid this, for now we
         // revert to the jdk 6 behavior and ignore the (unevaluated) attributes.
-        if (env.info.enclVar.annotations.pendingCompletion()) {
+        if (env.info.enclVar.annotationsPendingCompletion()) {
             env.info.lint = lintEnv.info.lint;
         } else {
-            env.info.lint = lintEnv.info.lint.augment(env.info.enclVar.annotations,
-                                                      env.info.enclVar.flags());
+            env.info.lint = lintEnv.info.lint.augment(env.info.enclVar);
         }
 
         Lint prevLint = chk.setLint(env.info.lint);
@@ -881,7 +880,7 @@
         MethodSymbol m = tree.sym;
         boolean isDefaultMethod = (m.flags() & DEFAULT) != 0;
 
-        Lint lint = env.info.lint.augment(m.annotations, m.flags());
+        Lint lint = env.info.lint.augment(m);
         Lint prevLint = chk.setLint(lint);
         MethodSymbol prevMethod = chk.setMethod(m);
         try {
@@ -1052,7 +1051,7 @@
         }
 
         VarSymbol v = tree.sym;
-        Lint lint = env.info.lint.augment(v.annotations, v.flags());
+        Lint lint = env.info.lint.augment(v);
         Lint prevLint = chk.setLint(lint);
 
         // Check that the variable's declared type is well-formed.
@@ -1121,9 +1120,9 @@
                 ClassSymbol cs = (ClassSymbol)env.info.scope.owner;
                 List<Attribute.TypeCompound> tas = localEnv.info.scope.owner.getRawTypeAttributes();
                 if ((tree.flags & STATIC) != 0) {
-                    cs.annotations.appendClassInitTypeAttributes(tas);
+                    cs.appendClassInitTypeAttributes(tas);
                 } else {
-                    cs.annotations.appendInitTypeAttributes(tas);
+                    cs.appendInitTypeAttributes(tas);
                 }
             }
 
@@ -4118,7 +4117,7 @@
                 lintEnv = lintEnv.next;
 
             // Having found the enclosing lint value, we can initialize the lint value for this class
-            env.info.lint = lintEnv.info.lint.augment(c.annotations, c.flags());
+            env.info.lint = lintEnv.info.lint.augment(c);
 
             Lint prevLint = chk.setLint(env.info.lint);
             JavaFileObject prev = log.useSource(c.sourcefile);
--- a/src/share/classes/com/sun/tools/javac/comp/Enter.java	Thu Jun 06 09:55:26 2013 -0700
+++ b/src/share/classes/com/sun/tools/javac/comp/Enter.java	Mon Jun 10 17:04:18 2013 -0700
@@ -161,7 +161,7 @@
         Env<AttrContext> lintEnv = localEnv;
         while (lintEnv.info.lint == null)
             lintEnv = lintEnv.next;
-        localEnv.info.lint = lintEnv.info.lint.augment(sym.annotations, sym.flags());
+        localEnv.info.lint = lintEnv.info.lint.augment(sym);
         return localEnv;
     }
 
--- a/src/share/classes/com/sun/tools/javac/comp/Flow.java	Thu Jun 06 09:55:26 2013 -0700
+++ b/src/share/classes/com/sun/tools/javac/comp/Flow.java	Mon Jun 10 17:04:18 2013 -0700
@@ -434,7 +434,7 @@
             Lint lintPrev = lint;
 
             pendingExits = new ListBuffer<PendingExit>();
-            lint = lint.augment(tree.sym.annotations);
+            lint = lint.augment(tree.sym);
 
             try {
                 // process all the static initializers
@@ -470,7 +470,7 @@
             if (tree.body == null) return;
             Lint lintPrev = lint;
 
-            lint = lint.augment(tree.sym.annotations);
+            lint = lint.augment(tree.sym);
 
             Assert.check(pendingExits.isEmpty());
 
@@ -496,7 +496,7 @@
         public void visitVarDef(JCVariableDecl tree) {
             if (tree.init != null) {
                 Lint lintPrev = lint;
-                lint = lint.augment(tree.sym.annotations);
+                lint = lint.augment(tree.sym);
                 try{
                     scan(tree.init);
                 } finally {
@@ -808,9 +808,10 @@
          */
         void markThrown(JCTree tree, Type exc) {
             if (!chk.isUnchecked(tree.pos(), exc)) {
-                if (!chk.isHandled(exc, caught))
+                if (!chk.isHandled(exc, caught)) {
                     pendingExits.append(new FlowPendingExit(tree, exc));
-                    thrown = chk.incl(exc, thrown);
+                }
+                thrown = chk.incl(exc, thrown);
             }
         }
 
@@ -835,7 +836,7 @@
             }
             classDef = tree;
             thrown = List.nil();
-            lint = lint.augment(tree.sym.annotations);
+            lint = lint.augment(tree.sym);
 
             try {
                 // process all the static initializers
@@ -915,7 +916,7 @@
             List<Type> mthrown = tree.sym.type.getThrownTypes();
             Lint lintPrev = lint;
 
-            lint = lint.augment(tree.sym.annotations);
+            lint = lint.augment(tree.sym);
 
             Assert.check(pendingExits.isEmpty());
 
@@ -954,7 +955,7 @@
         public void visitVarDef(JCVariableDecl tree) {
             if (tree.init != null) {
                 Lint lintPrev = lint;
-                lint = lint.augment(tree.sym.annotations);
+                lint = lint.augment(tree.sym);
                 try{
                     scan(tree.init);
                 } finally {
@@ -1066,8 +1067,9 @@
                                 names.close,
                                 List.<Type>nil(),
                                 List.<Type>nil());
+                        Type mt = types.memberType(resource.type, closeMethod);
                         if (closeMethod.kind == MTH) {
-                            for (Type t : ((MethodSymbol)closeMethod).getThrownTypes()) {
+                            for (Type t : mt.getThrownTypes()) {
                                 markThrown(resource, t);
                             }
                         }
@@ -1578,7 +1580,7 @@
                 firstadr = nextadr;
             }
             classDef = tree;
-            lint = lint.augment(tree.sym.annotations);
+            lint = lint.augment(tree.sym);
 
             try {
                 // define all the static fields
@@ -1646,7 +1648,7 @@
             int returnadrPrev = returnadr;
             Lint lintPrev = lint;
 
-            lint = lint.augment(tree.sym.annotations);
+            lint = lint.augment(tree.sym);
 
             Assert.check(pendingExits.isEmpty());
 
@@ -1698,7 +1700,7 @@
             if (track && tree.sym.owner.kind == MTH) newVar(tree.sym);
             if (tree.init != null) {
                 Lint lintPrev = lint;
-                lint = lint.augment(tree.sym.annotations);
+                lint = lint.augment(tree.sym);
                 try{
                     scanExpr(tree.init);
                     if (track) letInit(tree.pos(), tree.sym);
--- a/src/share/classes/com/sun/tools/javac/comp/Infer.java	Thu Jun 06 09:55:26 2013 -0700
+++ b/src/share/classes/com/sun/tools/javac/comp/Infer.java	Mon Jun 10 17:04:18 2013 -0700
@@ -218,8 +218,8 @@
         //we need to skip capture?
         Warner retWarn = new Warner();
         if (!resultInfo.checkContext.compatible(qtype1, resultInfo.checkContext.inferenceContext().asFree(to), retWarn) ||
-                //unchecked conversion is not allowed
-                retWarn.hasLint(Lint.LintCategory.UNCHECKED)) {
+                //unchecked conversion is not allowed in source 7 mode
+                (!allowGraphInference && retWarn.hasLint(Lint.LintCategory.UNCHECKED))) {
             throw inferenceException
                     .setMessage("infer.no.conforming.instance.exists",
                     inferenceContext.restvars(), mt.getReturnType(), to);
--- a/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java	Thu Jun 06 09:55:26 2013 -0700
+++ b/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java	Mon Jun 10 17:04:18 2013 -0700
@@ -249,8 +249,8 @@
                 }
             }
             if (lambdaTypeAnnos.nonEmpty()) {
-                owner.annotations.setTypeAttributes(ownerTypeAnnos.toList());
-                sym.annotations.setTypeAttributes(lambdaTypeAnnos.toList());
+                owner.setTypeAttributes(ownerTypeAnnos.toList());
+                sym.setTypeAttributes(lambdaTypeAnnos.toList());
             }
         }
 
@@ -389,15 +389,15 @@
             if (lambdaContext.getSymbolMap(PARAM).containsKey(tree.sym)) {
                 Symbol translatedSym = lambdaContext.getSymbolMap(PARAM).get(tree.sym);
                 result = make.Ident(translatedSym).setType(tree.type);
-                translatedSym.annotations.setTypeAttributes(tree.sym.getRawTypeAttributes());
+                translatedSym.setTypeAttributes(tree.sym.getRawTypeAttributes());
             } else if (lambdaContext.getSymbolMap(LOCAL_VAR).containsKey(tree.sym)) {
                 Symbol translatedSym = lambdaContext.getSymbolMap(LOCAL_VAR).get(tree.sym);
                 result = make.Ident(translatedSym).setType(tree.type);
-                translatedSym.annotations.setTypeAttributes(tree.sym.getRawTypeAttributes());
+                translatedSym.setTypeAttributes(tree.sym.getRawTypeAttributes());
             } else if (lambdaContext.getSymbolMap(TYPE_VAR).containsKey(tree.sym)) {
                 Symbol translatedSym = lambdaContext.getSymbolMap(TYPE_VAR).get(tree.sym);
                 result = make.Ident(translatedSym).setType(translatedSym.type);
-                translatedSym.annotations.setTypeAttributes(tree.sym.getRawTypeAttributes());
+                translatedSym.setTypeAttributes(tree.sym.getRawTypeAttributes());
             } else if (lambdaContext.getSymbolMap(CAPTURED_VAR).containsKey(tree.sym)) {
                 Symbol translatedSym = lambdaContext.getSymbolMap(CAPTURED_VAR).get(tree.sym);
                 result = make.Ident(translatedSym).setType(tree.type);
@@ -1715,8 +1715,8 @@
                         ret = makeSyntheticVar(FINAL, name, types.erasure(sym.type), translatedSym);
                 }
                 if (ret != sym) {
-                    ret.annotations.setDeclarationAttributes(sym.getRawAttributes());
-                    ret.annotations.setTypeAttributes(sym.getRawTypeAttributes());
+                    ret.setDeclarationAttributes(sym.getRawAttributes());
+                    ret.setTypeAttributes(sym.getRawTypeAttributes());
                 }
                 return ret;
             }
--- a/src/share/classes/com/sun/tools/javac/comp/Lower.java	Thu Jun 06 09:55:26 2013 -0700
+++ b/src/share/classes/com/sun/tools/javac/comp/Lower.java	Mon Jun 10 17:04:18 2013 -0700
@@ -2360,7 +2360,7 @@
                                 null, List.<JCExpression>nil(), List.<JCTree>nil());
             ClassSymbol c = tree.packge.package_info;
             c.flags_field |= flags;
-            c.annotations.setAttributes(tree.packge.annotations);
+            c.setAttributes(tree.packge);
             ClassType ctype = (ClassType) c.type;
             ctype.supertype_field = syms.objectType;
             ctype.interfaces_field = List.nil();
@@ -2378,7 +2378,7 @@
                 return tree.packageAnnotations.nonEmpty();
             case NONEMPTY:
                 for (Attribute.Compound a :
-                         tree.packge.annotations.getDeclarationAttributes()) {
+                         tree.packge.getDeclarationAttributes()) {
                     Attribute.RetentionPolicy p = types.getRetention(a);
                     if (p != Attribute.RetentionPolicy.SOURCE)
                         return true;
--- a/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java	Thu Jun 06 09:55:26 2013 -0700
+++ b/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java	Mon Jun 10 17:04:18 2013 -0700
@@ -712,7 +712,7 @@
 
     public Env<AttrContext> getMethodEnv(JCMethodDecl tree, Env<AttrContext> env) {
         Env<AttrContext> mEnv = methodEnv(tree, env);
-        mEnv.info.lint = mEnv.info.lint.augment(tree.sym.annotations, tree.sym.flags());
+        mEnv.info.lint = mEnv.info.lint.augment(tree.sym);
         for (List<JCTypeParameter> l = tree.typarams; l.nonEmpty(); l = l.tail)
             mEnv.info.scope.enterIfAbsent(l.head.type.tsym);
         for (List<JCVariableDecl> l = tree.params; l.nonEmpty(); l = l.tail)
@@ -753,7 +753,7 @@
             return;
         }
         if (s.kind != PCK) {
-            s.annotations.reset(); // mark Annotations as incomplete for now
+            s.resetAnnotations(); // mark Annotations as incomplete for now
         }
         annotate.normal(new Annotate.Annotator() {
                 @Override
@@ -763,10 +763,10 @@
 
                 @Override
                 public void enterAnnotation() {
-                    Assert.check(s.kind == PCK || s.annotations.pendingCompletion());
+                    Assert.check(s.kind == PCK || s.annotationsPendingCompletion());
                     JavaFileObject prev = log.useSource(localEnv.toplevel.sourcefile);
                     try {
-                        if (!s.annotations.isEmpty() &&
+                        if (s.hasAnnotations() &&
                             annotations.nonEmpty())
                             log.error(annotations.head.pos,
                                       "already.annotated",
@@ -832,7 +832,7 @@
             }
         }
 
-        s.annotations.setDeclarationAttributesWithCompletion(
+        s.setDeclarationAttributesWithCompletion(
                 annotate.new AnnotateRepeatedContext<Attribute.Compound>(env, annotated, pos, log, false));
     }
 
@@ -996,8 +996,9 @@
                 long ctorFlags = 0;
                 boolean based = false;
                 boolean addConstructor = true;
+                JCNewClass nc = null;
                 if (c.name.isEmpty()) {
-                    JCNewClass nc = (JCNewClass)env.next.tree;
+                    nc = (JCNewClass)env.next.tree;
                     if (nc.constructor != null) {
                         addConstructor = nc.constructor.kind != ERR;
                         Type superConstrType = types.memberType(c.type,
@@ -1013,7 +1014,10 @@
                     }
                 }
                 if (addConstructor) {
+                    MethodSymbol basedConstructor = nc != null ?
+                            (MethodSymbol)nc.constructor : null;
                     JCTree constrDef = DefaultConstructor(make.at(tree.pos), c,
+                                                        basedConstructor,
                                                         typarams, argtypes, thrown,
                                                         ctorFlags, based);
                     tree.defs = tree.defs.prepend(constrDef);
@@ -1103,7 +1107,7 @@
         }
 
         if (s != null) {
-            s.annotations.appendTypeAttributesWithCompletion(
+            s.appendTypeAttributesWithCompletion(
                     annotate.new AnnotateRepeatedContext<Attribute.TypeCompound>(env, annotated, pos, log, true));
         }
     }
@@ -1399,34 +1403,78 @@
      */
     JCTree DefaultConstructor(TreeMaker make,
                             ClassSymbol c,
+                            MethodSymbol baseInit,
                             List<Type> typarams,
                             List<Type> argtypes,
                             List<Type> thrown,
                             long flags,
                             boolean based) {
-        List<JCVariableDecl> params = make.Params(argtypes, syms.noSymbol);
-        List<JCStatement> stats = List.nil();
-        if (c.type != syms.objectType)
-            stats = stats.prepend(SuperCall(make, typarams, params, based));
+        JCTree result;
         if ((c.flags() & ENUM) != 0 &&
             (types.supertype(c.type).tsym == syms.enumSym)) {
             // constructors of true enums are private
             flags = (flags & ~AccessFlags) | PRIVATE | GENERATEDCONSTR;
         } else
             flags |= (c.flags() & AccessFlags) | GENERATEDCONSTR;
-        if (c.name.isEmpty()) flags |= ANONCONSTR;
-        JCTree result = make.MethodDef(
-            make.Modifiers(flags),
-            names.init,
-            null,
-            make.TypeParams(typarams),
-            params,
-            make.Types(thrown),
-            make.Block(0, stats),
-            null);
+        if (c.name.isEmpty()) {
+            flags |= ANONCONSTR;
+        }
+        Type mType = new MethodType(argtypes, null, thrown, c);
+        Type initType = typarams.nonEmpty() ?
+                new ForAll(typarams, mType) :
+                mType;
+        MethodSymbol init = new MethodSymbol(flags, names.init,
+                initType, c);
+        init.params = createDefaultConstructorParams(make, baseInit, init,
+                argtypes, based);
+        List<JCVariableDecl> params = make.Params(argtypes, init);
+        List<JCStatement> stats = List.nil();
+        if (c.type != syms.objectType) {
+            stats = stats.prepend(SuperCall(make, typarams, params, based));
+        }
+        result = make.MethodDef(init, make.Block(0, stats));
         return result;
     }
 
+    private List<VarSymbol> createDefaultConstructorParams(
+            TreeMaker make,
+            MethodSymbol baseInit,
+            MethodSymbol init,
+            List<Type> argtypes,
+            boolean based) {
+        List<VarSymbol> initParams = null;
+        List<Type> argTypesList = argtypes;
+        if (based) {
+            /*  In this case argtypes will have an extra type, compared to baseInit,
+             *  corresponding to the type of the enclosing instance i.e.:
+             *
+             *  Inner i = outer.new Inner(1){}
+             *
+             *  in the above example argtypes will be (Outer, int) and baseInit
+             *  will have parameter's types (int). So in this case we have to add
+             *  first the extra type in argtypes and then get the names of the
+             *  parameters from baseInit.
+             */
+            initParams = List.nil();
+            VarSymbol param = new VarSymbol(0, make.paramName(0), argtypes.head, init);
+            initParams = initParams.append(param);
+            argTypesList = argTypesList.tail;
+        }
+        if (baseInit != null && baseInit.params != null &&
+            baseInit.params.nonEmpty() && argTypesList.nonEmpty()) {
+            initParams = (initParams == null) ? List.<VarSymbol>nil() : initParams;
+            List<VarSymbol> baseInitParams = baseInit.params;
+            while (baseInitParams.nonEmpty() && argTypesList.nonEmpty()) {
+                VarSymbol param = new VarSymbol(baseInitParams.head.flags(),
+                        baseInitParams.head.name, argTypesList.head, init);
+                initParams = initParams.append(param);
+                baseInitParams = baseInitParams.tail;
+                argTypesList = argTypesList.tail;
+            }
+        }
+        return initParams;
+    }
+
     /** Generate call to superclass constructor. This is:
      *
      *    super(id_0, ..., id_n)
--- a/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Thu Jun 06 09:55:26 2013 -0700
+++ b/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Mon Jun 10 17:04:18 2013 -0700
@@ -349,7 +349,7 @@
             : isAccessible(env, t.tsym, checkInner);
     }
 
-    /** Is symbol accessible as a member of given type in given evironment?
+    /** Is symbol accessible as a member of given type in given environment?
      *  @param env    The current environment.
      *  @param site   The type of which the tested symbol is regarded
      *                as a member.
@@ -490,11 +490,11 @@
     };
 
     /** Try to instantiate the type of a method so that it fits
-     *  given type arguments and argument types. If succesful, return
+     *  given type arguments and argument types. If successful, return
      *  the method's instantiated type, else return null.
      *  The instantiation will take into account an additional leading
      *  formal parameter if the method is an instance method seen as a member
-     *  of un underdetermined site In this case, we treat site as an additional
+     *  of an under determined site. In this case, we treat site as an additional
      *  parameter and the parameters of the class containing the method as
      *  additional type variables that get instantiated.
      *
--- a/src/share/classes/com/sun/tools/javac/comp/TransTypes.java	Thu Jun 06 09:55:26 2013 -0700
+++ b/src/share/classes/com/sun/tools/javac/comp/TransTypes.java	Mon Jun 10 17:04:18 2013 -0700
@@ -258,6 +258,12 @@
                                                meth.name,
                                                bridgeType,
                                                origin);
+        /* once JDK-6996415 is solved it should be checked if this approach can
+         * be applied to method addOverrideBridgesIfNeeded
+         */
+        bridge.params = createBridgeParams(impl, bridge, bridgeType);
+        bridge.setAttributes(impl);
+
         if (!hypothetical) {
             JCMethodDecl md = make.MethodDef(bridge, null);
 
@@ -292,6 +298,26 @@
         overridden.put(bridge, meth);
     }
 
+    private List<VarSymbol> createBridgeParams(MethodSymbol impl, MethodSymbol bridge,
+            Type bridgeType) {
+        List<VarSymbol> bridgeParams = null;
+        if (impl.params != null) {
+            bridgeParams = List.nil();
+            List<VarSymbol> implParams = impl.params;
+            Type.MethodType mType = (Type.MethodType)bridgeType;
+            List<Type> argTypes = mType.argtypes;
+            while (implParams.nonEmpty() && argTypes.nonEmpty()) {
+                VarSymbol param = new VarSymbol(implParams.head.flags() | SYNTHETIC,
+                        implParams.head.name, argTypes.head, bridge);
+                param.setAttributes(implParams.head);
+                bridgeParams = bridgeParams.append(param);
+                implParams = implParams.tail;
+                argTypes = argTypes.tail;
+            }
+        }
+        return bridgeParams;
+    }
+
     /** Add bridge if given symbol is a non-private, non-static member
      *  of the given class, which is either defined in the class or non-final
      *  inherited, and one of the two following conditions holds:
--- a/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java	Thu Jun 06 09:55:26 2013 -0700
+++ b/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java	Mon Jun 10 17:04:18 2013 -0700
@@ -1896,12 +1896,11 @@
             JavaFileObject previousClassFile = currentClassFile;
             try {
                 currentClassFile = classFile;
-                Annotations annotations = sym.annotations;
                 List<Attribute.Compound> newList = deproxyCompoundList(l);
-                if (annotations.pendingCompletion()) {
-                    annotations.setDeclarationAttributes(newList);
+                if (sym.annotationsPendingCompletion()) {
+                    sym.setDeclarationAttributes(newList);
                 } else {
-                    annotations.append(newList);
+                    sym.appendAttributes(newList);
                 }
             } finally {
                 currentClassFile = previousClassFile;
@@ -1935,7 +1934,7 @@
             try {
                 currentClassFile = classFile;
                 List<Attribute.TypeCompound> newList = deproxyTypeCompoundList(proxies);
-                sym.annotations.setTypeAttributes(newList.prependList(sym.getRawTypeAttributes()));
+                sym.setTypeAttributes(newList.prependList(sym.getRawTypeAttributes()));
             } finally {
                 currentClassFile = previousClassFile;
             }
--- a/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java	Thu Jun 06 09:55:26 2013 -0700
+++ b/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java	Mon Jun 10 17:04:18 2013 -0700
@@ -31,7 +31,6 @@
 import java.util.Set;
 import java.util.HashSet;
 
-import javax.lang.model.type.TypeKind;
 import javax.tools.JavaFileManager;
 import javax.tools.FileObject;
 import javax.tools.JavaFileObject;
@@ -39,9 +38,6 @@
 import com.sun.tools.javac.code.*;
 import com.sun.tools.javac.code.Attribute.RetentionPolicy;
 import com.sun.tools.javac.code.Attribute.TypeCompound;
-import static com.sun.tools.javac.code.BoundKind.EXTENDS;
-import static com.sun.tools.javac.code.BoundKind.SUPER;
-import static com.sun.tools.javac.code.BoundKind.UNBOUND;
 import com.sun.tools.javac.code.Symbol.*;
 import com.sun.tools.javac.code.Type.*;
 import com.sun.tools.javac.code.Types.UniqueType;
@@ -674,13 +670,15 @@
     int writeParameterAttrs(MethodSymbol m) {
         boolean hasVisible = false;
         boolean hasInvisible = false;
-        if (m.params != null) for (VarSymbol s : m.params) {
-            for (Attribute.Compound a : s.getRawAttributes()) {
-                switch (types.getRetention(a)) {
-                case SOURCE: break;
-                case CLASS: hasInvisible = true; break;
-                case RUNTIME: hasVisible = true; break;
-                default: ;// /* fail soft */ throw new AssertionError(vis);
+        if (m.params != null) {
+            for (VarSymbol s : m.params) {
+                for (Attribute.Compound a : s.getRawAttributes()) {
+                    switch (types.getRetention(a)) {
+                    case SOURCE: break;
+                    case CLASS: hasInvisible = true; break;
+                    case RUNTIME: hasVisible = true; break;
+                    default: ;// /* fail soft */ throw new AssertionError(vis);
+                    }
                 }
             }
         }
@@ -1026,6 +1024,7 @@
             char flags = (char) adjustFlags(inner.flags_field);
             if ((flags & INTERFACE) != 0) flags |= ABSTRACT; // Interfaces are always ABSTRACT
             if (inner.name.isEmpty()) flags &= ~FINAL; // Anonymous class: unset FINAL flag
+            flags &= ~STRICTFP; //inner classes should not have the strictfp flag set.
             if (dumpInnerClassModifiers) {
                 PrintWriter pw = log.getWriter(Log.WriterKind.ERROR);
                 pw.println("INNERCLASS  " + inner.name);
--- a/src/share/classes/com/sun/tools/javac/jvm/Code.java	Thu Jun 06 09:55:26 2013 -0700
+++ b/src/share/classes/com/sun/tools/javac/jvm/Code.java	Mon Jun 10 17:04:18 2013 -0700
@@ -1960,8 +1960,7 @@
     }
 
     private void fillLocalVarPosition(LocalVar lv) {
-        if (lv == null || lv.sym == null
-                || lv.sym.annotations.isTypesEmpty())
+        if (lv == null || lv.sym == null || !lv.sym.hasTypeAnnotations())
             return;
         for (Attribute.TypeCompound ta : lv.sym.getRawTypeAttributes()) {
             TypeAnnotationPosition p = ta.position;
@@ -1979,7 +1978,7 @@
         for (int i = 0; i < varBufferSize; ++i) {
             LocalVar lv = varBuffer[i];
             if (lv == null || lv.sym == null
-                    || lv.sym.annotations.isTypesEmpty()
+                    || !lv.sym.hasTypeAnnotations()
                     || !lv.sym.isExceptionParameter())
                 continue;
 
@@ -2028,7 +2027,7 @@
         // 2) it is an exception type and it contains type annotations
         if (!varDebugInfo &&
                 (!var.sym.isExceptionParameter() ||
-                var.sym.annotations.isTypesEmpty())) return;
+                var.sym.hasTypeAnnotations())) return;
         if ((var.sym.flags() & Flags.SYNTHETIC) != 0) return;
         if (varBuffer == null)
             varBuffer = new LocalVar[20];
--- a/src/share/classes/com/sun/tools/javac/jvm/Gen.java	Thu Jun 06 09:55:26 2013 -0700
+++ b/src/share/classes/com/sun/tools/javac/jvm/Gen.java	Mon Jun 10 17:04:18 2013 -0700
@@ -518,7 +518,7 @@
         // Insert any instance initializers into all constructors.
         if (initCode.length() != 0) {
             List<JCStatement> inits = initCode.toList();
-            initTAs.addAll(c.annotations.getInitTypeAttributes());
+            initTAs.addAll(c.getInitTypeAttributes());
             List<Attribute.TypeCompound> initTAlist = initTAs.toList();
             for (JCTree t : methodDefs) {
                 normalizeMethod((JCMethodDecl)t, inits, initTAlist);
@@ -541,9 +541,9 @@
             methodDefs.append(make.MethodDef(clinit, block));
 
             if (!clinitTAs.isEmpty())
-                clinit.annotations.appendUniqueTypes(clinitTAs.toList());
-            if (!c.annotations.getClassInitTypeAttributes().isEmpty())
-                clinit.annotations.appendUniqueTypes(c.annotations.getClassInitTypeAttributes());
+                clinit.appendUniqueTypeAttributes(clinitTAs.toList());
+            if (!c.getClassInitTypeAttributes().isEmpty())
+                clinit.appendUniqueTypeAttributes(c.getClassInitTypeAttributes());
         }
         // Return all method definitions.
         return methodDefs.toList();
@@ -560,7 +560,7 @@
                 nonfieldTAs.add(ta);
             }
         }
-        sym.annotations.setTypeAttributes(fieldTAs.toList());
+        sym.setTypeAttributes(fieldTAs.toList());
         return nonfieldTAs.toList();
     }
 
@@ -618,7 +618,7 @@
             if (md.body.endpos == Position.NOPOS)
                 md.body.endpos = TreeInfo.endPos(md.body.stats.last());
 
-            md.sym.annotations.appendUniqueTypes(initTAs);
+            md.sym.appendUniqueTypeAttributes(initTAs);
         }
     }
 
--- a/src/share/classes/com/sun/tools/javac/jvm/JNIWriter.java	Thu Jun 06 09:55:26 2013 -0700
+++ b/src/share/classes/com/sun/tools/javac/jvm/JNIWriter.java	Mon Jun 10 17:04:18 2013 -0700
@@ -160,7 +160,7 @@
         for (Scope.Entry i = c.members_field.elems; i != null; i = i.sibling) {
             if (i.sym.kind == Kinds.MTH && (i.sym.flags() & Flags.NATIVE) != 0)
                 return true;
-            for (Attribute.Compound a: i.sym.annotations.getDeclarationAttributes()) {
+            for (Attribute.Compound a: i.sym.getDeclarationAttributes()) {
                 if (a.type.tsym == syms.nativeHeaderType.tsym)
                     return true;
             }
--- a/src/share/classes/com/sun/tools/javac/resources/javac.properties	Thu Jun 06 09:55:26 2013 -0700
+++ b/src/share/classes/com/sun/tools/javac/resources/javac.properties	Mon Jun 10 17:04:18 2013 -0700
@@ -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
@@ -146,11 +146,15 @@
     Enable or disable specific warnings
 javac.opt.Xdoclint=\
     Enable recommended checks for problems in javadoc comments
+# L10N: do not localize: all none
 javac.opt.Xdoclint.subopts = \
-    (all|[-]<group>)[/<access>]
+    (all|none|[-]<group>)[/<access>]
+
+# L10N: do not localize: accessibility html missing reference syntax
+# L10N: do not localize: public protected package private
 javac.opt.Xdoclint.custom=\n\
 \        Enable or disable specific checks for problems in javadoc comments,\n\
-\        where <group> is one of accessibility, html, reference, or syntax,\n\
+\        where <group> is one of accessibility, html, missing, reference, or syntax,\n\
 \        and <access> is one of public, protected, package, or private.
 javac.opt.Xstdout=\
     Redirect standard output
--- a/src/share/classes/com/sun/tools/javac/sym/CreateSymbols.java	Thu Jun 06 09:55:26 2013 -0700
+++ b/src/share/classes/com/sun/tools/javac/sym/CreateSymbols.java	Mon Jun 10 17:04:18 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 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
@@ -225,11 +225,11 @@
             }
             ClassSymbol cs = (ClassSymbol) sym;
             if (addLegacyAnnotation) {
-                cs.annotations.prepend(List.of(proprietaryAnno));
+                cs.prependAttributes(List.of(proprietaryAnno));
             }
             int p = profiles.getProfile(cs.fullname.toString().replace(".", "/"));
             if (0 < p && p < profileAnnos.length)
-                cs.annotations.prepend(List.of(profileAnnos[p]));
+                cs.prependAttributes(List.of(profileAnnos[p]));
             writeClass(pool, cs, writer);
         }
 
--- a/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java	Thu Jun 06 09:55:26 2013 -0700
+++ b/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java	Mon Jun 10 17:04:18 2013 -0700
@@ -1131,6 +1131,14 @@
 
     private static class TypeAnnotationFinder extends TreeScanner {
         public boolean foundTypeAnno = false;
+
+        @Override
+        public void scan(JCTree tree) {
+            if (foundTypeAnno || tree == null)
+                return;
+            super.scan(tree);
+        }
+
         public void visitAnnotation(JCAnnotation tree) {
             foundTypeAnno = foundTypeAnno || tree.hasTag(TYPE_ANNOTATION);
         }
--- a/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java	Thu Jun 06 09:55:26 2013 -0700
+++ b/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java	Mon Jun 10 17:04:18 2013 -0700
@@ -125,6 +125,13 @@
         return sb.toString();
     }
 
+    @Override
+    public String formatMessage(JCDiagnostic diag, Locale l) {
+        nameSimplifier = new ClassNameSimplifier();
+        preprocessDiagnostic(diag);
+        return super.formatMessage(diag, l);
+    }
+
     /**
      * Sets the type/symbol printer used by this formatter.
      * @param printer the rich printer to be set
--- a/src/share/classes/com/sun/tools/javadoc/Start.java	Thu Jun 06 09:55:26 2013 -0700
+++ b/src/share/classes/com/sun/tools/javadoc/Start.java	Mon Jun 10 17:04:18 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -156,21 +156,8 @@
         usage(true);
     }
 
-
-    /**
-     * Usage
-     */
-    private void usage(boolean exit) {
-        // RFE: it would be better to replace the following with code to
-        // write a header, then help for each option, then a footer.
-        messager.notice("main.usage");
-
-        // let doclet print usage information (does nothing on error)
-        if (docletInvoker != null) {
-            docletInvoker.optionLength("-help");
-        }
-
-        if (exit) exit();
+    void usage(boolean exit) {
+        usage("main.usage", "-help", null, exit);
     }
 
     @Override
@@ -178,11 +165,28 @@
         Xusage(true);
     }
 
-    /**
-     * Usage
-     */
-    private void Xusage(boolean exit) {
-        messager.notice("main.Xusage");
+    void Xusage(boolean exit) {
+        usage("main.Xusage", "-X", "main.Xusage.foot", exit);
+    }
+
+    private void usage(String main, String doclet, String foot, boolean exit) {
+        // RFE: it would be better to replace the following with code to
+        // write a header, then help for each option, then a footer.
+        messager.notice(main);
+
+        // let doclet print usage information (does nothing on error)
+        if (docletInvoker != null) {
+            // RFE: this is a pretty bad way to get the doclet to show
+            // help info. Moreover, the output appears on stdout,
+            // and <i>not</i> on any of the standard streams passed
+            // to javadoc, and in particular, not to the noticeWriter
+            // But, to fix this, we need to fix the Doclet API.
+            docletInvoker.optionLength(doclet);
+        }
+
+        if (foot != null)
+            messager.notice(foot);
+
         if (exit) exit();
     }
 
--- a/src/share/classes/com/sun/tools/javadoc/resources/javadoc.properties	Thu Jun 06 09:55:26 2013 -0700
+++ b/src/share/classes/com/sun/tools/javadoc/resources/javadoc.properties	Mon Jun 10 17:04:18 2013 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 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
@@ -27,35 +27,39 @@
 main.error={0} error
 main.warnings={0} warnings
 main.warning={0} warning
-main.usage=usage: javadoc [options] [packagenames] [sourcefiles] [@files]\n\
-  -overview <file>          Read overview documentation from HTML file\n\
-  -public                   Show only public classes and members\n\
-  -protected                Show protected/public classes and members (default)\n\
-  -package                  Show package/protected/public classes and members\n\
-  -private                  Show all classes and members\n\
-  -help                     Display command line options and exit\n\
-  -doclet <class>           Generate output via alternate doclet\n\
-  -docletpath <path>        Specify where to find doclet class files\n\
-  -sourcepath <pathlist>    Specify where to find source files\n\
-  -classpath <pathlist>     Specify where to find user class files\n\
-  -exclude <pkglist>        Specify a list of packages to exclude\n\
-  -subpackages <subpkglist> Specify subpackages to recursively load\n\
-  -breakiterator            Compute 1st sentence with BreakIterator\n\
-  -bootclasspath <pathlist> Override location of class files loaded\n\
-\t\t\t  by the bootstrap class loader\n\
-  -source <release>         Provide source compatibility with specified release\n\
-  -extdirs <dirlist>        Override location of installed extensions\n\
-  -verbose                  Output messages about what Javadoc is doing\n\
-  -locale <name>            Locale to be used, e.g. en_US or en_US_WIN\n\
-  -encoding <name>          Source file encoding name\n\
-  -quiet                    Do not display status messages\n\
-  -J<flag>                  Pass <flag> directly to the runtime system\n\
-  -X                        Print a synopsis of nonstandard options\n
+
+main.usage=Usage: javadoc [options] [packagenames] [sourcefiles] [@files]\n\
+\  -overview <file>                 Read overview documentation from HTML file\n\
+\  -public                          Show only public classes and members\n\
+\  -protected                       Show protected/public classes and members (default)\n\
+\  -package                         Show package/protected/public classes and members\n\
+\  -private                         Show all classes and members\n\
+\  -help                            Display command line options and exit\n\
+\  -doclet <class>                  Generate output via alternate doclet\n\
+\  -docletpath <path>               Specify where to find doclet class files\n\
+\  -sourcepath <pathlist>           Specify where to find source files\n\
+\  -classpath <pathlist>            Specify where to find user class files\n\
+\  -exclude <pkglist>               Specify a list of packages to exclude\n\
+\  -subpackages <subpkglist>        Specify subpackages to recursively load\n\
+\  -breakiterator                   Compute first sentence with BreakIterator\n\
+\  -bootclasspath <pathlist>        Override location of class files loaded\n\
+\                                   by the bootstrap class loader\n\
+\  -source <release>                Provide source compatibility with specified release\n\
+\  -extdirs <dirlist>               Override location of installed extensions\n\
+\  -verbose                         Output messages about what Javadoc is doing\n\
+\  -locale <name>                   Locale to be used, e.g. en_US or en_US_WIN\n\
+\  -encoding <name>                 Source file encoding name\n\
+\  -quiet                           Do not display status messages\n\
+\  -J<flag>                         Pass <flag> directly to the runtime system\n\
+\  -X                               Print a synopsis of nonstandard options and exit\n
+
 main.Xusage=\
-  -Xmaxerrs <number>        Set the maximum number of errors to print\n\
-  -Xmaxwarns <number>       Set the maximum number of warnings to print\n\
-\n\
+\  -Xmaxerrs <number>               Set the maximum number of errors to print\n\
+\  -Xmaxwarns <number>              Set the maximum number of warnings to print\n
+
+main.Xusage.foot=\
 These options are non-standard and subject to change without notice.
+
 main.option.already.seen=The {0} option may be specified no more than once.
 main.requires_argument=option {0} requires an argument.
 main.locale_first=option -locale must be first on the command line.
--- a/test/com/sun/javadoc/testHelpOption/TestHelpOption.java	Thu Jun 06 09:55:26 2013 -0700
+++ b/test/com/sun/javadoc/testHelpOption/TestHelpOption.java	Mon Jun 10 17:04:18 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -78,7 +78,6 @@
         {STANDARD_OUTPUT, "-tag "},
         {STANDARD_OUTPUT, "-taglet "},
         {STANDARD_OUTPUT, "-tagletpath "},
-        {STANDARD_OUTPUT, "-Xdocrootparent "},
         {STANDARD_OUTPUT, "-charset "},
         {STANDARD_OUTPUT, "-helpfile "},
         {STANDARD_OUTPUT, "-linksource "},
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/javadoc/testXOption/TestXOption.java	Mon Jun 10 17:04:18 2013 -0700
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2003, 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      8007687
+ * @summary  Make sure that the -X option works properly.
+ * @library  ../lib/
+ * @build    JavadocTester TestXOption
+ * @run main TestXOption
+ */
+
+public class TestXOption extends JavadocTester {
+
+    //Test information.
+    private static final String BUG_ID = "8007687";
+
+    //Javadoc arguments.
+    private static final String[] ARGS = new String[] {
+        "-d", BUG_ID, "-sourcepath", SRC_DIR, "-X",
+            SRC_DIR + FS + "TestXOption.java"
+    };
+
+    private static final String[] ARGS2 = new String[] {
+        "-d", BUG_ID, "-sourcepath", SRC_DIR,
+            SRC_DIR + FS + "TestXOption.java"
+    };
+
+    private static final String[][] TEST = {
+        {NOTICE_OUTPUT, "-Xmaxerrs "},
+        {NOTICE_OUTPUT, "-Xmaxwarns "},
+        {STANDARD_OUTPUT, "-Xdocrootparent "},
+        {STANDARD_OUTPUT, "-Xdoclint "},
+        {STANDARD_OUTPUT, "-Xdoclint:"},
+    };
+    private static final String[][] NEGATED_TEST = NO_TEST;
+
+    //The help option should not crash the doclet.
+    private static final int EXPECTED_EXIT_CODE = 0;
+
+    /**
+     * The entry point of the test.
+     * @param args the array of command line arguments.
+     */
+    public static void main(String[] args) {
+        TestXOption tester = new TestXOption();
+        int actualExitCode = run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.checkExitCode(EXPECTED_EXIT_CODE, actualExitCode);
+        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/tools/doclint/ResourceTest.java	Mon Jun 10 17:04:18 2013 -0700
@@ -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.
+ *
+ * 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 8006615
+ * @summary move remaining messages into resource bundle
+ */
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Locale;
+
+import com.sun.tools.doclint.DocLint;
+
+public class ResourceTest {
+    public static void main(String... args) throws Exception {
+        Locale prev = Locale.getDefault();
+        Locale.setDefault(Locale.ENGLISH);
+        try {
+            new ResourceTest().run();
+        } finally {
+           Locale.setDefault(prev);
+        }
+    }
+
+    public void run() throws Exception {
+        test(Arrays.asList("-help"),
+                Arrays.asList("Usage:", "Options"));
+        test(Arrays.asList("-foo"),
+                Arrays.asList("bad option: -foo"));
+    }
+
+    void test(List<String> opts, List<String> expects) throws Exception {
+        StringWriter sw = new StringWriter();
+        PrintWriter pw = new PrintWriter(sw);
+        try {
+            new DocLint().run(pw, opts.toArray(new String[opts.size()]));
+        } catch (DocLint.BadArgs e) {
+            pw.println("BadArgs: " + e.getMessage());
+        } catch (IOException e) {
+            pw.println("IOException: " + e.getMessage());
+        } finally {
+            pw.close();
+        }
+
+        String out = sw.toString();
+        if (!out.isEmpty()) {
+            System.err.println(out);
+        }
+
+        for (String e: expects) {
+            if (!out.contains(e))
+                throw new Exception("expected string not found: " + e);
+        }
+    }
+}
+
--- a/test/tools/doclint/html/ListTagsTest.java	Thu Jun 06 09:55:26 2013 -0700
+++ b/test/tools/doclint/html/ListTagsTest.java	Mon Jun 10 17:04:18 2013 -0700
@@ -1,33 +1,10 @@
 /*
- * 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 8006251
+ * @test /nodynamiccopyright/
+ * @bug 8006251 8013405
  * @summary test list tags
  * @library ..
  * @build DocLintTester
- * @run main DocLintTester -Xmsgs ListTagsTest.java
+ * @run main DocLintTester -Xmsgs -ref ListTagsTest.out ListTagsTest.java
  */
 
 /** */
@@ -35,6 +12,9 @@
     /**
      *  <dl> <dt> abc <dd> def </dl>
      *  <ol> <li> abc </ol>
+     *  <ol> <li value="1"> abc </ol>
+     *  <ol> <li value> bad </ol>
+     *  <ol> <li value="a"> bad </ol>
      *  <ul> <li> abc </ul>
      */
     public void supportedTags() { }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/doclint/html/ListTagsTest.out	Mon Jun 10 17:04:18 2013 -0700
@@ -0,0 +1,7 @@
+ListTagsTest.java:16: error: attribute lacks value
+     *  <ol> <li value> bad </ol>
+                 ^
+ListTagsTest.java:17: error: attribute value is not a number
+     *  <ol> <li value="a"> bad </ol>
+                 ^
+2 errors
--- a/test/tools/doclint/tool/RunTest.java	Thu Jun 06 09:55:26 2013 -0700
+++ b/test/tools/doclint/tool/RunTest.java	Mon Jun 10 17:04:18 2013 -0700
@@ -173,7 +173,7 @@
         pw.close();
         String out = sw.toString();
 
-        String expect = "no files given";
+        String expect = "No files given";
         if (!Objects.equals(out.trim(), expect)) {
             error("unexpected output");
             System.err.println("EXPECT>>" + expect + "<<");
--- a/test/tools/javac/6567415/T6567415.java	Thu Jun 06 09:55:26 2013 -0700
+++ b/test/tools/javac/6567415/T6567415.java	Mon Jun 10 17:04:18 2013 -0700
@@ -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
@@ -137,7 +137,7 @@
             }
         };
         t.start();
-        t.join(1000*10);
+        t.join(1000*60);
         System.out.println(t.getState());
         if (t.isAlive()) {
             throw new RuntimeException("Error: compilation is looping");
--- a/test/tools/javac/6889255/T6889255.java	Thu Jun 06 09:55:26 2013 -0700
+++ b/test/tools/javac/6889255/T6889255.java	Mon Jun 10 17:04:18 2013 -0700
@@ -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
@@ -429,9 +429,9 @@
         // -- no Code attribute for the LocalVariableTable attribute
         if ((v.owner.flags() & Flags.ABSTRACT) != 0)
             return "arg" + (i - 1);
-        // bridge methods use xN
+        // bridge methods use argN. No LVT for them anymore
         if ((v.owner.flags() & Flags.BRIDGE) != 0)
-            return "x" + (i - 1);
+            return "arg" + (i - 1);
 
         // The rest of this method assumes the local conventions in the test program
         Type t = v.type;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/Diagnostics/7116676/T7116676.java	Mon Jun 10 17:04:18 2013 -0700
@@ -0,0 +1,109 @@
+/*
+ * 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 7116676
+ * @summary RichDiagnosticFormatter throws NPE when formatMessage is called directly
+ */
+
+import com.sun.source.util.JavacTask;
+import com.sun.tools.javac.api.ClientCodeWrapper.Trusted;
+import com.sun.tools.javac.api.DiagnosticFormatter;
+import com.sun.tools.javac.api.JavacTaskImpl;
+import com.sun.tools.javac.util.Assert;
+import com.sun.tools.javac.util.JCDiagnostic;
+import com.sun.tools.javac.util.Log;
+import java.io.IOException;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Locale;
+import javax.tools.Diagnostic;
+import javax.tools.DiagnosticListener;
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileObject;
+import javax.tools.SimpleJavaFileObject;
+import javax.tools.ToolProvider;
+
+public class T7116676 {
+
+    public static void main(String[] args) throws Exception {
+        T7116676 test = new T7116676();
+        test.testThroughFormatterFormat();
+    }
+
+    static class JavaSource extends SimpleJavaFileObject {
+        private String text = "package test;\n" +
+                              "public class Test {\n" +
+                              "   private void t(java.util.List<? extends String> l) {\n" +
+                              "      t(java.util.Collections.singleton(l));\n" +
+                              "}  }";
+
+        public JavaSource() {
+            super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE);
+        }
+        @Override
+        public CharSequence getCharContent(boolean ignoreEncodingErrors) {
+            return text;
+        }
+    }
+
+    void assertEquals(String req, String found) {
+        if (!found.equals(req)) {
+            throw new AssertionError(String.format("Error. Found: \n\n%s ; Expected: \n\n%s", found, req));
+        }
+    }
+
+    public void testThroughFormatterFormat() throws IOException {
+        final JavaCompiler tool = ToolProvider.getSystemJavaCompiler();
+        DiagnosticChecker dc = new DiagnosticChecker("compiler.err.prob.found.req");
+        JavacTask ct = (JavacTask)tool.getTask(null, null, dc, null, null, Arrays.asList(new JavaSource()));
+        ct.analyze();
+        DiagnosticFormatter<JCDiagnostic> formatter =
+                Log.instance(((JavacTaskImpl) ct).getContext()).getDiagnosticFormatter();
+        String msg = formatter.formatMessage(dc.diag, Locale.getDefault());
+        //no redundant package qualifiers
+        Assert.check(msg.indexOf("java.") == -1, msg);
+    }
+
+    @Trusted
+    private static final class DiagnosticChecker implements DiagnosticListener<JavaFileObject> {
+
+        String expectedKey;
+        JCDiagnostic diag;
+
+        DiagnosticChecker(String expectedKey) {
+            this.expectedKey = expectedKey;
+        }
+
+        @Override
+        public void report(Diagnostic<? extends JavaFileObject> diagnostic) {
+            JCDiagnostic diag = (JCDiagnostic)diagnostic;
+            if (diagnostic.getCode().equals(expectedKey)) {
+                this.diag = diag;
+            }
+        }
+    }
+}
--- a/test/tools/javac/MethodParameters/ClassFileVisitor.java	Thu Jun 06 09:55:26 2013 -0700
+++ b/test/tools/javac/MethodParameters/ClassFileVisitor.java	Mon Jun 10 17:04:18 2013 -0700
@@ -21,10 +21,8 @@
  * questions.
  */
 
+import java.io.*;
 import com.sun.tools.classfile.*;
-import java.io.*;
-import javax.lang.model.element.*;
-import java.util.*;
 
 /**
  * The {@code ClassFileVisitor} reads a class file using the
@@ -150,6 +148,7 @@
         public int mNumParams;
         public boolean mSynthetic;
         public boolean mIsConstructor;
+        public boolean mIsBridge;
         public String prefix;
 
         void visitMethod(Method method, StringBuilder sb) throws Exception {
@@ -162,6 +161,7 @@
             mSynthetic = method.access_flags.is(AccessFlags.ACC_SYNTHETIC);
             mIsConstructor = mName.equals("<init>");
             prefix = cname + "." + mName + "() - ";
+            mIsBridge = method.access_flags.is(AccessFlags.ACC_BRIDGE);
 
             sb.append(cname).append(".").append(mName).append("(");
 
@@ -316,13 +316,16 @@
                         }
                         expect = "this\\$[0-n]*";
                     }
-                } else if (isAnon) {
-                    // not an implementation gurantee, but okay for now
-                    expect = "x[0-n]*";
                 }
             } else if (isEnum && mNumParams == 1 && index == 0 && mName.equals("valueOf")) {
                 expect = "name";
                 allowMandated = true;
+            } else if (mIsBridge) {
+                allowSynthetic = true;
+                /*  you can't expect an special name for bridges' parameters.
+                 *  The name of the original parameters are now copied.
+                 */
+                expect = null;
             }
             if (mandated) sb.append("!");
             if (synthetic) sb.append("!!");
--- a/test/tools/javac/MethodParameters/ReflectionVisitor.java	Thu Jun 06 09:55:26 2013 -0700
+++ b/test/tools/javac/MethodParameters/ReflectionVisitor.java	Mon Jun 10 17:04:18 2013 -0700
@@ -22,8 +22,6 @@
  */
 
 import java.io.*;
-import java.util.*;
-import java.net.*;
 import java.lang.reflect.*;
 
 /**
@@ -151,9 +149,6 @@
                     }
                     expect = "this\\$[0-n]*";
                 }
-            } else if (isAnon) {
-                // not an implementation gurantee, but okay for now
-                expect = "x[0-n]*";
             }
 
             // Check expected flags
@@ -253,7 +248,7 @@
                 String expect =  m.isSynthetic() ? ("arg" + i) : ((++c) + param);
                 param = p.getName();
                 sb.append(sep).append(param);
-                if (!expect.equals(param)) {
+                if (!m.isBridge() && !expect.equals(param)) {
                     error(prefix + "param[" + i + "]='"
                           + param + "' expected '" + expect + "'");
                     break;
--- a/test/tools/javac/MethodParameters/Tester.java	Thu Jun 06 09:55:26 2013 -0700
+++ b/test/tools/javac/MethodParameters/Tester.java	Mon Jun 10 17:04:18 2013 -0700
@@ -22,7 +22,6 @@
  */
 
 import java.io.*;
-import java.util.*;
 import java.lang.reflect.Constructor;
 
 /**
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/T6695379/AnnotationsAreNotCopiedToBridgeMethodsTest.java	Mon Jun 10 17:04:18 2013 -0700
@@ -0,0 +1,103 @@
+/*
+ * 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 6695379
+ * @summary Copy method annotations and parameter annotations to synthetic
+ * bridge methods
+ * @run main AnnotationsAreNotCopiedToBridgeMethodsTest
+ */
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+import java.io.BufferedInputStream;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+import com.sun.tools.classfile.AccessFlags;
+import com.sun.tools.classfile.Attribute;
+import com.sun.tools.classfile.Attributes;
+import com.sun.tools.classfile.ClassFile;
+import com.sun.tools.classfile.Method;
+import com.sun.tools.javac.util.Assert;
+
+public class AnnotationsAreNotCopiedToBridgeMethodsTest {
+
+    public static void main(String[] args) throws Exception {
+        new AnnotationsAreNotCopiedToBridgeMethodsTest().run();
+    }
+
+    void run() throws Exception {
+        checkClassFile(Paths.get(System.getProperty("test.classes"),
+                this.getClass().getSimpleName() + "$CovariantReturnType.class"));
+        checkClassFile(Paths.get(System.getProperty("test.classes"),
+                this.getClass().getSimpleName() +
+                "$CovariantReturnType$VisibilityChange.class"));
+    }
+
+    void checkClassFile(final Path cfilePath) throws Exception {
+        ClassFile classFile = ClassFile.read(
+                new BufferedInputStream(Files.newInputStream(cfilePath)));
+        for (Method method : classFile.methods) {
+            if (method.access_flags.is(AccessFlags.ACC_BRIDGE)) {
+                checkForAttr(method.attributes,
+                        "Annotations hasn't been copied to bridge method",
+                        Attribute.RuntimeVisibleAnnotations,
+                        Attribute.RuntimeVisibleParameterAnnotations);
+            }
+        }
+    }
+
+    void checkForAttr(Attributes attrs, String errorMsg, String... attrNames) {
+        for (String attrName : attrNames) {
+            Assert.checkNonNull(attrs.get(attrName), errorMsg);
+        }
+    }
+
+    @Target(value = {ElementType.PARAMETER})
+    @Retention(RetentionPolicy.RUNTIME)
+    @interface ParamAnnotation {}
+
+    @Target(value = {ElementType.METHOD})
+    @Retention(RetentionPolicy.RUNTIME)
+    @interface MethodAnnotation {}
+
+    abstract class T<A,B> {
+        B m(A a){return null;}
+    }
+
+    class CovariantReturnType extends T<Integer, Integer> {
+        @MethodAnnotation
+        Integer m(@ParamAnnotation Integer i) {
+            return i;
+        }
+
+        public class VisibilityChange extends CovariantReturnType {}
+
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/T7165659/InnerClassAttrMustNotHaveStrictFPFlagTest.java	Mon Jun 10 17:04:18 2013 -0700
@@ -0,0 +1,71 @@
+/*
+ * 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 7165659
+ * @summary javac incorrectly sets strictfp access flag on inner-classes
+ */
+
+import java.io.File;
+
+import com.sun.tools.classfile.AccessFlags;
+import com.sun.tools.classfile.Attribute;
+import com.sun.tools.classfile.ClassFile;
+import com.sun.tools.classfile.InnerClasses_attribute;
+import com.sun.tools.classfile.InnerClasses_attribute.Info;
+import com.sun.tools.javac.util.Assert;
+
+public class InnerClassAttrMustNotHaveStrictFPFlagTest {
+
+    public static void main(String[] args) throws Exception {
+        new InnerClassAttrMustNotHaveStrictFPFlagTest().run();
+    }
+
+    private void run() throws Exception {
+        File classPath = new File(System.getProperty("test.classes"), getClass().getSimpleName() + ".class");
+        analyzeClassFile(classPath);
+    }
+
+    void analyzeClassFile(File path) throws Exception {
+        ClassFile classFile = ClassFile.read(path);
+        InnerClasses_attribute innerClasses =
+                (InnerClasses_attribute) classFile.attributes.get(Attribute.InnerClasses);
+        for (Info classInfo : innerClasses.classes) {
+            Assert.check(!classInfo.inner_class_access_flags.is(AccessFlags.ACC_STRICT),
+                    "Inner classes attribute must not have the ACC_STRICT flag set");
+        }
+    }
+
+    strictfp void m() {
+        new Runnable() {
+            @Override
+            public void run() {}
+        };
+    }
+
+    static strictfp class Strict extends InnerClassAttrMustNotHaveStrictFPFlagTest {}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/T7179353/GenericsAndTWRCompileErrorTest.java	Mon Jun 10 17:04:18 2013 -0700
@@ -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.
+ */
+
+/*
+ * @test
+ * @bug 7179353
+ * @summary try-with-resources fails to compile with generic exception parameters
+ * @compile GenericsAndTWRCompileErrorTest.java
+ */
+
+public class GenericsAndTWRCompileErrorTest {
+
+    public static class Resource<E extends Exception> implements AutoCloseable {
+        public void close() throws E { }
+    }
+
+    public <E extends Exception> void test() throws E {
+        try (Resource<E> r = new Resource<E>()) {
+
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/T8010737/ParameterNamesAreNotCopiedToAnonymousInitTest.java	Mon Jun 10 17:04:18 2013 -0700
@@ -0,0 +1,239 @@
+/*
+ * 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 8010737
+ * @summary javac, known parameter's names should be copied to automatically
+ * generated constructors for inner classes
+ * @run main ParameterNamesAreNotCopiedToAnonymousInitTest check_class_file check_init_symbol
+ */
+
+import java.io.File;
+import java.io.IOException;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+import java.nio.file.Paths;
+import java.util.Arrays;
+
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileObject;
+import javax.tools.StandardJavaFileManager;
+import javax.tools.ToolProvider;
+
+import com.sun.source.tree.CompilationUnitTree;
+import com.sun.source.tree.Tree;
+import com.sun.source.util.JavacTask;
+import com.sun.source.util.TaskEvent;
+import com.sun.source.util.TaskListener;
+import com.sun.tools.classfile.ClassFile;
+import com.sun.tools.classfile.Method;
+import com.sun.tools.javac.api.BasicJavacTask;
+import com.sun.tools.javac.code.Attribute.Compound;
+import com.sun.tools.javac.code.Symbol.ClassSymbol;
+import com.sun.tools.javac.code.Symbol.VarSymbol;
+import com.sun.tools.javac.tree.JCTree;
+import com.sun.tools.javac.tree.TreeScanner;
+import com.sun.tools.javac.util.Assert;
+import com.sun.tools.javac.util.Context;
+import com.sun.tools.javac.util.List;
+import com.sun.tools.javac.util.Names;
+
+public class ParameterNamesAreNotCopiedToAnonymousInitTest {
+
+    static final String noParamsErrorMsg =
+            "Test most be invoked with at least one parameter: check_class_file " +
+            "and/or check_init_symbol";
+    static final String wrongParamsErrorMsg =
+            "Accepted arguments are: check_class_file and check_init_symbol";
+    static final String paramNameNotCopiedAssertionMsg =
+            "The param name hasn't been copied to the init method";
+    static final String noAnnotationsForParameterMsg =
+            "No annotations for seek parameter";
+    static final String seekMethodNotFound =
+            "The seek init method was not found or conditions were not met";
+    static final String nonNullParamPositionsMsg =
+            "Parameter positions shold not be null";
+    static final String compilationFailed =
+            "Compilation failed";
+    static final String seekMethodNotFoundMsg =
+        "The seek method was not found";
+
+    static final String ParamAnnotationClassName =
+            ParameterNamesAreNotCopiedToAnonymousInitTest.class.getSimpleName() + "." +
+            ParamAnnotation.class.getSimpleName();
+
+    public static void main(String[] args) throws Exception {
+        if (args.length == 0) {
+            throw new Error(noParamsErrorMsg);
+        }
+        new ParameterNamesAreNotCopiedToAnonymousInitTest().run(args);
+    }
+
+    void run(String[] args) throws Exception {
+        for (String arg : args) {
+            if (arg.equals("check_class_file")) {
+                checkClassFile(new File(Paths.get(System.getProperty("test.classes"),
+                        this.getClass().getName() + "$initParams$1.class").toUri()), 1);
+                checkClassFile(new File(Paths.get(System.getProperty("test.classes"),
+                        this.getClass().getName() + "$Generics$1.class").toUri()), 2);
+            } else if (arg.equals("check_init_symbol")) {
+                checkInitSymbol("m1", Arrays.asList(0), Arrays.asList("i"));
+                checkInitSymbol("m2", Arrays.asList(0, 1), Arrays.asList("t1", "t2"));
+            } else {
+                error(wrongParamsErrorMsg);
+            }
+        }
+    }
+
+    void checkClassFile(final File cfile, int numberOfParams) throws Exception {
+        ClassFile classFile = ClassFile.read(cfile);
+        boolean methodFound = false;
+        for (Method method : classFile.methods) {
+            if (method.getName(classFile.constant_pool).equals("<init>")) {
+                methodFound = true;
+            }
+        }
+        Assert.check(methodFound, seekMethodNotFoundMsg);
+    }
+
+    /*  This method expect a non-null ordered list of integers, listing the
+     *  position of the parameters to be checked on the init method. Position 0
+     *  corresponds to the first parameter.
+     *
+     *  As we are looking for a constructor of an anonymous class, the
+     *  classOwnerName parameter must be the name of the method where the
+     *  anonymous class is declared.
+     */
+    void checkInitSymbol(
+            final String classOwnerName,
+            final java.util.List<Integer> paramsToCheck,
+            final java.util.List<String> paramNames)
+            throws IOException {
+        Assert.checkNonNull(paramsToCheck, nonNullParamPositionsMsg);
+        JavaCompiler c = ToolProvider.getSystemJavaCompiler();
+        StandardJavaFileManager fm = c.getStandardFileManager(null, null, null);
+        Iterable<? extends JavaFileObject> fos =
+                fm.getJavaFileObjectsFromFiles(
+                Arrays.asList(new File(System.getProperty("test.src"),
+                this.getClass().getName() + ".java")));
+        JavacTask task = (JavacTask) c.getTask(null, fm, null,
+                Arrays.asList("-d", System.getProperty("user.dir")), null, fos);
+
+        BasicJavacTask impl = (BasicJavacTask)task;
+        Context context = impl.getContext();
+        final Names names = Names.instance(context);
+
+        task.addTaskListener(new TaskListener() {
+
+            @Override
+            public void started(TaskEvent e) {}
+
+            @Override
+            public void finished(TaskEvent e) {
+                class TheTreeScanner extends TreeScanner {
+                    boolean foundAndCorrect = false;
+
+                    @Override
+                    public void visitMethodDef(JCTree.JCMethodDecl tree) {
+                        ClassSymbol clazz = (ClassSymbol)tree.sym.owner;
+                        if (clazz.owner.name.toString().equals(classOwnerName) &&
+                            tree.sym.name == names.init) {
+
+                            int currentParamPos = 0;
+                            int paramArrayIndex = 0;
+
+                            List<VarSymbol> params = tree.sym.params;
+                            while (params.nonEmpty() && paramArrayIndex < paramsToCheck.size()) {
+                                VarSymbol param = params.head;
+                                if (currentParamPos == paramsToCheck.get(paramArrayIndex)) {
+                                    if (!param.name.toString()
+                                            .equals(paramNames.get(paramArrayIndex))) {
+                                        error(paramNameNotCopiedAssertionMsg);
+                                    }
+                                    paramArrayIndex++;
+                                }
+                                currentParamPos++;
+                                params = params.tail;
+                            }
+                            foundAndCorrect = paramArrayIndex >= paramsToCheck.size();
+                        }
+                        super.visitMethodDef(tree);
+                    }
+                }
+
+                if (e.getKind() == TaskEvent.Kind.ANALYZE) {
+                    CompilationUnitTree compUnitTree = e.getCompilationUnit();
+                    boolean foundAndCorrect = false;
+                    for (Tree tree : compUnitTree.getTypeDecls()) {
+                        TheTreeScanner scanner = new TheTreeScanner();
+                        scanner.scan((JCTree) tree);
+                        foundAndCorrect = foundAndCorrect | scanner.foundAndCorrect;
+                    }
+                    if (!foundAndCorrect) {
+                        error(seekMethodNotFound);
+                    }
+                }
+            }
+        });
+
+        if (!task.call()) {
+            error(compilationFailed);
+        }
+    }
+
+    void error(String msg) {
+        throw new AssertionError(msg);
+    }
+
+    @Target(value = {ElementType.PARAMETER})
+    @interface ParamAnnotation {}
+
+    /*  If more cases are added in the future, it should be taken into account
+     *  that method checkInitSymbol locates the inner class looking for its
+     *  container method, which in the cases below are m1 and m2. So new cases
+     *  must have different names for container methods or method checkInitSymbol
+     *  should be changed.
+     */
+    public class initParams {
+        public initParams(@ParamAnnotation int i) {}
+
+        public void m1() {
+            new initParams(2) {};
+        }
+    }
+
+    class Generics<T1> {
+        T1 obj1;
+        Object obj2;
+        <T2> Generics(@ParamAnnotation T1 t1, @ParamAnnotation T2 t2) {
+            obj1 = t1;
+            obj2 = t2;
+        }
+
+        void m2() {
+            Generics<Integer> a = new <String>Generics<Integer>(
+                    new Integer(11), "foo") {};
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/generics/inference/8015505/T8015505.java	Mon Jun 10 17:04:18 2013 -0700
@@ -0,0 +1,18 @@
+/**
+ * @test /nodynamiccopyright/
+ * @bug 8015505
+ * @summary Spurious inference error when return type of generic method requires unchecked conversion to target
+ * @compile/fail/ref=T8015505.out -Xlint:-options -source 7 -XDrawDiagnostics T8015505.java
+ * @compile T8015505.java
+ */
+
+import java.util.List;
+
+class T8015505 {
+
+    <Z> List m() { return null; }
+
+    void test() {
+        List<?> l = m();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/generics/inference/8015505/T8015505.out	Mon Jun 10 17:04:18 2013 -0700
@@ -0,0 +1,2 @@
+T8015505.java:16:22: compiler.err.prob.found.req: (compiler.misc.infer.no.conforming.instance.exists: Z, java.util.List, java.util.List<?>)
+1 error
--- a/test/tools/javac/generics/rawOverride/7062745/GenericOverrideTest.java	Thu Jun 06 09:55:26 2013 -0700
+++ b/test/tools/javac/generics/rawOverride/7062745/GenericOverrideTest.java	Mon Jun 10 17:04:18 2013 -0700
@@ -46,6 +46,17 @@
     extends JavacTestingAbstractThreadedTest
     implements Runnable {
 
+    enum SourceLevel {
+        SOURCE_7("-source", "7"),
+        SOURCE_DEFAULT();
+
+        String[] opts;
+
+        SourceLevel(String... opts) {
+            this.opts = opts;
+        }
+    }
+
     enum SignatureKind {
         NON_GENERIC(""),
         GENERIC("<X>");
@@ -112,12 +123,13 @@
             }
         }
 
-        boolean assignableTo(TypeArgumentKind that, SignatureKind sig) {
+        boolean assignableTo(TypeArgumentKind that, SignatureKind sig, SourceLevel level) {
             switch (this) {
                 case NONE:
                     //this case needs to workaround to javac's impl of 15.12.2.8 being too strict
-                    //ideally should be just 'return true' (see 7067746)
-                    return sig == SignatureKind.NON_GENERIC || that == NONE;
+                    //ideally should be just 'return true' (see 7067746/8015505)
+                    return level == SourceLevel.SOURCE_DEFAULT ||
+                            sig == SignatureKind.NON_GENERIC || that == NONE;
                 case UNBOUND:
                     return that == this || that == NONE;
                 case INTEGER:
@@ -143,10 +155,12 @@
                                     for (TypeArgumentKind ta3 : TypeArgumentKind.values()) {
                                         if (!ta3.compatibleWith(SignatureKind.NON_GENERIC))
                                             continue;
-                                        pool.execute(
-                                                new GenericOverrideTest(sig1,
-                                                rt1, ta1, sig2, rt2,
-                                                ta2, rt3, ta3));
+                                        for (SourceLevel level : SourceLevel.values()) {
+                                            pool.execute(
+                                                    new GenericOverrideTest(sig1,
+                                                    rt1, ta1, sig2, rt2,
+                                                    ta2, rt3, ta3, level));
+                                        }
                                     }
                                 }
                             }
@@ -162,12 +176,13 @@
     SignatureKind sig1, sig2;
     ReturnTypeKind rt1, rt2, rt3;
     TypeArgumentKind ta1, ta2, ta3;
+    SourceLevel level;
     JavaSource source;
     DiagnosticChecker diagChecker;
 
     GenericOverrideTest(SignatureKind sig1, ReturnTypeKind rt1, TypeArgumentKind ta1,
             SignatureKind sig2, ReturnTypeKind rt2, TypeArgumentKind ta2,
-            ReturnTypeKind rt3, TypeArgumentKind ta3) {
+            ReturnTypeKind rt3, TypeArgumentKind ta3, SourceLevel level) {
         this.sig1 = sig1;
         this.sig2 = sig2;
         this.rt1 = rt1;
@@ -176,6 +191,7 @@
         this.ta1 = ta1;
         this.ta2 = ta2;
         this.ta3 = ta3;
+        this.level = level;
         this.source = new JavaSource();
         this.diagChecker = new DiagnosticChecker();
     }
@@ -213,7 +229,8 @@
     @Override
     public void run() {
         JavacTask ct = (JavacTask)comp.getTask(null, fm.get(), diagChecker,
-                null, null, Arrays.asList(source));
+                level.opts != null ? Arrays.asList(level.opts) : null,
+                null, Arrays.asList(source));
         try {
             ct.analyze();
         } catch (Throwable ex) {
@@ -271,7 +288,7 @@
             SignatureKind mssig = mostSpecific == 1 ? sig1 : sig2;
 
             if (!msrt.moreSpecificThan(rt3) ||
-                    !msta.assignableTo(ta3, mssig)) {
+                    !msta.assignableTo(ta3, mssig, level)) {
                 errorExpected = true;
             }
         }
--- a/test/tools/javac/lambda/TargetType53.java	Thu Jun 06 09:55:26 2013 -0700
+++ b/test/tools/javac/lambda/TargetType53.java	Mon Jun 10 17:04:18 2013 -0700
@@ -26,7 +26,6 @@
  * @bug 8007464
  * @summary Add graph inference support
  *          smoke test for graph inference
- * @ignore  8008682: Core stream API classes
  * @compile TargetType53.java
  */
 import java.util.*;
--- a/test/tools/javac/lambda/TargetType54.java	Thu Jun 06 09:55:26 2013 -0700
+++ b/test/tools/javac/lambda/TargetType54.java	Mon Jun 10 17:04:18 2013 -0700
@@ -26,7 +26,6 @@
  * @bug 8007464
  * @summary Add graph inference support
  *          smoke test for graph inference
- * @ignore  8008682: Core stream API classes
  * @compile TargetType54.java
  */
 import java.util.stream.*;
--- a/test/tools/javac/lambda/TargetType58.java	Thu Jun 06 09:55:26 2013 -0700
+++ b/test/tools/javac/lambda/TargetType58.java	Mon Jun 10 17:04:18 2013 -0700
@@ -26,7 +26,6 @@
  * @bug 8007464
  * @summary Add graph inference support
  *          more smoke tests for graph inference
- * @ignore  8008682: Core stream API classes
  * @compile TargetType58.java
  */
 import java.util.*;
--- a/test/tools/javac/lambda/TargetType59.java	Thu Jun 06 09:55:26 2013 -0700
+++ b/test/tools/javac/lambda/TargetType59.java	Mon Jun 10 17:04:18 2013 -0700
@@ -26,7 +26,6 @@
  * @bug 8007464
  * @summary Add graph inference support
  *          more smoke tests for graph inference
- * @ignore  8008682: Core stream API classes
  * @compile TargetType59.java
  */
 import java.util.*;
--- a/test/tools/javac/lambda/TargetType62.java	Thu Jun 06 09:55:26 2013 -0700
+++ b/test/tools/javac/lambda/TargetType62.java	Mon Jun 10 17:04:18 2013 -0700
@@ -26,7 +26,6 @@
  * @bug 8007464
  * @summary Add graph inference support
  *          check that new wildcards inference strategy doesn't run into 7190296
- * @ignore  8008682: Core stream API classes
  * @compile TargetType62.java
  */
 import java.util.*;
--- a/test/tools/javac/lib/DPrinter.java	Thu Jun 06 09:55:26 2013 -0700
+++ b/test/tools/javac/lib/DPrinter.java	Mon Jun 10 17:04:18 2013 -0700
@@ -403,7 +403,7 @@
                 printType("type", sym.type, Details.SUMMARY);
                 printType("erasure", sym.erasure_field, Details.SUMMARY);
                 sym.accept(symVisitor, null);
-                printAnnotations("annotations", sym.annotations, Details.SUMMARY);
+                printAnnotations("annotations", sym.getAnnotations(), Details.SUMMARY);
                 indent(-1);
             }
         }