changeset 2343:144fe72348c5

merge with jdk8-b103
author mcimadamore
date Thu, 22 Aug 2013 15:37:58 +0100
parents 373187acfa45 dd4a00c220c6
children a4b2be6ba7cf
files .hgtags make/build.properties src/share/classes/com/sun/source/util/DocTrees.java src/share/classes/com/sun/source/util/TreePath.java src/share/classes/com/sun/tools/classfile/Attribute.java src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java src/share/classes/com/sun/tools/javac/api/JavacTrees.java src/share/classes/com/sun/tools/javac/code/Attribute.java src/share/classes/com/sun/tools/javac/code/Flags.java src/share/classes/com/sun/tools/javac/code/Kinds.java src/share/classes/com/sun/tools/javac/code/Printer.java src/share/classes/com/sun/tools/javac/code/Scope.java src/share/classes/com/sun/tools/javac/code/Symbol.java src/share/classes/com/sun/tools/javac/code/Symtab.java src/share/classes/com/sun/tools/javac/code/Type.java src/share/classes/com/sun/tools/javac/code/TypeTag.java src/share/classes/com/sun/tools/javac/code/Types.java src/share/classes/com/sun/tools/javac/comp/Annotate.java src/share/classes/com/sun/tools/javac/comp/Attr.java src/share/classes/com/sun/tools/javac/comp/Check.java src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java src/share/classes/com/sun/tools/javac/comp/Flow.java src/share/classes/com/sun/tools/javac/comp/Infer.java src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java src/share/classes/com/sun/tools/javac/comp/MemberEnter.java src/share/classes/com/sun/tools/javac/comp/Resolve.java src/share/classes/com/sun/tools/javac/comp/TransTypes.java src/share/classes/com/sun/tools/javac/jvm/Code.java src/share/classes/com/sun/tools/javac/jvm/Gen.java src/share/classes/com/sun/tools/javac/main/Main.java src/share/classes/com/sun/tools/javac/model/JavacTypes.java src/share/classes/com/sun/tools/javac/parser/JavacParser.java src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java src/share/classes/com/sun/tools/javac/resources/compiler.properties src/share/classes/com/sun/tools/javac/tree/JCTree.java src/share/classes/com/sun/tools/javac/tree/Pretty.java src/share/classes/com/sun/tools/javac/tree/TreeMaker.java src/share/classes/com/sun/tools/javac/util/Names.java src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java src/share/classes/com/sun/tools/javah/JavahTask.java src/share/classes/com/sun/tools/javap/AttributeWriter.java src/share/classes/com/sun/tools/javap/JavapTask.java src/share/classes/javax/lang/model/SourceVersion.java test/tools/javac/Diagnostics/compressed/T8020286.java test/tools/javac/api/6437999/Utf8.java test/tools/javac/conditional/T8016702.java test/tools/javac/generics/6723444/T6723444_1.out test/tools/javac/generics/6723444/T6723444_2.out test/tools/javac/generics/7015430/T7015430_1.out test/tools/javac/generics/7015430/T7015430_2.out test/tools/javac/generics/bridges/BridgeHarness.java test/tools/javac/generics/bridges/tests/TestNoBridgeInSiblingsSuper.java test/tools/javac/generics/bridges/tests/TestNoDuplicateBridges01.java test/tools/javac/generics/diamond/6939780/T6939780.java test/tools/javac/generics/inference/8020149/T8020149.java test/tools/javac/lambda/8016081/T8016081.java test/tools/javac/lambda/8019480/T8019480.java test/tools/javac/lambda/8020147/T8020147.java test/tools/javac/lambda/8020804/T8020804.java test/tools/javac/lambda/8020843/T8020843a.java test/tools/javac/lambda/8020843/T8020843a.out test/tools/javac/lambda/8020843/T8020843b.java test/tools/javac/lambda/8020843/T8020843b.out test/tools/javac/lambda/LambdaConv01.java test/tools/javac/lambda/LambdaExpr15.java test/tools/javac/lambda/MethodReference28.out test/tools/javac/lambda/MethodReference70.java test/tools/javac/lambda/MethodReference71.java test/tools/javac/lambda/MethodReference72.java test/tools/javac/lambda/MethodReference72.out test/tools/javac/lambda/NestedCapture01.java test/tools/javac/lambda/NestedCapture02.java test/tools/javac/lambda/TargetType36.java test/tools/javac/lambda/TargetType60.out test/tools/javac/lambda/TargetType63.java test/tools/javac/lambda/TargetType76.java test/tools/javac/lambda/bridge/TestMetafactoryBridges.java test/tools/javac/lambdaShapes/org/openjdk/tests/vm/DefaultMethodsTest.java test/tools/javac/limits/NumArgs1.java test/tools/javac/limits/NumArgs2.java test/tools/javac/limits/NumArgs3.java test/tools/javac/limits/NumArgs4.java test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java test/tools/javac/resolve/ResolveHarness.java
diffstat 223 files changed, 4602 insertions(+), 2937 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Thu Aug 22 13:51:34 2013 +0100
+++ b/.hgtags	Thu Aug 22 15:37:58 2013 +0100
@@ -222,3 +222,10 @@
 48c6e6ab7c815fd41d747f0218f8041c22f3a460 jdk8-b94
 4cb1136231275a1f8af53f5bfdef0b488e4b5bab jdk8-b95
 988aef3a8c3adac482363293f65e77ec4c5ce98d jdk8-b96
+6a11a81a8824c17f6cd2ec8f8492e1229b694e96 jdk8-b97
+ce5a90df517bdceb2739d7dd3e6764b070def802 jdk8-b98
+6d85acab769eb79bc058f5640fa86a6ef096a583 jdk8-b99
+82f68da70e471ee5640016e3f38c014347a5c785 jdk8-b100
+0324dbf07b0f1cc51ad9fa18976489d02d23b60d jdk8-b101
+453a305e116507847cc6577b80b4d9794bcb08bf jdk8-b102
+76cfe7c61f2575ea5400845b8e80dab6f4b1d7d0 jdk8-b103
--- a/make/build.properties	Thu Aug 22 13:51:34 2013 +0100
+++ b/make/build.properties	Thu Aug 22 15:37:58 2013 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 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
@@ -44,7 +44,7 @@
 target.java = ${target.java.home}/bin/java
 
 # Version info -- override as needed
-jdk.version = 1.7.0
+jdk.version = 1.8.0
 build.number = b00
 milestone = internal
 
@@ -60,8 +60,8 @@
 bootstrap.full.version = ${bootstrap.release}-${build.number}
 
 # options for the <javac> tasks used to compile the tools
-javac.source = 7
-javac.target = 7
+javac.source = 8
+javac.target = 8
 javac.debug = true
 javac.debuglevel = source,lines
 javac.no.jdk.warnings = -XDignore.symbol.file=true
--- a/src/share/classes/com/sun/source/util/DocTrees.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/source/util/DocTrees.java	Thu Aug 22 15:37:58 2013 +0100
@@ -30,7 +30,6 @@
 import javax.tools.JavaCompiler.CompilationTask;
 
 import com.sun.source.doctree.DocCommentTree;
-import com.sun.source.doctree.ReferenceTree;
 import javax.tools.Diagnostic;
 
 /**
--- a/src/share/classes/com/sun/source/util/TreePath.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/source/util/TreePath.java	Thu Aug 22 15:37:58 2013 +0100
@@ -125,18 +125,25 @@
         return parent;
     }
 
+    /**
+     *  Iterates from leaves to root.
+     */
+    @Override
     public Iterator<Tree> iterator() {
         return new Iterator<Tree>() {
+            @Override
             public boolean hasNext() {
                 return next != null;
             }
 
+            @Override
             public Tree next() {
                 Tree t = next.leaf;
                 next = next.parent;
                 return t;
             }
 
+            @Override
             public void remove() {
                 throw new UnsupportedOperationException();
             }
--- a/src/share/classes/com/sun/tools/classfile/Attribute.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/classfile/Attribute.java	Thu Aug 22 15:37:58 2013 +0100
@@ -77,10 +77,12 @@
 
         public Attribute createAttribute(ClassReader cr, int name_index, byte[] data)
                 throws IOException {
-            if (standardAttributes == null)
+            if (standardAttributes == null) {
                 init();
+            }
 
             ConstantPool cp = cr.getConstantPool();
+            String reasonForDefaultAttr;
             try {
                 String name = cp.getUTF8Value(name_index);
                 Class<? extends Attribute> attrClass = standardAttributes.get(name);
@@ -90,14 +92,18 @@
                         Constructor<? extends Attribute> constr = attrClass.getDeclaredConstructor(constrArgTypes);
                         return constr.newInstance(new Object[] { cr, name_index, data.length });
                     } catch (Throwable t) {
+                        reasonForDefaultAttr = t.toString();
                         // fall through and use DefaultAttribute
                         // t.printStackTrace();
                     }
+                } else {
+                    reasonForDefaultAttr = "unknown attribute";
                 }
             } catch (ConstantPoolException e) {
+                reasonForDefaultAttr = e.toString();
                 // fall through and use DefaultAttribute
             }
-            return new DefaultAttribute(cr, name_index, data);
+            return new DefaultAttribute(cr, name_index, data, reasonForDefaultAttr);
         }
 
         protected void init() {
--- a/src/share/classes/com/sun/tools/classfile/ClassFile.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/classfile/ClassFile.java	Thu Aug 22 15:37:58 2013 +0100
@@ -26,9 +26,9 @@
 package com.sun.tools.classfile;
 
 import java.io.File;
-import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.nio.file.Files;
 import java.nio.file.Path;
 
 import static com.sun.tools.classfile.AccessFlags.*;
@@ -44,26 +44,24 @@
 public class ClassFile {
     public static ClassFile read(File file)
             throws IOException, ConstantPoolException {
-        return read(file, new Attribute.Factory());
+        return read(file.toPath(), new Attribute.Factory());
     }
 
-    public static ClassFile read(Path path)
+    public static ClassFile read(Path input)
             throws IOException, ConstantPoolException {
-        return read(path.toFile(), new Attribute.Factory());
+        return read(input, new Attribute.Factory());
+    }
+
+    public static ClassFile read(Path input, Attribute.Factory attributeFactory)
+            throws IOException, ConstantPoolException {
+        try (InputStream in = Files.newInputStream(input)) {
+            return new ClassFile(in, attributeFactory);
+        }
     }
 
     public static ClassFile read(File file, Attribute.Factory attributeFactory)
             throws IOException, ConstantPoolException {
-        FileInputStream in = new FileInputStream(file);
-        try {
-            return new ClassFile(in, attributeFactory);
-        } finally {
-            try {
-                in.close();
-            } catch (IOException e) {
-                // ignore
-            }
-        }
+        return read(file.toPath(), attributeFactory);
     }
 
     public static ClassFile read(InputStream in)
--- a/src/share/classes/com/sun/tools/classfile/DefaultAttribute.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/classfile/DefaultAttribute.java	Thu Aug 22 15:37:58 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,13 +33,24 @@
  */
 public class DefaultAttribute extends Attribute {
     DefaultAttribute(ClassReader cr, int name_index, byte[] data) {
+        this(cr, name_index, data, null);
+    }
+
+    DefaultAttribute(ClassReader cr, int name_index, byte[] data, String reason) {
         super(name_index, data.length);
         info = data;
+        this.reason = reason;
     }
 
     public DefaultAttribute(ConstantPool constant_pool, int name_index, byte[] info) {
+        this(constant_pool, name_index, info, null);
+    }
+
+    public DefaultAttribute(ConstantPool constant_pool, int name_index,
+            byte[] info, String reason) {
         super(name_index, info.length);
         this.info = info;
+        this.reason = reason;
     }
 
     public <R, P> R accept(Visitor<R, P> visitor, P p) {
@@ -47,4 +58,7 @@
     }
 
     public final byte[] info;
+    /** Why did we need to generate a DefaultAttribute
+     */
+    public final String reason;
 }
--- a/src/share/classes/com/sun/tools/classfile/SourceDebugExtension_attribute.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/classfile/SourceDebugExtension_attribute.java	Thu Aug 22 15:37:58 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,7 @@
 import java.io.ByteArrayInputStream;
 import java.io.DataInputStream;
 import java.io.IOException;
+import java.nio.charset.Charset;
 
 /**
  * See JVMS, section 4.8.15.
@@ -38,6 +39,8 @@
  *  deletion without notice.</b>
  */
 public class SourceDebugExtension_attribute extends Attribute {
+    private static final Charset UTF8 = Charset.forName("UTF-8");
+
     SourceDebugExtension_attribute(ClassReader cr, int name_index, int length) throws IOException {
         super(name_index, length);
         debug_extension = new byte[attribute_length];
@@ -55,12 +58,7 @@
     }
 
     public String getValue() {
-        DataInputStream d  = new DataInputStream(new ByteArrayInputStream(debug_extension));
-        try {
-            return d.readUTF();
-        } catch (IOException e) {
-            return null;
-        }
+        return new String(debug_extension, UTF8);
     }
 
     public <R, D> R accept(Visitor<R, D> visitor, D data) {
--- a/src/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java	Thu Aug 22 15:37:58 2013 +0100
@@ -101,7 +101,7 @@
             Content tdSummary) {
         ExecutableMemberDoc emd = (ExecutableMemberDoc)member;
         String name = emd.name();
-        Content strong = HtmlTree.STRONG(
+        Content strong = HtmlTree.SPAN(HtmlStyle.strong,
                 writer.getDocLink(context, cd, (MemberDoc) emd,
                 name, false));
         Content code = HtmlTree.CODE(strong);
--- a/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java	Thu Aug 22 15:37:58 2013 +0100
@@ -225,7 +225,7 @@
      */
     protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
             Content tdSummary) {
-        Content strong = HtmlTree.STRONG(
+        Content strong = HtmlTree.SPAN(HtmlStyle.strong,
                 writer.getDocLink(context, (MemberDoc) member, member.name(), false));
         Content code = HtmlTree.CODE(strong);
         tdSummary.addContent(code);
--- a/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java	Thu Aug 22 15:37:58 2013 +0100
@@ -262,7 +262,7 @@
         annotationInfoTree.addContent(hr);
         Tag[] deprs = annotationType.tags("deprecated");
         if (Util.isDeprecated(annotationType)) {
-            Content strong = HtmlTree.STRONG(deprecatedPhrase);
+            Content strong = HtmlTree.SPAN(HtmlStyle.strong, deprecatedPhrase);
             Content div = HtmlTree.DIV(HtmlStyle.block, strong);
             if (deprs.length > 0) {
                 Tag[] commentTags = deprs[0].inlineTags();
--- a/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java	Thu Aug 22 15:37:58 2013 +0100
@@ -547,7 +547,7 @@
         classInfoTree.addContent(hr);
         Tag[] deprs = classDoc.tags("deprecated");
         if (Util.isDeprecated(classDoc)) {
-            Content strong = HtmlTree.STRONG(deprecatedPhrase);
+            Content strong = HtmlTree.SPAN(HtmlStyle.strong, deprecatedPhrase);
             Content div = HtmlTree.DIV(HtmlStyle.block, strong);
             if (deprs.length > 0) {
                 Tag[] commentTags = deprs[0].inlineTags();
--- a/src/share/classes/com/sun/tools/doclets/formats/html/EnumConstantWriterImpl.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/EnumConstantWriterImpl.java	Thu Aug 22 15:37:58 2013 +0100
@@ -222,7 +222,7 @@
      */
     protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
             Content tdSummary) {
-        Content strong = HtmlTree.STRONG(
+        Content strong = HtmlTree.SPAN(HtmlStyle.strong,
                 writer.getDocLink(context, (MemberDoc) member, member.name(), false));
         Content code = HtmlTree.CODE(strong);
         tdSummary.addContent(code);
--- a/src/share/classes/com/sun/tools/doclets/formats/html/FieldWriterImpl.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/FieldWriterImpl.java	Thu Aug 22 15:37:58 2013 +0100
@@ -139,7 +139,7 @@
                             holder.typeName() : holder.qualifiedTypeName(),
                             false);
                 Content codeLink = HtmlTree.CODE(link);
-                Content strong = HtmlTree.STRONG(holder.isClass()?
+                Content strong = HtmlTree.SPAN(HtmlStyle.strong, holder.isClass()?
                    writer.descfrmClassLabel : writer.descfrmInterfaceLabel);
                 strong.addContent(writer.getSpace());
                 strong.addContent(codeLink);
@@ -256,7 +256,7 @@
      */
     protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
             Content tdSummary) {
-        Content strong = HtmlTree.STRONG(
+        Content strong = HtmlTree.SPAN(HtmlStyle.strong,
                 writer.getDocLink(context, cd , (MemberDoc) member, member.name(), false));
         Content code = HtmlTree.CODE(strong);
         tdSummary.addContent(code);
--- a/src/share/classes/com/sun/tools/doclets/formats/html/HelpWriter.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/HelpWriter.java	Thu Aug 22 15:37:58 2013 +0100
@@ -316,7 +316,7 @@
         liConst.addContent(constPara);
         ul.addContent(liConst);
         Content divContent = HtmlTree.DIV(HtmlStyle.contentContainer, ul);
-        Content line30 = HtmlTree.EM(getResource("doclet.Help_line_30"));
+        Content line30 = HtmlTree.SPAN(HtmlStyle.italic, getResource("doclet.Help_line_30"));
         divContent.addContent(line30);
         contentTree.addContent(divContent);
     }
--- a/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java	Thu Aug 22 15:37:58 2013 +0100
@@ -467,8 +467,7 @@
             }
         }
         Content rawContent = new RawHtml(content);
-        Content em = HtmlTree.EM(rawContent);
-        return em;
+        return rawContent;
     }
 
     /**
@@ -1029,7 +1028,7 @@
 
     public Content italicsClassName(ClassDoc cd, boolean qual) {
         Content name = new StringContent((qual)? cd.qualifiedName(): cd.name());
-        return (cd.isInterface())?  HtmlTree.I(name): name;
+        return (cd.isInterface())?  HtmlTree.SPAN(HtmlStyle.italic, name): name;
     }
 
     /**
@@ -1545,7 +1544,7 @@
         Content div;
         Content result = commentTagsToContent(null, doc, tags, first);
         if (depr) {
-            Content italic = HtmlTree.I(result);
+            Content italic = HtmlTree.SPAN(HtmlStyle.italic, result);
             div = HtmlTree.DIV(HtmlStyle.block, italic);
             htmltree.addContent(div);
         }
@@ -1621,6 +1620,7 @@
                     text = removeNonInlineHtmlTags(text);
                 }
                 text = Util.replaceTabs(configuration, text);
+                text = Util.normalizeNewlines(text);
                 result.addContent(new RawHtml(text));
             }
         }
--- a/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java	Thu Aug 22 15:37:58 2013 +0100
@@ -159,7 +159,7 @@
                             holder.typeName() : holder.qualifiedTypeName(),
                             false);
                 Content codelLink = HtmlTree.CODE(link);
-                Content strong = HtmlTree.STRONG(holder.asClassDoc().isClass()?
+                Content strong = HtmlTree.SPAN(HtmlStyle.strong, holder.asClassDoc().isClass()?
                     writer.descfrmClassLabel : writer.descfrmInterfaceLabel);
                 strong.addContent(writer.getSpace());
                 strong.addContent(codelLink);
@@ -309,7 +309,7 @@
                 label = writer.specifiedByLabel;
                 context = LinkInfoImpl.Kind.METHOD_SPECIFIED_BY;
             }
-            Content dt = HtmlTree.DT(HtmlTree.STRONG(label));
+            Content dt = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.strong, label));
             dl.addContent(dt);
             Content overriddenTypeLink =
                     writer.getLink(new LinkInfoImpl(writer.configuration, context, overriddenType));
@@ -364,7 +364,7 @@
             Content intfaclink = writer.getLink(new LinkInfoImpl(
                     writer.configuration, LinkInfoImpl.Kind.METHOD_SPECIFIED_BY, intfac));
             Content codeIntfacLink = HtmlTree.CODE(intfaclink);
-            Content dt = HtmlTree.DT(HtmlTree.STRONG(writer.specifiedByLabel));
+            Content dt = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.strong, writer.specifiedByLabel));
             dl.addContent(dt);
             Content methlink = writer.getDocLink(
                     LinkInfoImpl.Kind.MEMBER, implementedMeth,
--- a/src/share/classes/com/sun/tools/doclets/formats/html/NestedClassWriterImpl.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/NestedClassWriterImpl.java	Thu Aug 22 15:37:58 2013 +0100
@@ -164,7 +164,7 @@
      */
     protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
             Content tdSummary) {
-        Content strong = HtmlTree.STRONG(
+        Content strong = HtmlTree.SPAN(HtmlStyle.strong,
                 writer.getLink(new LinkInfoImpl(configuration, context, (ClassDoc)member)));
         Content code = HtmlTree.CODE(strong);
         tdSummary.addContent(code);
--- a/src/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java	Thu Aug 22 15:37:58 2013 +0100
@@ -183,7 +183,7 @@
                     printedHeader = true;
                 }
                 Content arr_i_name = new StringContent(arr[i].name());
-                if (arr[i].isInterface()) arr_i_name = HtmlTree.I(arr_i_name);
+                if (arr[i].isInterface()) arr_i_name = HtmlTree.SPAN(HtmlStyle.italic, arr_i_name);
                 Content link = getLink(new LinkInfoImpl(configuration,
                         LinkInfoImpl.Kind.PACKAGE_FRAME, arr[i]).label(arr_i_name).target("classFrame"));
                 Content li = HtmlTree.LI(link);
--- a/src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageFrameWriter.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageFrameWriter.java	Thu Aug 22 15:37:58 2013 +0100
@@ -174,7 +174,7 @@
                     printedHeader = true;
                 }
                 Content arr_i_name = new StringContent(arr[i].name());
-                if (arr[i].isInterface()) arr_i_name = HtmlTree.I(arr_i_name);
+                if (arr[i].isInterface()) arr_i_name = HtmlTree.SPAN(HtmlStyle.italic, arr_i_name);
                 Content link = getLink(new LinkInfoImpl(configuration,
                         LinkInfoImpl.Kind.PACKAGE_FRAME, arr[i]).label(arr_i_name).target("classFrame"));
                 Content li = HtmlTree.LI(link);
--- a/src/share/classes/com/sun/tools/doclets/formats/html/PropertyWriterImpl.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/PropertyWriterImpl.java	Thu Aug 22 15:37:58 2013 +0100
@@ -135,7 +135,7 @@
                             holder.typeName() : holder.qualifiedTypeName(),
                             false);
                 Content codeLink = HtmlTree.CODE(link);
-                Content strong = HtmlTree.STRONG(holder.isClass()?
+                Content strong = HtmlTree.SPAN(HtmlStyle.strong, holder.isClass()?
                    writer.descfrmClassLabel : writer.descfrmInterfaceLabel);
                 strong.addContent(writer.getSpace());
                 strong.addContent(codeLink);
@@ -252,13 +252,12 @@
      */
     protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
             Content tdSummary) {
-        Content strong = HtmlTree.STRONG(
-                writer.getDocLink(context,
-                        cd,
-                        (MemberDoc) member,
-                        member.name().substring(0, member.name().lastIndexOf("Property")),
-                        false,
-                        true));
+        Content strong = HtmlTree.SPAN(HtmlStyle.strong,
+                writer.getDocLink(context, cd,
+                (MemberDoc) member,
+                member.name().substring(0, member.name().lastIndexOf("Property")),
+                false,
+                true));
 
         Content code = HtmlTree.CODE(strong);
         tdSummary.addContent(code);
--- a/src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java	Thu Aug 22 15:37:58 2013 +0100
@@ -175,7 +175,7 @@
         Tag[] deprs = member.tags("deprecated");
         Content div;
         if (Util.isDeprecated((ProgramElementDoc) member)) {
-            Content strong = HtmlTree.STRONG(deprecatedPhrase);
+            Content strong = HtmlTree.SPAN(HtmlStyle.strong, deprecatedPhrase);
             div = HtmlTree.DIV(HtmlStyle.block, strong);
             div.addContent(getSpace());
             if (deprs.length > 0) {
@@ -186,7 +186,7 @@
         } else {
             ClassDoc cd = ((ProgramElementDoc)member).containingClass();
             if (cd != null && Util.isDeprecated(cd)) {
-                Content strong = HtmlTree.STRONG(deprecatedPhrase);
+                Content strong = HtmlTree.SPAN(HtmlStyle.strong, deprecatedPhrase);
                 div = HtmlTree.DIV(HtmlStyle.block, strong);
                 div.addContent(getSpace());
                 tdSummary.addContent(div);
--- a/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java	Thu Aug 22 15:37:58 2013 +0100
@@ -71,7 +71,7 @@
      * {@inheritDoc}
      */
     protected Content codeTagOutput(Tag tag) {
-        Content result = HtmlTree.CODE(new StringContent(tag.text()));
+        Content result = HtmlTree.CODE(new StringContent(Util.normalizeNewlines(tag.text())));
         return result;
     }
 
@@ -118,7 +118,7 @@
                 if (deprs.length > 0) {
                     Content body = commentTagsToOutput(null, doc,
                         deprs[0].inlineTags(), false);
-                    result.addContent(HtmlTree.I(body));
+                    result.addContent(HtmlTree.SPAN(HtmlStyle.italic, body));
                 }
             } else {
                 if (Util.isDeprecated(member.containingClass())) {
@@ -135,7 +135,7 @@
      * {@inheritDoc}
      */
     protected Content literalTagOutput(Tag tag) {
-        Content result = new StringContent(tag.text());
+        Content result = new StringContent(Util.normalizeNewlines(tag.text()));
         return result;
     }
 
--- a/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlStyle.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlStyle.java	Thu Aug 22 15:37:58 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -59,6 +59,7 @@
     indexContainer,
     indexHeader,
     inheritance,
+    italic,
     legalCopy,
     nameValue,
     navBarCell1Rev,
--- a/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java	Thu Aug 22 15:37:58 2013 +0100
@@ -282,17 +282,6 @@
     }
 
     /**
-     * Generates a EM tag with some content.
-     *
-     * @param body content to be added to the tag
-     * @return an HtmlTree object for the EM tag
-     */
-    public static HtmlTree EM(Content body) {
-        HtmlTree htmltree = new HtmlTree(HtmlTag.EM, nullCheck(body));
-        return htmltree;
-    }
-
-    /**
      * Generates a FRAME tag.
      *
      * @param src the url of the document to be shown in the frame
@@ -416,17 +405,6 @@
     }
 
     /**
-     * Generates a I tag with some content.
-     *
-     * @param body content for the tag
-     * @return an HtmlTree object for the I tag
-     */
-    public static HtmlTree I(Content body) {
-        HtmlTree htmltree = new HtmlTree(HtmlTag.I, nullCheck(body));
-        return htmltree;
-    }
-
-    /**
      * Generates a LI tag with some content.
      *
      * @param body content for the tag
@@ -559,17 +537,6 @@
     }
 
     /**
-     * Generates a STRONG tag with some content.
-     *
-     * @param body content for the tag
-     * @return an HtmlTree object for the STRONG tag
-     */
-    public static HtmlTree STRONG(Content body) {
-        HtmlTree htmltree = new HtmlTree(HtmlTag.STRONG, nullCheck(body));
-        return htmltree;
-    }
-
-    /**
      * Generates a SPAN tag with some content.
      *
      * @param body content for the tag
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java	Thu Aug 22 15:37:58 2013 +0100
@@ -467,7 +467,7 @@
                 nodeprecated = true;
             } else if (opt.equals("-sourcepath")) {
                 sourcepath = os[1];
-            } else if (opt.equals("-classpath") &&
+            } else if ((opt.equals("-classpath") || opt.equals("-cp")) &&
                        sourcepath.length() == 0) {
                 sourcepath = os[1];
             } else if (opt.equals("-excludedocfilessubdir")) {
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java	Thu Aug 22 15:37:58 2013 +0100
@@ -289,7 +289,8 @@
      * @param classInfoTree the content tree to which the documentation will be added
      */
     public void buildClassSignature(XMLNode node, Content classInfoTree) {
-        StringBuilder modifiers = new StringBuilder(classDoc.modifiers() + " ");
+        StringBuilder modifiers = new StringBuilder(classDoc.modifiers());
+        modifiers.append(modifiers.length() == 0 ? "" : " ");
         if (isEnum) {
             modifiers.append("enum ");
             int index;
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java	Thu Aug 22 15:37:58 2013 +0100
@@ -385,15 +385,21 @@
         }
         commentTextBuilder.append(propertyDoc.commentText());
 
-        Tag[] tags = propertyDoc.tags("@defaultValue");
-        if (tags != null) {
-            for (Tag tag: tags) {
-                commentTextBuilder.append("\n")
-                                  .append(tag.name())
-                                  .append(" ")
-                                  .append(tag.text());
+        // copy certain tags
+        List<Tag> allTags = new LinkedList<Tag>();
+        String[] tagNames = {"@defaultValue", "@since"};
+        for (String tagName: tagNames) {
+            Tag[] tags = propertyDoc.tags(tagName);
+            if (tags != null) {
+                allTags.addAll(Arrays.asList(tags));
             }
         }
+        for (Tag tag: allTags) {
+            commentTextBuilder.append("\n")
+                                .append(tag.name())
+                                .append(" ")
+                                .append(tag.text());
+        }
 
         //add @see tags
         if (!isGetter && !isSetter) {
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css	Thu Aug 22 15:37:58 2013 +0100
@@ -77,6 +77,7 @@
     float:right;
     padding:0px 21px;
     font-size:.8em;
+    font-style:italic;
     z-index:200;
     margin-top:-7px;
 }
@@ -371,6 +372,7 @@
     overflow:hidden;
     padding:0px;
     margin:0px;
+    white-space:pre;
 }
 caption a:link, caption a:hover, caption a:active, caption a:visited {
     color:#FFFFFF;
@@ -518,3 +520,6 @@
 .strong {
     font-weight:bold;
 }
+.italic {
+    font-style:italic;
+}
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java	Thu Aug 22 15:37:58 2013 +0100
@@ -631,6 +631,10 @@
      * Initialize standard Javadoc tags for ordering purposes.
      */
     private void initStandardTaglets() {
+        if (javafx) {
+            initJavaFXTaglets();
+        }
+
         Taglet temp;
         addStandardTaglet(new ParamTaglet());
         addStandardTaglet(new ReturnTaglet());
@@ -664,10 +668,6 @@
         standardTags.add("serial");
         standardTags.add("serialField");
         standardTags.add("Text");
-
-        if (javafx) {
-            initJavaFXTaglets();
-        }
     }
 
     /**
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java	Thu Aug 22 15:37:58 2013 +0100
@@ -631,6 +631,32 @@
         return result.toString();
     }
 
+    public static String normalizeNewlines(String text) {
+        StringBuilder sb = new StringBuilder();
+        final int textLength = text.length();
+        final String NL = DocletConstants.NL;
+        int pos = 0;
+        for (int i = 0; i < textLength; i++) {
+            char ch = text.charAt(i);
+            switch (ch) {
+                case '\n':
+                    sb.append(text, pos, i);
+                    sb.append(NL);
+                    pos = i + 1;
+                    break;
+                case '\r':
+                    sb.append(text, pos, i);
+                    sb.append(NL);
+                    if (i + 1 < textLength && text.charAt(i + 1) == '\n')
+                        i++;
+                    pos = i + 1;
+                    break;
+            }
+        }
+        sb.append(text, pos, textLength);
+        return sb.toString();
+    }
+
     /**
      * The documentation for values() and valueOf() in Enums are set by the
      * doclet.
--- a/src/share/classes/com/sun/tools/doclint/Checker.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclint/Checker.java	Thu Aug 22 15:37:58 2013 +0100
@@ -31,9 +31,11 @@
 import java.net.URISyntaxException;
 import java.util.Deque;
 import java.util.EnumSet;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -45,6 +47,7 @@
 import javax.lang.model.type.TypeKind;
 import javax.lang.model.type.TypeMirror;
 import javax.tools.Diagnostic.Kind;
+import javax.tools.JavaFileObject;
 
 import com.sun.source.doctree.AttributeTree;
 import com.sun.source.doctree.AuthorTree;
@@ -88,9 +91,9 @@
 public class Checker extends DocTreePathScanner<Void, Void> {
     final Env env;
 
-    Set<Element> foundParams = new HashSet<Element>();
-    Set<TypeMirror> foundThrows = new HashSet<TypeMirror>();
-    Set<String> foundAnchors = new HashSet<String>();
+    Set<Element> foundParams = new HashSet<>();
+    Set<TypeMirror> foundThrows = new HashSet<>();
+    Map<JavaFileObject, Set<String>> foundAnchors = new HashMap<>();
     boolean foundInheritDoc = false;
     boolean foundReturn = false;
 
@@ -129,7 +132,7 @@
     Checker(Env env) {
         env.getClass();
         this.env = env;
-        tagStack = new LinkedList<TagStackItem>();
+        tagStack = new LinkedList<>();
         implicitHeaderLevel = env.implicitHeaderLevel;
     }
 
@@ -138,10 +141,27 @@
 
         boolean isOverridingMethod = !env.currOverriddenMethods.isEmpty();
 
-        if (tree == null) {
-            if (!isSynthetic() && !isOverridingMethod)
-                reportMissing("dc.missing.comment");
-            return null;
+        if (p.getLeaf() == p.getCompilationUnit()) {
+            // If p points to a compilation unit, the implied declaration is the
+            // package declaration (if any) for the compilation unit.
+            // Handle this case specially, because doc comments are only
+            // expected in package-info files.
+            JavaFileObject fo = p.getCompilationUnit().getSourceFile();
+            boolean isPkgInfo = fo.isNameCompatible("package-info", JavaFileObject.Kind.SOURCE);
+            if (tree == null) {
+                if (isPkgInfo)
+                    reportMissing("dc.missing.comment");
+                return null;
+            } else {
+                if (!isPkgInfo)
+                    reportReference("dc.unexpected.comment");
+            }
+        } else {
+            if (tree == null) {
+                if (!isSynthetic() && !isOverridingMethod)
+                    reportMissing("dc.missing.comment");
+                return null;
+            }
         }
 
         tagStack.clear();
@@ -184,6 +204,10 @@
         env.messages.report(MISSING, Kind.WARNING, env.currPath.getLeaf(), code, args);
     }
 
+    private void reportReference(String code, Object... args) {
+        env.messages.report(REFERENCE, Kind.WARNING, env.currPath.getLeaf(), code, args);
+    }
+
     @Override
     public Void visitDocComment(DocCommentTree tree, Void ignore) {
         super.visitDocComment(tree, ignore);
@@ -508,7 +532,7 @@
                             if (!validName.matcher(value).matches()) {
                                 env.messages.error(HTML, tree, "dc.invalid.anchor", value);
                             }
-                            if (!foundAnchors.add(value)) {
+                            if (!checkAnchor(value)) {
                                 env.messages.error(HTML, tree, "dc.anchor.already.defined", value);
                             }
                         }
@@ -551,6 +575,14 @@
         return super.visitAttribute(tree, ignore);
     }
 
+    private boolean checkAnchor(String name) {
+        JavaFileObject fo = env.currPath.getCompilationUnit().getSourceFile();
+        Set<String> set = foundAnchors.get(fo);
+        if (set == null)
+            foundAnchors.put(fo, set = new HashSet<>());
+        return set.add(name);
+    }
+
     // http://www.w3.org/TR/html401/types.html#type-name
     private static final Pattern validName = Pattern.compile("[A-Za-z][A-Za-z0-9-_:.]*");
 
@@ -721,8 +753,7 @@
         Element ex = env.trees.getElement(new DocTreePath(getCurrentPath(), exName));
         if (ex == null) {
             env.messages.error(REFERENCE, tree, "dc.ref.not.found");
-        } else if (ex.asType().getKind() == TypeKind.DECLARED
-                && env.types.isAssignable(ex.asType(), env.java_lang_Throwable)) {
+        } else if (isThrowable(ex.asType())) {
             switch (env.currElement.getKind()) {
                 case CONSTRUCTOR:
                 case METHOD:
@@ -741,6 +772,15 @@
         return scan(tree.getDescription(), ignore);
     }
 
+    private boolean isThrowable(TypeMirror tm) {
+        switch (tm.getKind()) {
+            case DECLARED:
+            case TYPEVAR:
+                return env.types.isAssignable(tm, env.java_lang_Throwable);
+        }
+        return false;
+    }
+
     private void checkThrowsDeclared(ReferenceTree tree, TypeMirror t, List<? extends TypeMirror> list) {
         boolean found = false;
         for (TypeMirror tl : list) {
--- a/src/share/classes/com/sun/tools/doclint/DocLint.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclint/DocLint.java	Thu Aug 22 15:37:58 2013 +0100
@@ -30,7 +30,6 @@
 import java.io.PrintWriter;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.regex.Pattern;
 
 import javax.lang.model.element.Name;
 import javax.tools.StandardLocation;
@@ -166,8 +165,8 @@
     }
 
     void processArgs(String... args) throws BadArgs {
-        javacOpts = new ArrayList<String>();
-        javacFiles = new ArrayList<File>();
+        javacOpts = new ArrayList<>();
+        javacFiles = new ArrayList<>();
 
         if (args.length == 0)
             needHelp = true;
@@ -187,6 +186,8 @@
                 javacBootClassPath = splitPath(args[++i]);
             } else if (arg.equals("-classpath") && i + 1 < args.length) {
                 javacClassPath = splitPath(args[++i]);
+            } else if (arg.equals("-cp") && i + 1 < args.length) {
+                javacClassPath = splitPath(args[++i]);
             } else if (arg.equals("-sourcepath") && i + 1 < args.length) {
                 javacSourcePath = splitPath(args[++i]);
             } else if (arg.equals(XMSGS_OPTION)) {
@@ -212,7 +213,7 @@
     }
 
     List<File> splitPath(String path) {
-        List<File> files = new ArrayList<File>();
+        List<File> files = new ArrayList<>();
         for (String f: path.split(File.pathSeparator)) {
             if (f.length() > 0)
                 files.add(new File(f));
@@ -277,7 +278,6 @@
             TaskListener tl = new TaskListener() {
                 @Override
                 public void started(TaskEvent e) {
-                    return;
                 }
 
                 @Override
@@ -326,6 +326,14 @@
         abstract void visitDecl(Tree tree, Name name);
 
         @Override
+        public Void visitCompilationUnit(CompilationUnitTree tree, Void ignore) {
+            if (tree.getPackageName() != null) {
+                visitDecl(tree, null);
+            }
+            return super.visitCompilationUnit(tree, ignore);
+        }
+
+        @Override
         public Void visitClass(ClassTree tree, Void ignore) {
             visitDecl(tree, tree.getSimpleName());
             return super.visitClass(tree, ignore);
--- a/src/share/classes/com/sun/tools/doclint/Env.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclint/Env.java	Thu Aug 22 15:37:58 2013 +0100
@@ -142,7 +142,7 @@
         currElement = trees.getElement(currPath);
         currOverriddenMethods = ((JavacTypes) types).getOverriddenMethods(currElement);
 
-        AccessKind ak = null;
+        AccessKind ak = AccessKind.PUBLIC;
         for (TreePath p = path; p != null; p = p.getParentPath()) {
             Element e = trees.getElement(p);
             if (e != null && e.getKind() != ElementKind.PACKAGE) {
--- a/src/share/classes/com/sun/tools/doclint/resources/doclint.properties	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclint/resources/doclint.properties	Thu Aug 22 15:37:58 2013 +0100
@@ -67,6 +67,7 @@
 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.unexpected.comment=documentation comment not expected here
 
 dc.main.ioerror=IO error: {0}
 dc.main.no.files.given=No files given
@@ -109,7 +110,7 @@
 \    Show this message.\n\
 \n\
 The following javac options are also supported\n\
-\  -bootclasspath, -classpath, -sourcepath, -Xmaxerrs, -Xmaxwarns\n\
+\  -bootclasspath, -classpath, -cp, -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\
--- a/src/share/classes/com/sun/tools/javac/Main.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/Main.java	Thu Aug 22 15:37:58 2013 +0100
@@ -26,8 +26,6 @@
 package com.sun.tools.javac;
 
 import java.io.PrintWriter;
-import java.lang.reflect.*;
-
 
 /**
  * The programmatic interface for the Java Programming Language
@@ -44,23 +42,12 @@
 @jdk.Supported
 public class Main {
 
-    /** Unsupported command line interface.
-     * @param args   The command line parameters.
+    /** Main entry point for the launcher.
+     *  Note: This method calls System.exit.
+     *  @param args command line arguments
      */
     public static void main(String[] args) throws Exception {
-      if (args.length > 0 && args[0].equals("-Xjdb")) {
-        String[] newargs = new String[args.length + 2];
-        Class<?> c = Class.forName("com.sun.tools.example.debug.tty.TTY");
-        Method method = c.getDeclaredMethod ("main", new Class<?>[] {args.getClass()});
-        method.setAccessible(true);
-        System.arraycopy(args, 1, newargs, 3, args.length - 1);
-        newargs[0] = "-connect";
-        newargs[1] = "com.sun.jdi.CommandLineLaunch:options=-esa -ea:com.sun.tools...";
-        newargs[2] = "com.sun.tools.javac.Main";
-        method.invoke(null, new Object[] { newargs });
-      } else {
         System.exit(compile(args));
-      }
     }
 
     /** Programmatic interface to the Java Programming Language
--- a/src/share/classes/com/sun/tools/javac/api/JavacTrees.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/api/JavacTrees.java	Thu Aug 22 15:37:58 2013 +0100
@@ -357,7 +357,7 @@
         Log.DeferredDiagnosticHandler deferredDiagnosticHandler =
                 new Log.DeferredDiagnosticHandler(log);
         try {
-            final ClassSymbol tsym;
+            final TypeSymbol tsym;
             final Name memberName;
             if (ref.qualifierExpression == null) {
                 tsym = env.enclClass.sym;
@@ -386,7 +386,7 @@
                         return null;
                     }
                 } else {
-                    tsym = (ClassSymbol) t.tsym;
+                    tsym = t.tsym;
                     memberName = ref.memberName;
                 }
             }
@@ -407,15 +407,17 @@
                 paramTypes = lb.toList();
             }
 
-            Symbol msym = (memberName == tsym.name)
-                    ? findConstructor(tsym, paramTypes)
-                    : findMethod(tsym, memberName, paramTypes);
+            ClassSymbol sym = (ClassSymbol) types.upperBound(tsym.type).tsym;
+
+            Symbol msym = (memberName == sym.name)
+                    ? findConstructor(sym, paramTypes)
+                    : findMethod(sym, memberName, paramTypes);
             if (paramTypes != null) {
                 // explicit (possibly empty) arg list given, so cannot be a field
                 return msym;
             }
 
-            VarSymbol vsym = (ref.paramTypes != null) ? null : findField(tsym, memberName);
+            VarSymbol vsym = (ref.paramTypes != null) ? null : findField(sym, memberName);
             // prefer a field over a method with no parameters
             if (vsym != null &&
                     (msym == null ||
@@ -653,8 +655,7 @@
             switch (t.getTag()) {
             case BYTE: case CHAR: case SHORT: case INT: case LONG: case FLOAT:
             case DOUBLE: case BOOLEAN: case VOID: case BOT: case NONE:
-                return t.getTag() == s.getTag();
-
+                return t.hasTag(s.getTag());
             default:
                 throw new AssertionError("fuzzyMatcher " + t.getTag());
             }
@@ -668,7 +669,7 @@
             if (s.isPartial())
                 return visit(s, t);
 
-            return s.getTag() == ARRAY
+            return s.hasTag(ARRAY)
                 && visit(t.elemtype, types.elemtype(s));
         }
 
@@ -685,7 +686,7 @@
 
         @Override
         public Boolean visitErrorType(ErrorType t, Type s) {
-            return s.getTag() == CLASS
+            return s.hasTag(CLASS)
                     && t.tsym.name == ((ClassType) s).tsym.name;
         }
     };
@@ -789,6 +790,7 @@
                 case METHOD:
 //                    System.err.println("METHOD: " + ((JCMethodDecl)tree).sym.getSimpleName());
                     method = (JCMethodDecl)tree;
+                    env = memberEnter.getMethodEnv(method, env);
                     break;
                 case VARIABLE:
 //                    System.err.println("FIELD: " + ((JCVariableDecl)tree).sym.getSimpleName());
@@ -800,7 +802,6 @@
                         try {
                             Assert.check(method.body == tree);
                             method.body = copier.copy((JCBlock)tree, (JCTree) path.getLeaf());
-                            env = memberEnter.getMethodEnv(method, env);
                             env = attribStatToTree(method.body, env, copier.leafCopy);
                         } finally {
                             method.body = (JCBlock) tree;
--- a/src/share/classes/com/sun/tools/javac/code/Attribute.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/code/Attribute.java	Thu Aug 22 15:37:58 2013 +0100
@@ -83,7 +83,7 @@
                 return v.visitString((String) value, p);
             if (value instanceof Integer) {
                 int i = (Integer) value;
-                switch (type.tag) {
+                switch (type.getTag()) {
                 case BOOLEAN:   return v.visitBoolean(i != 0, p);
                 case CHAR:      return v.visitChar((char) i, p);
                 case BYTE:      return v.visitByte((byte) i, p);
@@ -91,7 +91,7 @@
                 case INT:       return v.visitInt(i, p);
                 }
             }
-            switch (type.tag) {
+            switch (type.getTag()) {
             case LONG:          return v.visitLong((Long) value, p);
             case FLOAT:         return v.visitFloat((Float) value, p);
             case DOUBLE:        return v.visitDouble((Double) value, p);
--- a/src/share/classes/com/sun/tools/javac/code/Flags.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/code/Flags.java	Thu Aug 22 15:37:58 2013 +0100
@@ -375,7 +375,9 @@
         CLASH(Flags.CLASH),
         AUXILIARY(Flags.AUXILIARY),
         NOT_IN_PROFILE(Flags.NOT_IN_PROFILE),
-        BAD_OVERRIDE(Flags.BAD_OVERRIDE);
+        BAD_OVERRIDE(Flags.BAD_OVERRIDE),
+        SIGNATURE_POLYMORPHIC(Flags.SIGNATURE_POLYMORPHIC),
+        THROWS(Flags.THROWS);
 
         Flag(long flag) {
             this.value = flag;
--- a/src/share/classes/com/sun/tools/javac/code/Kinds.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/code/Kinds.java	Thu Aug 22 15:37:58 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -73,9 +73,13 @@
      */
     public final static int MTH = 1 << 4;
 
+    /** Poly kind, for deferred types.
+     */
+    public final static int POLY = 1 << 5;
+
     /** The error kind, which includes all other kinds.
      */
-    public final static int ERR = (1 << 5) - 1;
+    public final static int ERR = (1 << 6) - 1;
 
     /** The set of all kinds.
      */
@@ -83,7 +87,7 @@
 
     /** Kinds for erroneous symbols that complement the above
      */
-    public static final int ERRONEOUS = 1 << 6;
+    public static final int ERRONEOUS = 1 << 7;
     public static final int AMBIGUOUS    = ERRONEOUS+1; // ambiguous reference
     public static final int HIDDEN       = ERRONEOUS+2; // hidden method or field
     public static final int STATICERR    = ERRONEOUS+3; // nonstatic member from static context
@@ -214,10 +218,10 @@
     /** A KindName representing the kind of a given class/interface type.
      */
     public static KindName typeKindName(Type t) {
-        if (t.tag == TYPEVAR ||
-            t.tag == CLASS && (t.tsym.flags() & COMPOUND) != 0)
+        if (t.hasTag(TYPEVAR) ||
+            t.hasTag(CLASS) && (t.tsym.flags() & COMPOUND) != 0)
             return KindName.BOUND;
-        else if (t.tag == PACKAGE)
+        else if (t.hasTag(PACKAGE))
             return KindName.PACKAGE;
         else if ((t.tsym.flags_field & ANNOTATION) != 0)
             return KindName.ANNOTATION;
--- a/src/share/classes/com/sun/tools/javac/code/Printer.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/code/Printer.java	Thu Aug 22 15:37:58 2013 +0100
@@ -215,7 +215,7 @@
     @Override
     public String visitClassType(ClassType t, Locale locale) {
         StringBuilder buf = new StringBuilder();
-        if (t.getEnclosingType().tag == CLASS && t.tsym.owner.kind == Kinds.TYP) {
+        if (t.getEnclosingType().hasTag(CLASS) && t.tsym.owner.kind == Kinds.TYP) {
             buf.append(visit(t.getEnclosingType(), locale));
             buf.append('.');
             buf.append(className(t, false, locale));
@@ -379,7 +379,7 @@
                     ? s.owner.name.toString()
                     : s.name.toString();
             if (s.type != null) {
-                if (s.type.tag == FORALL) {
+                if (s.type.hasTag(FORALL)) {
                     ms = "<" + visitTypes(s.type.getTypeArguments(), locale) + ">" + ms;
                 }
                 ms += "(" + printMethodArgs(
--- a/src/share/classes/com/sun/tools/javac/code/Scope.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/code/Scope.java	Thu Aug 22 15:37:58 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -316,6 +316,7 @@
     public Entry lookup(Name name) {
         return lookup(name, noFilter);
     }
+
     public Entry lookup(Name name, Filter<Symbol> sf) {
         Entry e = table[getIndex(name)];
         if (e == null || e == sentinel)
@@ -361,6 +362,10 @@
         }
     }
 
+    public boolean anyMatch(Filter<Symbol> sf) {
+        return getElements(sf).iterator().hasNext();
+    }
+
     public Iterable<Symbol> getElements() {
         return getElements(noFilter);
     }
--- a/src/share/classes/com/sun/tools/javac/code/Symbol.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/code/Symbol.java	Thu Aug 22 15:37:58 2013 +0100
@@ -596,7 +596,7 @@
 
     // This method is part of the javax.lang.model API, do not use this in javac code.
     public <A extends java.lang.annotation.Annotation> A[] getAnnotationsByType(Class<A> annoType) {
-        return JavacAnnoConstructs.getAnnotations(this, annoType);
+        return JavacAnnoConstructs.getAnnotationsByType(this, annoType);
     }
 
     // TODO: getEnclosedElements should return a javac List, fix in FilteredMemberList
@@ -699,17 +699,17 @@
         public final boolean precedes(TypeSymbol that, Types types) {
             if (this == that)
                 return false;
-            if (this.type.tag == that.type.tag) {
-                if (this.type.hasTag(CLASS)) {
+            if (type.hasTag(that.type.getTag())) {
+                if (type.hasTag(CLASS)) {
                     return
                         types.rank(that.type) < types.rank(this.type) ||
                         types.rank(that.type) == types.rank(this.type) &&
                         that.getQualifiedName().compareTo(this.getQualifiedName()) < 0;
-                } else if (this.type.hasTag(TYPEVAR)) {
+                } else if (type.hasTag(TYPEVAR)) {
                     return types.isSubtype(this.type, that.type);
                 }
             }
-            return this.type.hasTag(TYPEVAR);
+            return type.hasTag(TYPEVAR);
         }
 
         @Override
--- a/src/share/classes/com/sun/tools/javac/code/Symtab.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/code/Symtab.java	Thu Aug 22 15:37:58 2013 +0100
@@ -28,7 +28,6 @@
 import java.util.*;
 
 import javax.lang.model.element.ElementVisitor;
-import javax.lang.model.type.TypeVisitor;
 
 import com.sun.tools.javac.code.Symbol.*;
 import com.sun.tools.javac.code.Type.*;
@@ -65,16 +64,16 @@
 
     /** Builtin types.
      */
-    public final Type byteType = new Type(BYTE, null);
-    public final Type charType = new Type(CHAR, null);
-    public final Type shortType = new Type(SHORT, null);
-    public final Type intType = new Type(INT, null);
-    public final Type longType = new Type(LONG, null);
-    public final Type floatType = new Type(FLOAT, null);
-    public final Type doubleType = new Type(DOUBLE, null);
-    public final Type booleanType = new Type(BOOLEAN, null);
+    public final JCPrimitiveType byteType = new JCPrimitiveType(BYTE, null);
+    public final JCPrimitiveType charType = new JCPrimitiveType(CHAR, null);
+    public final JCPrimitiveType shortType = new JCPrimitiveType(SHORT, null);
+    public final JCPrimitiveType intType = new JCPrimitiveType(INT, null);
+    public final JCPrimitiveType longType = new JCPrimitiveType(LONG, null);
+    public final JCPrimitiveType floatType = new JCPrimitiveType(FLOAT, null);
+    public final JCPrimitiveType doubleType = new JCPrimitiveType(DOUBLE, null);
+    public final JCPrimitiveType booleanType = new JCPrimitiveType(BOOLEAN, null);
     public final Type botType = new BottomType();
-    public final JCNoType voidType = new JCNoType(VOID);
+    public final JCVoidType voidType = new JCVoidType();
 
     private final Names names;
     private final ClassReader reader;
@@ -208,7 +207,7 @@
 
     public void initType(Type type, ClassSymbol c) {
         type.tsym = c;
-        typeOfTag[type.tag.ordinal()] = type;
+        typeOfTag[type.getTag().ordinal()] = type;
     }
 
     public void initType(Type type, String name) {
@@ -220,7 +219,7 @@
 
     public void initType(Type type, String name, String bname) {
         initType(type, name);
-            boxedName[type.tag.ordinal()] = names.fromString("java.lang." + bname);
+            boxedName[type.getTag().ordinal()] = names.fromString("java.lang." + bname);
     }
 
     /** The class symbol that owns all predefined symbols.
@@ -330,7 +329,7 @@
     }
 
     public void synthesizeBoxTypeIfMissing(final Type type) {
-        ClassSymbol sym = reader.enterClass(boxedName[type.tag.ordinal()]);
+        ClassSymbol sym = reader.enterClass(boxedName[type.getTag().ordinal()]);
         final Completer completer = sym.completer;
         if (completer != null) {
             sym.completer = new Completer() {
@@ -388,12 +387,7 @@
         target = Target.instance(context);
 
         // Create the unknown type
-        unknownType = new Type(UNKNOWN, null) {
-            @Override
-            public <R, P> R accept(TypeVisitor<R, P> v, P p) {
-                return v.visitUnknown(this, p);
-            }
-        };
+        unknownType = new UnknownType();
 
         // create the basic builtin symbols
         rootPackage = new PackageSymbol(names.empty, null);
--- a/src/share/classes/com/sun/tools/javac/code/Type.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/code/Type.java	Thu Aug 22 15:37:58 2013 +0100
@@ -70,28 +70,22 @@
  *
  *  @see TypeTag
  */
-public class Type implements PrimitiveType {
+public abstract class Type implements TypeMirror {
 
     /** Constant type: no type at all. */
-    public static final JCNoType noType = new JCNoType(NONE);
+    public static final JCNoType noType = new JCNoType();
 
     /** Constant type: special type to be used during recovery of deferred expressions. */
-    public static final JCNoType recoveryType = new JCNoType(NONE);
-    
-    /** Constant type: special type to be for marking stuck trees. */
-    public static final JCNoType stuckType = new JCNoType(NONE);
+    public static final JCNoType recoveryType = new JCNoType();
+
+    /** Constant type: special type to be used for marking stuck trees. */
+    public static final JCNoType stuckType = new JCNoType();
 
     /** If this switch is turned on, the names of type variables
      *  and anonymous classes are printed with hashcodes appended.
      */
     public static boolean moreInfo = false;
 
-    /** The tag of this type.
-     *
-     *  @see TypeTag
-     */
-    protected TypeTag tag;
-
     /** The defining class / interface / package / type variable.
      */
     public TypeSymbol tsym;
@@ -101,39 +95,37 @@
      * @return true if tag is equal to the current type tag.
      */
     public boolean hasTag(TypeTag tag) {
-        return this.tag == tag;
+        return tag == getTag();
     }
 
     /**
      * Returns the current type tag.
      * @return the value of the current type tag.
      */
-    public TypeTag getTag() {
-        return tag;
-    }
+    public abstract TypeTag getTag();
 
     public boolean isNumeric() {
-        return tag.isNumeric;
+        return false;
     }
 
     public boolean isPrimitive() {
-        return tag.isPrimitive;
+        return false;
     }
 
     public boolean isPrimitiveOrVoid() {
-        return tag.isPrimitiveOrVoid;
+        return false;
     }
 
     public boolean isReference() {
-        return tag.isReference;
+        return false;
     }
 
     public boolean isNullOrReference() {
-        return (tag.isReference || tag == BOT);
+        return false;
     }
 
     public boolean isPartial() {
-        return tag.isPartial;
+        return false;
     }
 
     /**
@@ -146,6 +138,18 @@
         return null;
     }
 
+    /** Is this a constant type whose value is false?
+     */
+    public boolean isFalse() {
+        return false;
+    }
+
+    /** Is this a constant type whose value is true?
+     */
+    public boolean isTrue() {
+        return false;
+    }
+
     /**
      * Get the representation of this type used for modelling purposes.
      * By default, this is itself. For ErrorType, a different value
@@ -156,7 +160,7 @@
     }
 
     public static List<Type> getModelTypes(List<Type> ts) {
-        ListBuffer<Type> lb = new ListBuffer<Type>();
+        ListBuffer<Type> lb = new ListBuffer<>();
         for (Type t: ts)
             lb.append(t.getModelType());
         return lb.toList();
@@ -166,8 +170,7 @@
 
     /** Define a type given its tag and type symbol
      */
-    public Type(TypeTag tag, TypeSymbol tsym) {
-        this.tag = tag;
+    public Type(TypeSymbol tsym) {
         this.tsym = tsym;
     }
 
@@ -206,18 +209,7 @@
      *  and with given constant value
      */
     public Type constType(Object constValue) {
-        final Object value = constValue;
-        Assert.check(isPrimitive());
-        return new Type(tag, tsym) {
-                @Override
-                public Object constValue() {
-                    return value;
-                }
-                @Override
-                public Type baseType() {
-                    return tsym.type;
-                }
-            };
+        throw new AssertionError();
     }
 
     /**
@@ -275,7 +267,9 @@
         String s = (tsym == null || tsym.name == null)
             ? "<none>"
             : tsym.name.toString();
-        if (moreInfo && tag == TYPEVAR) s = s + hashCode();
+        if (moreInfo && hasTag(TYPEVAR)) {
+            s = s + hashCode();
+        }
         return s;
     }
 
@@ -301,12 +295,7 @@
      */
     public String stringValue() {
         Object cv = Assert.checkNonNull(constValue());
-        if (tag == BOOLEAN)
-            return ((Integer) cv).intValue() == 0 ? "false" : "true";
-        else if (tag == CHAR)
-            return String.valueOf((char) ((Integer) cv).intValue());
-        else
-            return cv.toString();
+        return cv.toString();
     }
 
     /**
@@ -324,24 +313,6 @@
         return super.hashCode();
     }
 
-    /** Is this a constant type whose value is false?
-     */
-    public boolean isFalse() {
-        return
-            tag == BOOLEAN &&
-            constValue() != null &&
-            ((Integer)constValue()).intValue() == 0;
-    }
-
-    /** Is this a constant type whose value is true?
-     */
-    public boolean isTrue() {
-        return
-            tag == BOOLEAN &&
-            constValue() != null &&
-            ((Integer)constValue()).intValue() != 0;
-    }
-
     public String argtypes(boolean varargs) {
         List<Type> args = getParameterTypes();
         if (!varargs) return args.toString();
@@ -351,7 +322,7 @@
             args = args.tail;
             buf.append(',');
         }
-        if (args.head.unannotatedType().tag == ARRAY) {
+        if (args.head.unannotatedType().hasTag(ARRAY)) {
             buf.append(((ArrayType)args.head.unannotatedType()).elemtype);
             if (args.head.getAnnotationMirrors().nonEmpty()) {
                 buf.append(args.head.getAnnotationMirrors());
@@ -488,28 +459,122 @@
         return tsym;
     }
 
+    @Override
     public TypeKind getKind() {
-        switch (tag) {
-        case BYTE:      return TypeKind.BYTE;
-        case CHAR:      return TypeKind.CHAR;
-        case SHORT:     return TypeKind.SHORT;
-        case INT:       return TypeKind.INT;
-        case LONG:      return TypeKind.LONG;
-        case FLOAT:     return TypeKind.FLOAT;
-        case DOUBLE:    return TypeKind.DOUBLE;
-        case BOOLEAN:   return TypeKind.BOOLEAN;
-        case VOID:      return TypeKind.VOID;
-        case BOT:       return TypeKind.NULL;
-        case NONE:      return TypeKind.NONE;
-        default:        return TypeKind.OTHER;
-        }
+        return TypeKind.OTHER;
     }
 
+    @Override
     public <R, P> R accept(TypeVisitor<R, P> v, P p) {
-        if (isPrimitive())
+        throw new AssertionError();
+    }
+
+    public static class JCPrimitiveType extends Type
+            implements javax.lang.model.type.PrimitiveType {
+
+        TypeTag tag;
+
+        public JCPrimitiveType(TypeTag tag, TypeSymbol tsym) {
+            super(tsym);
+            this.tag = tag;
+            Assert.check(tag.isPrimitive);
+        }
+
+        @Override
+        public boolean isNumeric() {
+            return tag != BOOLEAN;
+        }
+
+        @Override
+        public boolean isPrimitive() {
+            return true;
+        }
+
+        @Override
+        public TypeTag getTag() {
+            return tag;
+        }
+
+        @Override
+        public boolean isPrimitiveOrVoid() {
+            return true;
+        }
+
+        /** Define a constant type, of the same kind as this type
+         *  and with given constant value
+         */
+        @Override
+        public Type constType(Object constValue) {
+            final Object value = constValue;
+            return new JCPrimitiveType(tag, tsym) {
+                    @Override
+                    public Object constValue() {
+                        return value;
+                    }
+                    @Override
+                    public Type baseType() {
+                        return tsym.type;
+                    }
+                };
+        }
+
+        /**
+         * The constant value of this type, converted to String
+         */
+        @Override
+        public String stringValue() {
+            Object cv = Assert.checkNonNull(constValue());
+            if (tag == BOOLEAN) {
+                return ((Integer) cv).intValue() == 0 ? "false" : "true";
+            }
+            else if (tag == CHAR) {
+                return String.valueOf((char) ((Integer) cv).intValue());
+            }
+            else {
+                return cv.toString();
+            }
+        }
+
+        /** Is this a constant type whose value is false?
+         */
+        @Override
+        public boolean isFalse() {
+            return
+                tag == BOOLEAN &&
+                constValue() != null &&
+                ((Integer)constValue()).intValue() == 0;
+        }
+
+        /** Is this a constant type whose value is true?
+         */
+        @Override
+        public boolean isTrue() {
+            return
+                tag == BOOLEAN &&
+                constValue() != null &&
+                ((Integer)constValue()).intValue() != 0;
+        }
+
+        @Override
+        public <R, P> R accept(TypeVisitor<R, P> v, P p) {
             return v.visitPrimitive(this, p);
-        else
+        }
+
+        @Override
+        public TypeKind getKind() {
+            switch (tag) {
+                case BYTE:      return TypeKind.BYTE;
+                case CHAR:      return TypeKind.CHAR;
+                case SHORT:     return TypeKind.SHORT;
+                case INT:       return TypeKind.INT;
+                case LONG:      return TypeKind.LONG;
+                case FLOAT:     return TypeKind.FLOAT;
+                case DOUBLE:    return TypeKind.DOUBLE;
+                case BOOLEAN:   return TypeKind.BOOLEAN;
+            }
             throw new AssertionError();
+        }
+
     }
 
     public static class WildcardType extends Type
@@ -525,7 +590,7 @@
         }
 
         public WildcardType(Type type, BoundKind kind, TypeSymbol tsym) {
-            super(WILDCARD, tsym);
+            super(tsym);
             this.type = Assert.checkNonNull(type);
             this.kind = kind;
         }
@@ -538,6 +603,12 @@
             this.bound = bound;
         }
 
+        @Override
+        public TypeTag getTag() {
+            return WILDCARD;
+        }
+
+        @Override
         public boolean contains(Type t) {
             return kind != UNBOUND && type.contains(t);
         }
@@ -554,6 +625,17 @@
             return kind == UNBOUND;
         }
 
+        @Override
+        public boolean isReference() {
+            return true;
+        }
+
+        @Override
+        public boolean isNullOrReference() {
+            return true;
+        }
+
+        @Override
         public Type withTypeVar(Type t) {
             //-System.err.println(this+".withTypeVar("+t+");");//DEBUG
             if (bound == t)
@@ -643,7 +725,7 @@
         public List<Type> all_interfaces_field;
 
         public ClassType(Type outer, List<Type> typarams, TypeSymbol tsym) {
-            super(CLASS, tsym);
+            super(tsym);
             this.outer_field = outer;
             this.typarams_field = typarams;
             this.allparams_field = null;
@@ -661,6 +743,11 @@
         }
 
         @Override
+        public TypeTag getTag() {
+            return CLASS;
+        }
+
+        @Override
         public <R,S> R accept(Type.Visitor<R,S> v, S s) {
             return v.visitClassType(this, s);
         }
@@ -683,7 +770,7 @@
          */
         public String toString() {
             StringBuilder buf = new StringBuilder();
-            if (getEnclosingType().tag == CLASS && tsym.owner.kind == TYP) {
+            if (getEnclosingType().hasTag(CLASS) && tsym.owner.kind == TYP) {
                 buf.append(getEnclosingType().toString());
                 buf.append(".");
                 buf.append(className(tsym, false));
@@ -768,6 +855,16 @@
             // optimization, was: allparams().nonEmpty();
         }
 
+        @Override
+        public boolean isReference() {
+            return true;
+        }
+
+        @Override
+        public boolean isNullOrReference() {
+            return true;
+        }
+
         /** A cache for the rank. */
         int rank_field = -1;
 
@@ -912,11 +1009,15 @@
         public Type elemtype;
 
         public ArrayType(Type elemtype, TypeSymbol arrayClass) {
-            super(ARRAY, arrayClass);
+            super(arrayClass);
             this.elemtype = elemtype;
         }
 
         @Override
+        public TypeTag getTag() {
+            return ARRAY;
+        }
+
         public <R,S> R accept(Type.Visitor<R,S> v, S s) {
             return v.visitArrayType(this, s);
         }
@@ -950,6 +1051,16 @@
             return elemtype.isParameterized();
         }
 
+        @Override
+        public boolean isReference() {
+            return true;
+        }
+
+        @Override
+        public boolean isNullOrReference() {
+            return true;
+        }
+
         public boolean isRaw() {
             return elemtype.isRaw();
         }
@@ -1004,13 +1115,17 @@
                           Type restype,
                           List<Type> thrown,
                           TypeSymbol methodClass) {
-            super(METHOD, methodClass);
+            super(methodClass);
             this.argtypes = argtypes;
             this.restype = restype;
             this.thrown = thrown;
         }
 
         @Override
+        public TypeTag getTag() {
+            return METHOD;
+        }
+
         public <R,S> R accept(Type.Visitor<R,S> v, S s) {
             return v.visitMethodType(this, s);
         }
@@ -1080,7 +1195,12 @@
     public static class PackageType extends Type implements NoType {
 
         PackageType(TypeSymbol tsym) {
-            super(PACKAGE, tsym);
+            super(tsym);
+        }
+
+        @Override
+        public TypeTag getTag() {
+            return PACKAGE;
         }
 
         @Override
@@ -1123,26 +1243,32 @@
         public Type lower;
 
         public TypeVar(Name name, Symbol owner, Type lower) {
-            super(TYPEVAR, null);
+            super(null);
             tsym = new TypeVariableSymbol(0, name, this, owner);
             this.lower = lower;
         }
 
         public TypeVar(TypeSymbol tsym, Type bound, Type lower) {
-            super(TYPEVAR, tsym);
+            super(tsym);
             this.bound = bound;
             this.lower = lower;
         }
 
         @Override
+        public TypeTag getTag() {
+            return TYPEVAR;
+        }
+
+        @Override
         public <R,S> R accept(Type.Visitor<R,S> v, S s) {
             return v.visitTypeVar(this, s);
         }
 
         @Override
         public Type getUpperBound() {
-            if ((bound == null || bound.tag == NONE) && this != tsym.type)
+            if ((bound == null || bound.hasTag(NONE)) && this != tsym.type) {
                 bound = tsym.type.getUpperBound();
+            }
             return bound;
         }
 
@@ -1161,6 +1287,17 @@
             return false;
         }
 
+        @Override
+        public boolean isReference() {
+            return true;
+        }
+
+        @Override
+        public boolean isNullOrReference() {
+            return true;
+        }
+
+        @Override
         public <R, P> R accept(TypeVisitor<R, P> v, P p) {
             return v.visitTypeVariable(this, p);
         }
@@ -1206,10 +1343,13 @@
 
     public static abstract class DelegatedType extends Type {
         public Type qtype;
+        public TypeTag tag;
         public DelegatedType(TypeTag tag, Type qtype) {
-            super(tag, qtype.tsym);
+            super(qtype.tsym);
+            this.tag = tag;
             this.qtype = qtype;
         }
+        public TypeTag getTag() { return tag; }
         public String toString() { return qtype.toString(); }
         public List<Type> getTypeArguments() { return qtype.getTypeArguments(); }
         public Type getEnclosingType() { return qtype.getEnclosingType(); }
@@ -1343,6 +1483,12 @@
             else return qtype + "?";
         }
 
+        @Override
+        public boolean isPartial() {
+            return true;
+        }
+
+        @Override
         public Type baseType() {
             if (inst != null) return inst.baseType();
             else return this;
@@ -1356,11 +1502,6 @@
             }
             return buf.toList();
         }
-        
-        /** internal method used to override an undetvar bounds */
-        public void setBounds(InferenceBound ib, List<Type> newBounds) {
-            bounds.put(ib, newBounds);
-        }
 
         /** get the list of declared (upper) bounds */
         public List<Type> getDeclaredBounds() {
@@ -1373,12 +1514,17 @@
             return buf.toList();
         }
 
+        /** internal method used to override an undetvar bounds */
+        public void setBounds(InferenceBound ib, List<Type> newBounds) {
+            bounds.put(ib, newBounds);
+        }
+
         /** add a bound of a given kind - this might trigger listener notification */
         public final void addBound(InferenceBound ib, Type bound, Types types) {
             addBound(ib, bound, types, false);
         }
-        
-        public void addBound(InferenceBound ib, Type bound, Types types, boolean update) {
+
+        protected void addBound(InferenceBound ib, Type bound, Types types, boolean update) {
             Type bound2 = toTypeVarMap.apply(bound).baseType();
             List<Type> prevBounds = bounds.get(ib);
             for (Type b : prevBounds) {
@@ -1395,7 +1541,7 @@
                 public Type apply(Type t) {
                     if (t.hasTag(UNDETVAR)) {
                         UndetVar uv = (UndetVar)t;
-                        return uv.qtype;
+                        return uv.inst != null ? uv.inst : uv.qtype;
                     } else {
                         return t.map(this);
                     }
@@ -1449,20 +1595,20 @@
                 listener.varChanged(this, ibs);
             }
         }
-        
+
         public boolean isCaptured() {
             return false;
         }
     }
-    
-    /** 
+
+    /**
      * This class is used to represent synthetic captured inference variables
      * that can be generated during nested generic method calls. The only difference
      * between these inference variables and ordinary ones is that captured inference
      * variables cannot get new bounds through incorporation.
      */
     public static class CapturedUndetVar extends UndetVar {
-        
+
         public CapturedUndetVar(CapturedType origin, Types types) {
             super(origin, types);
             if (!origin.lower.hasTag(BOT)) {
@@ -1484,21 +1630,21 @@
         }
     }
 
-    /** Represents VOID or NONE.
+    /** Represents NONE.
      */
-    static class JCNoType extends Type implements NoType {
-        public JCNoType(TypeTag tag) {
-            super(tag, null);
+    public static class JCNoType extends Type implements NoType {
+        public JCNoType() {
+            super(null);
+        }
+
+        @Override
+        public TypeTag getTag() {
+            return NONE;
         }
 
         @Override
         public TypeKind getKind() {
-            switch (tag) {
-            case VOID:  return TypeKind.VOID;
-            case NONE:  return TypeKind.NONE;
-            default:
-                throw new AssertionError("Unexpected tag: " + tag);
-            }
+            return TypeKind.NONE;
         }
 
         @Override
@@ -1507,9 +1653,43 @@
         }
     }
 
+    /** Represents VOID.
+     */
+    public static class JCVoidType extends Type implements NoType {
+
+        public JCVoidType() {
+            super(null);
+        }
+
+        @Override
+        public TypeTag getTag() {
+            return VOID;
+        }
+
+        @Override
+        public TypeKind getKind() {
+            return TypeKind.VOID;
+        }
+
+        @Override
+        public <R, P> R accept(TypeVisitor<R, P> v, P p) {
+            return v.visitNoType(this, p);
+        }
+
+        @Override
+        public boolean isPrimitiveOrVoid() {
+            return true;
+        }
+    }
+
     static class BottomType extends Type implements NullType {
         public BottomType() {
-            super(BOT, null);
+            super(null);
+        }
+
+        @Override
+        public TypeTag getTag() {
+            return BOT;
         }
 
         @Override
@@ -1531,6 +1711,12 @@
         public String stringValue() {
             return "null";
         }
+
+        @Override
+        public boolean isNullOrReference() {
+            return true;
+        }
+
     }
 
     public static class ErrorType extends ClassType
@@ -1540,7 +1726,6 @@
 
         public ErrorType(Type originalType, TypeSymbol tsym) {
             super(noType, List.<Type>nil(), null);
-            tag = ERROR;
             this.tsym = tsym;
             this.originalType = (originalType == null ? noType : originalType);
         }
@@ -1552,6 +1737,26 @@
             c.members_field = new Scope.ErrorScope(c);
         }
 
+        @Override
+        public TypeTag getTag() {
+            return ERROR;
+        }
+
+        @Override
+        public boolean isPartial() {
+            return true;
+        }
+
+        @Override
+        public boolean isReference() {
+            return true;
+        }
+
+        @Override
+        public boolean isNullOrReference() {
+            return true;
+        }
+
         public ErrorType(Name name, TypeSymbol container, Type originalType) {
             this(new ClassSymbol(PUBLIC|STATIC|ACYCLIC, name, null, container), originalType);
         }
@@ -1604,7 +1809,7 @@
         public Type underlyingType;
 
         public AnnotatedType(Type underlyingType) {
-            super(underlyingType.tag, underlyingType.tsym);
+            super(underlyingType.tsym);
             this.typeAnnotations = List.nil();
             this.underlyingType = underlyingType;
             Assert.check(!underlyingType.isAnnotated(),
@@ -1613,7 +1818,7 @@
 
         public AnnotatedType(List<Attribute.TypeCompound> typeAnnotations,
                 Type underlyingType) {
-            super(underlyingType.tag, underlyingType.tsym);
+            super(underlyingType.tsym);
             this.typeAnnotations = typeAnnotations;
             this.underlyingType = underlyingType;
             Assert.check(!underlyingType.isAnnotated(),
@@ -1622,6 +1827,11 @@
         }
 
         @Override
+        public TypeTag getTag() {
+            return underlyingType.getTag();
+        }
+
+        @Override
         public boolean isAnnotated() {
             return true;
         }
@@ -1696,10 +1906,18 @@
         @Override
         public List<Type> allparams()            { return underlyingType.allparams(); }
         @Override
+        public boolean isPrimitive()             { return underlyingType.isPrimitive(); }
+        @Override
+        public boolean isPrimitiveOrVoid()       { return underlyingType.isPrimitiveOrVoid(); }
+        @Override
         public boolean isNumeric()               { return underlyingType.isNumeric(); }
         @Override
         public boolean isReference()             { return underlyingType.isReference(); }
         @Override
+        public boolean isNullOrReference()       { return underlyingType.isNullOrReference(); }
+        @Override
+        public boolean isPartial()               { return underlyingType.isPartial(); }
+        @Override
         public boolean isParameterized()         { return underlyingType.isParameterized(); }
         @Override
         public boolean isRaw()                   { return underlyingType.isRaw(); }
@@ -1764,6 +1982,28 @@
         public TypeMirror getSuperBound()        { return ((WildcardType)underlyingType).getSuperBound(); }
     }
 
+    public static class UnknownType extends Type {
+
+        public UnknownType() {
+            super(null);
+        }
+
+        @Override
+        public TypeTag getTag() {
+            return UNKNOWN;
+        }
+
+        @Override
+        public <R, P> R accept(TypeVisitor<R, P> v, P p) {
+            return v.visitUnknown(this, p);
+        }
+
+        @Override
+        public boolean isPartial() {
+            return true;
+        }
+    }
+
     /**
      * A visitor for types.  A visitor is used to implement operations
      * (or relations) on types.  Most common operations on types are
--- a/src/share/classes/com/sun/tools/javac/code/TypeTag.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/code/TypeTag.java	Thu Aug 22 15:37:58 2013 +0100
@@ -42,132 +42,107 @@
 public enum TypeTag {
     /** The tag of the basic type `byte'.
      */
-    BYTE(BYTE_CLASS, BYTE_SUPERCLASSES,
-            TypeTagKind.PRIMITIVE | TypeTagKind.NUMERIC),
+    BYTE(BYTE_CLASS, BYTE_SUPERCLASSES, true),
 
     /** The tag of the basic type `char'.
      */
-    CHAR(CHAR_CLASS, CHAR_SUPERCLASSES,
-            TypeTagKind.PRIMITIVE | TypeTagKind.NUMERIC),
+    CHAR(CHAR_CLASS, CHAR_SUPERCLASSES, true),
 
     /** The tag of the basic type `short'.
      */
-    SHORT(SHORT_CLASS, SHORT_SUPERCLASSES,
-            TypeTagKind.PRIMITIVE | TypeTagKind.NUMERIC),
-
-    /** The tag of the basic type `int'.
-     */
-    INT(INT_CLASS, INT_SUPERCLASSES,
-            TypeTagKind.PRIMITIVE | TypeTagKind.NUMERIC),
+    SHORT(SHORT_CLASS, SHORT_SUPERCLASSES, true),
 
     /** The tag of the basic type `long'.
      */
-    LONG(LONG_CLASS, LONG_SUPERCLASSES, TypeTagKind.PRIMITIVE | TypeTagKind.NUMERIC),
+    LONG(LONG_CLASS, LONG_SUPERCLASSES, true),
 
     /** The tag of the basic type `float'.
      */
-    FLOAT(FLOAT_CLASS, FLOAT_SUPERCLASSES, TypeTagKind.PRIMITIVE | TypeTagKind.NUMERIC),
-
+    FLOAT(FLOAT_CLASS, FLOAT_SUPERCLASSES, true),
+    /** The tag of the basic type `int'.
+     */
+    INT(INT_CLASS, INT_SUPERCLASSES, true),
     /** The tag of the basic type `double'.
      */
-    DOUBLE(DOUBLE_CLASS, DOUBLE_CLASS, TypeTagKind.PRIMITIVE | TypeTagKind.NUMERIC),
-
+    DOUBLE(DOUBLE_CLASS, DOUBLE_CLASS, true),
     /** The tag of the basic type `boolean'.
      */
-    BOOLEAN(TypeTagKind.PRIMITIVE),
+    BOOLEAN(0, 0, true),
 
     /** The tag of the type `void'.
      */
-    VOID(TypeTagKind.VOID),
+    VOID,
 
     /** The tag of all class and interface types.
      */
-    CLASS(TypeTagKind.REFERENCE),
+    CLASS,
 
     /** The tag of all array types.
      */
-    ARRAY(TypeTagKind.REFERENCE),
+    ARRAY,
 
     /** The tag of all (monomorphic) method types.
      */
-    METHOD(TypeTagKind.OTHER),
+    METHOD,
 
     /** The tag of all package "types".
      */
-    PACKAGE(TypeTagKind.OTHER),
+    PACKAGE,
 
     /** The tag of all (source-level) type variables.
      */
-    TYPEVAR(TypeTagKind.REFERENCE),
+    TYPEVAR,
 
     /** The tag of all type arguments.
      */
-    WILDCARD(TypeTagKind.REFERENCE),
+    WILDCARD,
 
     /** The tag of all polymorphic (method-) types.
      */
-    FORALL(TypeTagKind.OTHER),
+    FORALL,
 
     /** The tag of deferred expression types in method context
      */
-    DEFERRED(TypeTagKind.OTHER),
+    DEFERRED,
 
     /** The tag of the bottom type {@code <null>}.
      */
-    BOT(TypeTagKind.OTHER),
+    BOT,
 
     /** The tag of a missing type.
      */
-    NONE(TypeTagKind.OTHER),
+    NONE,
 
     /** The tag of the error type.
      */
-    ERROR(TypeTagKind.REFERENCE | TypeTagKind.PARTIAL),
+    ERROR,
 
     /** The tag of an unknown type
      */
-    UNKNOWN(TypeTagKind.PARTIAL),
+    UNKNOWN,
 
     /** The tag of all instantiatable type variables.
      */
-    UNDETVAR(TypeTagKind.PARTIAL),
+    UNDETVAR,
 
     /** Pseudo-types, these are special tags
      */
-    UNINITIALIZED_THIS(TypeTagKind.OTHER),
+    UNINITIALIZED_THIS,
 
-    UNINITIALIZED_OBJECT(TypeTagKind.OTHER);
+    UNINITIALIZED_OBJECT;
 
-    final boolean isPrimitive;
-    final boolean isNumeric;
-    final boolean isPartial;
-    final boolean isReference;
-    final boolean isPrimitiveOrVoid;
     final int superClasses;
     final int numericClass;
+    final boolean isPrimitive;
 
-    private TypeTag(int kind) {
-        this(0, 0, kind);
+    private TypeTag() {
+        this(0, 0, false);
     }
 
-    private TypeTag(int numericClass, int superClasses, int kind) {
-         isPrimitive = (kind & TypeTagKind.PRIMITIVE) != 0;
-         isNumeric = (kind & TypeTagKind.NUMERIC) != 0;
-         isPartial = (kind & TypeTagKind.PARTIAL) != 0;
-         isReference = (kind & TypeTagKind.REFERENCE) != 0;
-         isPrimitiveOrVoid = ((kind & TypeTagKind.PRIMITIVE) != 0) ||
-                 ((kind & TypeTagKind.VOID) != 0);
-         this.superClasses = superClasses;
-         this.numericClass = numericClass;
-     }
-
-    static class TypeTagKind {
-        static final int PRIMITIVE = 1;
-        static final int NUMERIC = 2;
-        static final int REFERENCE = 4;
-        static final int PARTIAL = 8;
-        static final int OTHER = 16;
-        static final int VOID = 32;
+    private TypeTag(int numericClass, int superClasses, boolean isPrimitive) {
+        this.superClasses = superClasses;
+        this.numericClass = numericClass;
+        this.isPrimitive = isPrimitive;
     }
 
     public static class NumericClasses {
@@ -261,4 +236,5 @@
             throw new AssertionError("unknown primitive type " + this);
         }
     }
+
 }
--- a/src/share/classes/com/sun/tools/javac/code/Types.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/code/Types.java	Thu Aug 22 15:37:58 2013 +0100
@@ -136,7 +136,7 @@
      * @return the upper bound of the given type
      */
     public Type upperBound(Type t) {
-        return upperBound.visit(t);
+        return upperBound.visit(t).unannotatedType();
     }
     // where
         private final MapVisitor<Void> upperBound = new MapVisitor<Void>() {
@@ -295,8 +295,9 @@
      * conversion to s?
      */
     public boolean isConvertible(Type t, Type s, Warner warn) {
-        if (t.tag == ERROR)
+        if (t.hasTag(ERROR)) {
             return true;
+        }
         boolean tPrimitive = t.isPrimitive();
         boolean sPrimitive = s.isPrimitive();
         if (tPrimitive == sPrimitive) {
@@ -354,7 +355,7 @@
         class FunctionDescriptor {
             Symbol descSym;
 
-            FunctionDescriptor(Symbol descSym, TypeSymbol origin) {
+            FunctionDescriptor(Symbol descSym) {
                 this.descSym = descSym;
             }
 
@@ -405,7 +406,8 @@
         /**
          * Compute the function descriptor associated with a given functional interface
          */
-        public FunctionDescriptor findDescriptorInternal(TypeSymbol origin, CompoundScope membersCache) throws FunctionDescriptorLookupError {
+        public FunctionDescriptor findDescriptorInternal(TypeSymbol origin,
+                CompoundScope membersCache) throws FunctionDescriptorLookupError {
             if (!origin.isInterface() || (origin.flags() & ANNOTATION) != 0) {
                 //t must be an interface
                 throw failure("not.a.functional.intf", origin);
@@ -429,7 +431,7 @@
                 throw failure("not.a.functional.intf.1", origin,
                             diags.fragment("no.abstracts", Kinds.kindName(origin), origin));
             } else if (abstracts.size() == 1) {
-                return new FunctionDescriptor(abstracts.first(), origin);
+                return new FunctionDescriptor(abstracts.first());
             } else { // size > 1
                 FunctionDescriptor descRes = mergeDescriptors(origin, abstracts.toList());
                 if (descRes == null) {
@@ -514,7 +516,7 @@
             }
 
             final List<Type> thrown1 = thrown;
-            return new FunctionDescriptor(bestSoFar, origin) {
+            return new FunctionDescriptor(bestSoFar) {
                 @Override
                 public Type getType(Type origin) {
                     Type mt = memberType(origin, getSymbol());
@@ -612,7 +614,7 @@
             return site;
         }
     }
-    
+
     /**
      * Create a symbol for a class that implements a given functional interface
      * and overrides its functional descriptor. This routine is used for two
@@ -745,17 +747,16 @@
                 }
             } else if (isSubtype(t, s)) {
                 return true;
-            }
-            else if (t.tag == TYPEVAR) {
+            } else if (t.hasTag(TYPEVAR)) {
                 return isSubtypeUnchecked(t.getUpperBound(), s, warn);
-            }
-            else if (!s.isRaw()) {
+            } else if (!s.isRaw()) {
                 Type t2 = asSuper(t, s.tsym);
                 if (t2 != null && t2.isRaw()) {
-                    if (isReifiable(s))
+                    if (isReifiable(s)) {
                         warn.silentWarn(LintCategory.UNCHECKED);
-                    else
+                    } else {
                         warn.warn(LintCategory.UNCHECKED);
+                    }
                     return true;
                 }
             }
@@ -763,13 +764,14 @@
         }
 
         private void checkUnsafeVarargsConversion(Type t, Type s, Warner warn) {
-            if (t.tag != ARRAY || isReifiable(t))
+            if (!t.hasTag(ARRAY) || isReifiable(t)) {
                 return;
+            }
             t = t.unannotatedType();
             s = s.unannotatedType();
             ArrayType from = (ArrayType)t;
             boolean shouldWarn = false;
-            switch (s.tag) {
+            switch (s.getTag()) {
                 case ARRAY:
                     ArrayType to = (ArrayType)s;
                     shouldWarn = from.isVarargs() &&
@@ -825,8 +827,9 @@
     // where
         private TypeRelation isSubtype = new TypeRelation()
         {
+            @Override
             public Boolean visitType(Type t, Type s) {
-                switch (t.tag) {
+                switch (t.getTag()) {
                  case BYTE:
                      return (!s.hasTag(CHAR) && t.getTag().isSubRangeOf(s.getTag()));
                  case CHAR:
@@ -846,7 +849,7 @@
                  case NONE:
                      return false;
                  default:
-                     throw new AssertionError("isSubtype " + t.tag);
+                     throw new AssertionError("isSubtype " + t.getTag());
                  }
             }
 
@@ -916,14 +919,14 @@
 
             @Override
             public Boolean visitArrayType(ArrayType t, Type s) {
-                if (s.tag == ARRAY) {
+                if (s.hasTag(ARRAY)) {
                     if (t.elemtype.isPrimitive())
                         return isSameType(t.elemtype, elemtype(s));
                     else
                         return isSubtypeNoCapture(t.elemtype, elemtype(s));
                 }
 
-                if (s.tag == CLASS) {
+                if (s.hasTag(CLASS)) {
                     Name sname = s.tsym.getQualifiedName();
                     return sname == names.java_lang_Object
                         || sname == names.java_lang_Cloneable
@@ -936,9 +939,9 @@
             @Override
             public Boolean visitUndetVar(UndetVar t, Type s) {
                 //todo: test against origin needed? or replace with substitution?
-                if (t == s || t.qtype == s || s.tag == ERROR || s.tag == UNKNOWN) {
+                if (t == s || t.qtype == s || s.hasTag(ERROR) || s.hasTag(UNKNOWN)) {
                     return true;
-                } else if (s.tag == BOT) {
+                } else if (s.hasTag(BOT)) {
                     //if 's' is 'null' there's no instantiated type U for which
                     //U <: s (but 'null' itself, which is not a valid type)
                     return false;
@@ -1003,15 +1006,17 @@
      * Is t a supertype of s?
      */
     public boolean isSuperType(Type t, Type s) {
-        switch (t.tag) {
+        switch (t.getTag()) {
         case ERROR:
             return true;
         case UNDETVAR: {
             UndetVar undet = (UndetVar)t;
             if (t == s ||
                 undet.qtype == s ||
-                s.tag == ERROR ||
-                s.tag == BOT) return true;
+                s.hasTag(ERROR) ||
+                s.hasTag(BOT)) {
+                return true;
+            }
             undet.addBound(InferenceBound.LOWER, s, this);
             return true;
         }
@@ -1080,12 +1085,12 @@
                 if (s.isPartial())
                     return visit(s, t);
 
-                switch (t.tag) {
+                switch (t.getTag()) {
                 case BYTE: case CHAR: case SHORT: case INT: case LONG: case FLOAT:
                 case DOUBLE: case BOOLEAN: case VOID: case BOT: case NONE:
-                    return t.tag == s.tag;
+                    return t.hasTag(s.getTag());
                 case TYPEVAR: {
-                    if (s.tag == TYPEVAR) {
+                    if (s.hasTag(TYPEVAR)) {
                         //type-substitution does not preserve type-var types
                         //check that type var symbols and bounds are indeed the same
                         return sameTypeVars((TypeVar)t.unannotatedType(), (TypeVar)s.unannotatedType());
@@ -1099,7 +1104,7 @@
                     }
                 }
                 default:
-                    throw new AssertionError("isSameType " + t.tag);
+                    throw new AssertionError("isSameType " + t.getTag());
                 }
             }
 
@@ -1130,9 +1135,9 @@
 
                     HashSet<UniqueType> set = new HashSet<UniqueType>();
                     for (Type x : interfaces(t))
-                        set.add(new UniqueType(x, Types.this));
+                        set.add(new UniqueType(x.unannotatedType(), Types.this));
                     for (Type x : interfaces(s)) {
-                        if (!set.remove(new UniqueType(x, Types.this)))
+                        if (!set.remove(new UniqueType(x.unannotatedType(), Types.this)))
                             return false;
                     }
                     return (set.isEmpty());
@@ -1170,8 +1175,9 @@
 
             @Override
             public Boolean visitForAll(ForAll t, Type s) {
-                if (s.tag != FORALL)
+                if (!s.hasTag(FORALL)) {
                     return false;
+                }
 
                 ForAll forAll = (ForAll)s;
                 return hasSameBounds(t, forAll)
@@ -1180,12 +1186,14 @@
 
             @Override
             public Boolean visitUndetVar(UndetVar t, Type s) {
-                if (s.tag == WILDCARD)
+                if (s.hasTag(WILDCARD)) {
                     // FIXME, this might be leftovers from before capture conversion
                     return false;
-
-                if (t == s || t.qtype == s || s.tag == ERROR || s.tag == UNKNOWN)
+                }
+
+                if (t == s || t.qtype == s || s.hasTag(ERROR) || s.hasTag(UNKNOWN)) {
                     return true;
+                }
 
                 t.addBound(InferenceBound.EQ, s, Types.this);
 
@@ -1261,9 +1269,9 @@
 
     // <editor-fold defaultstate="collapsed" desc="Contains Type">
     public boolean containedBy(Type t, Type s) {
-        switch (t.tag) {
+        switch (t.getTag()) {
         case UNDETVAR:
-            if (s.tag == WILDCARD) {
+            if (s.hasTag(WILDCARD)) {
                 UndetVar undetvar = (UndetVar)t;
                 WildcardType wt = (WildcardType)s.unannotatedType();
                 switch(wt.kind) {
@@ -1331,7 +1339,7 @@
         private TypeRelation containsType = new TypeRelation() {
 
             private Type U(Type t) {
-                while (t.tag == WILDCARD) {
+                while (t.hasTag(WILDCARD)) {
                     WildcardType w = (WildcardType)t.unannotatedType();
                     if (w.isSuperBound())
                         return w.bound == null ? syms.objectType : w.bound.bound;
@@ -1342,7 +1350,7 @@
             }
 
             private Type L(Type t) {
-                while (t.tag == WILDCARD) {
+                while (t.hasTag(WILDCARD)) {
                     WildcardType w = (WildcardType)t.unannotatedType();
                     if (w.isExtendsBound())
                         return syms.botType;
@@ -1388,10 +1396,11 @@
 
             @Override
             public Boolean visitUndetVar(UndetVar t, Type s) {
-                if (s.tag != WILDCARD)
+                if (!s.hasTag(WILDCARD)) {
                     return isSameType(t, s);
-                else
+                } else {
                     return false;
+                }
             }
 
             @Override
@@ -1401,13 +1410,13 @@
         };
 
     public boolean isCaptureOf(Type s, WildcardType t) {
-        if (s.tag != TYPEVAR || !((TypeVar)s.unannotatedType()).isCaptured())
+        if (!s.hasTag(TYPEVAR) || !((TypeVar)s.unannotatedType()).isCaptured())
             return false;
         return isSameWildcard(t, ((CapturedType)s.unannotatedType()).wildcard);
     }
 
     public boolean isSameWildcard(WildcardType t, Type s) {
-        if (s.tag != WILDCARD)
+        if (!s.hasTag(WILDCARD))
             return false;
         WildcardType w = (WildcardType)s.unannotatedType();
         return w.kind == t.kind && w.type == t.type;
@@ -1423,6 +1432,26 @@
     }
     // </editor-fold>
 
+    /**
+     * Can t and s be compared for equality?  Any primitive ==
+     * primitive or primitive == object comparisons here are an error.
+     * Unboxing and correct primitive == primitive comparisons are
+     * already dealt with in Attr.visitBinary.
+     *
+     */
+    public boolean isEqualityComparable(Type s, Type t, Warner warn) {
+        if (t.isNumeric() && s.isNumeric())
+            return true;
+
+        boolean tPrimitive = t.isPrimitive();
+        boolean sPrimitive = s.isPrimitive();
+        if (!tPrimitive && !sPrimitive) {
+            return isCastable(s, t, warn) || isCastable(t, s, warn);
+        } else {
+            return false;
+        }
+    }
+
     // <editor-fold defaultstate="collapsed" desc="isCastable">
     public boolean isCastable(Type t, Type s) {
         return isCastable(t, s, noWarnings);
@@ -1459,15 +1488,15 @@
         private TypeRelation isCastable = new TypeRelation() {
 
             public Boolean visitType(Type t, Type s) {
-                if (s.tag == ERROR)
+                if (s.hasTag(ERROR))
                     return true;
 
-                switch (t.tag) {
+                switch (t.getTag()) {
                 case BYTE: case CHAR: case SHORT: case INT: case LONG: case FLOAT:
                 case DOUBLE:
                     return s.isNumeric();
                 case BOOLEAN:
-                    return s.tag == BOOLEAN;
+                    return s.hasTag(BOOLEAN);
                 case VOID:
                     return false;
                 case BOT:
@@ -1484,10 +1513,10 @@
 
             @Override
             public Boolean visitClassType(ClassType t, Type s) {
-                if (s.tag == ERROR || s.tag == BOT)
+                if (s.hasTag(ERROR) || s.hasTag(BOT))
                     return true;
 
-                if (s.tag == TYPEVAR) {
+                if (s.hasTag(TYPEVAR)) {
                     if (isCastable(t, s.getUpperBound(), noWarnings)) {
                         warnStack.head.warn(LintCategory.UNCHECKED);
                         return true;
@@ -1502,11 +1531,11 @@
                             visitIntersectionType((IntersectionClassType)t.unannotatedType(), s, false);
                 }
 
-                if (s.tag == CLASS || s.tag == ARRAY) {
+                if (s.hasTag(CLASS) || s.hasTag(ARRAY)) {
                     boolean upcast;
                     if ((upcast = isSubtype(erasure(t), erasure(s)))
                         || isSubtype(erasure(s), erasure(t))) {
-                        if (!upcast && s.tag == ARRAY) {
+                        if (!upcast && s.hasTag(ARRAY)) {
                             if (!isReifiable(s))
                                 warnStack.head.warn(LintCategory.UNCHECKED);
                             return true;
@@ -1559,7 +1588,7 @@
                     }
 
                     // Sidecast
-                    if (s.tag == CLASS) {
+                    if (s.hasTag(CLASS)) {
                         if ((s.tsym.flags() & INTERFACE) != 0) {
                             return ((t.tsym.flags() & FINAL) == 0)
                                 ? sideCast(t, s, warnStack.head)
@@ -1591,7 +1620,7 @@
 
             @Override
             public Boolean visitArrayType(ArrayType t, Type s) {
-                switch (s.tag) {
+                switch (s.getTag()) {
                 case ERROR:
                 case BOT:
                     return true;
@@ -1606,7 +1635,7 @@
                     return isSubtype(t, s);
                 case ARRAY:
                     if (elemtype(t).isPrimitive() || elemtype(s).isPrimitive()) {
-                        return elemtype(t).tag == elemtype(s).tag;
+                        return elemtype(t).hasTag(elemtype(s).getTag());
                     } else {
                         return visit(elemtype(t), elemtype(s));
                     }
@@ -1617,7 +1646,7 @@
 
             @Override
             public Boolean visitTypeVar(TypeVar t, Type s) {
-                switch (s.tag) {
+                switch (s.getTag()) {
                 case ERROR:
                 case BOT:
                     return true;
@@ -1669,8 +1698,9 @@
 
             private Set<TypePair> cache = new HashSet<TypePair>();
 
+            @Override
             public Boolean visitType(Type t, Type s) {
-                if (s.tag == WILDCARD)
+                if (s.hasTag(WILDCARD))
                     return visit(s, t);
                 else
                     return notSoftSubtypeRecursive(t, s) || notSoftSubtypeRecursive(s, t);
@@ -1707,10 +1737,10 @@
                 if (t.isUnbound())
                     return false;
 
-                if (s.tag != WILDCARD) {
+                if (!s.hasTag(WILDCARD)) {
                     if (t.isExtendsBound())
                         return notSoftSubtypeRecursive(s, t.type);
-                    else // isSuperBound()
+                    else
                         return notSoftSubtypeRecursive(t.type, s);
                 }
 
@@ -1759,21 +1789,21 @@
      */
     public boolean notSoftSubtype(Type t, Type s) {
         if (t == s) return false;
-        if (t.tag == TYPEVAR) {
+        if (t.hasTag(TYPEVAR)) {
             TypeVar tv = (TypeVar) t;
             return !isCastable(tv.bound,
                                relaxBound(s),
                                noWarnings);
         }
-        if (s.tag != WILDCARD)
+        if (!s.hasTag(WILDCARD))
             s = upperBound(s);
 
         return !isSubtype(t, relaxBound(s));
     }
 
     private Type relaxBound(Type t) {
-        if (t.tag == TYPEVAR) {
-            while (t.tag == TYPEVAR)
+        if (t.hasTag(TYPEVAR)) {
+            while (t.hasTag(TYPEVAR))
                 t = t.getUpperBound();
             t = rewriteQuantifiers(t, true, true);
         }
@@ -1822,16 +1852,16 @@
 
     // <editor-fold defaultstate="collapsed" desc="Array Utils">
     public boolean isArray(Type t) {
-        while (t.tag == WILDCARD)
+        while (t.hasTag(WILDCARD))
             t = upperBound(t);
-        return t.tag == ARRAY;
+        return t.hasTag(ARRAY);
     }
 
     /**
      * The element type of an array.
      */
     public Type elemtype(Type t) {
-        switch (t.tag) {
+        switch (t.getTag()) {
         case WILDCARD:
             return elemtype(upperBound(t));
         case ARRAY:
@@ -1865,7 +1895,7 @@
      */
     public int dimensions(Type t) {
         int result = 0;
-        while (t.tag == ARRAY) {
+        while (t.hasTag(ARRAY)) {
             result++;
             t = elemtype(t);
         }
@@ -1879,8 +1909,7 @@
      * @return the ArrayType for the given component
      */
     public ArrayType makeArrayType(Type t) {
-        if (t.tag == VOID ||
-            t.tag == PACKAGE) {
+        if (t.hasTag(VOID) || t.hasTag(PACKAGE)) {
             Assert.error("Type t must not be a VOID or PACKAGE type, " + t.toString());
         }
         return new ArrayType(t, syms.arrayClass);
@@ -1911,7 +1940,7 @@
                     return t;
 
                 Type st = supertype(t);
-                if (st.tag == CLASS || st.tag == TYPEVAR || st.tag == ERROR) {
+                if (st.hasTag(CLASS) || st.hasTag(TYPEVAR) || st.hasTag(ERROR)) {
                     Type x = asSuper(st, sym);
                     if (x != null)
                         return x;
@@ -1953,13 +1982,13 @@
      * @param sym a symbol
      */
     public Type asOuterSuper(Type t, Symbol sym) {
-        switch (t.tag) {
+        switch (t.getTag()) {
         case CLASS:
             do {
                 Type s = asSuper(t, sym);
                 if (s != null) return s;
                 t = t.getEnclosingType();
-            } while (t.tag == CLASS);
+            } while (t.hasTag(CLASS));
             return null;
         case ARRAY:
             return isSubtype(t, sym.type) ? sym.type : null;
@@ -1980,16 +2009,16 @@
      * @param sym a symbol
      */
     public Type asEnclosingSuper(Type t, Symbol sym) {
-        switch (t.tag) {
+        switch (t.getTag()) {
         case CLASS:
             do {
                 Type s = asSuper(t, sym);
                 if (s != null) return s;
                 Type outer = t.getEnclosingType();
-                t = (outer.tag == CLASS) ? outer :
+                t = (outer.hasTag(CLASS)) ? outer :
                     (t.tsym.owner.enclClass() != null) ? t.tsym.owner.enclClass().type :
                     Type.noType;
-            } while (t.tag == CLASS);
+            } while (t.hasTag(CLASS));
             return null;
         case ARRAY:
             return isSubtype(t, sym.type) ? sym.type : null;
@@ -2077,11 +2106,11 @@
      * (not defined for Method and ForAll types)
      */
     public boolean isAssignable(Type t, Type s, Warner warn) {
-        if (t.tag == ERROR)
+        if (t.hasTag(ERROR))
             return true;
-        if (t.tag.isSubRangeOf(INT) && t.constValue() != null) {
+        if (t.getTag().isSubRangeOf(INT) && t.constValue() != null) {
             int value = ((Number)t.constValue()).intValue();
-            switch (s.tag) {
+            switch (s.getTag()) {
             case BYTE:
                 if (Byte.MIN_VALUE <= value && value <= Byte.MAX_VALUE)
                     return true;
@@ -2097,7 +2126,7 @@
             case INT:
                 return true;
             case CLASS:
-                switch (unboxedType(s).tag) {
+                switch (unboxedType(s).getTag()) {
                 case BYTE:
                 case CHAR:
                 case SHORT:
@@ -2225,7 +2254,7 @@
                             null,
                             syms.noSymbol);
         bc.type = new IntersectionClassType(bounds, bc, allInterfaces);
-        bc.erasure_field = (bounds.head.tag == TYPEVAR) ?
+        bc.erasure_field = (bounds.head.hasTag(TYPEVAR)) ?
                 syms.objectType : // error condition, recover
                 erasure(firstExplicitBound);
         bc.members_field = new Scope(bc);
@@ -2288,7 +2317,7 @@
              */
             @Override
             public Type visitTypeVar(TypeVar t, Void ignored) {
-                if (t.bound.tag == TYPEVAR ||
+                if (t.bound.hasTag(TYPEVAR) ||
                     (!t.bound.isCompound() && !t.bound.isInterface())) {
                     return t.bound;
                 } else {
@@ -2306,7 +2335,7 @@
 
             @Override
             public Type visitErrorType(ErrorType t, Void ignored) {
-                return t;
+                return Type.noType;
             }
         };
     // </editor-fold>
@@ -2592,8 +2621,8 @@
         }
 
         private MethodSymbol implementationInternal(MethodSymbol ms, TypeSymbol origin, boolean checkResult, Filter<Symbol> implFilter) {
-            for (Type t = origin.type; t.tag == CLASS || t.tag == TYPEVAR; t = supertype(t)) {
-                while (t.tag == TYPEVAR)
+            for (Type t = origin.type; t.hasTag(CLASS) || t.hasTag(TYPEVAR); t = supertype(t)) {
+                while (t.hasTag(TYPEVAR))
                     t = t.getUpperBound();
                 TypeSymbol c = t.tsym;
                 for (Scope.Entry e = c.members().lookup(ms.name, implFilter);
@@ -2775,13 +2804,13 @@
 
             @Override
             public Boolean visitMethodType(MethodType t, Type s) {
-                return s.tag == METHOD
+                return s.hasTag(METHOD)
                     && containsTypeEquivalent(t.argtypes, s.getParameterTypes());
             }
 
             @Override
             public Boolean visitForAll(ForAll t, Type s) {
-                if (s.tag != FORALL)
+                if (!s.hasTag(FORALL))
                     return strict ? false : visitMethodType(t.asMethodType(), s);
 
                 ForAll forAll = (ForAll)s;
@@ -2926,7 +2955,7 @@
             if (elemtype == t.elemtype)
                 return t;
             else
-                return new ArrayType(upperBound(elemtype), t.tsym);
+                return new ArrayType(elemtype, t.tsym);
         }
 
         @Override
@@ -3116,7 +3145,7 @@
      */
     public int rank(Type t) {
         t = t.unannotatedType();
-        switch(t.tag) {
+        switch(t.getTag()) {
         case CLASS: {
             ClassType cls = (ClassType)t;
             if (cls.rank_field < 0) {
@@ -3182,7 +3211,7 @@
      */
     @Deprecated
     public String toString(Type t) {
-        if (t.tag == FORALL) {
+        if (t.hasTag(FORALL)) {
             ForAll forAll = (ForAll)t;
             return typaramsString(forAll.tvars) + forAll.qtype;
         }
@@ -3248,9 +3277,9 @@
         if (cl == null) {
             Type st = supertype(t);
             if (!t.isCompound()) {
-                if (st.tag == CLASS) {
+                if (st.hasTag(CLASS)) {
                     cl = insert(closure(st), t);
-                } else if (st.tag == TYPEVAR) {
+                } else if (st.hasTag(TYPEVAR)) {
                     cl = closure(st).prepend(t);
                 } else {
                     cl = List.of(t);
@@ -3310,7 +3339,7 @@
         if (isSameType(cl1.head, cl2.head))
             return intersect(cl1.tail, cl2.tail).prepend(cl1.head);
         if (cl1.head.tsym == cl2.head.tsym &&
-            cl1.head.tag == CLASS && cl2.head.tag == CLASS) {
+            cl1.head.hasTag(CLASS) && cl2.head.hasTag(CLASS)) {
             if (cl1.head.isParameterized() && cl2.head.isParameterized()) {
                 Type merge = merge(cl1.head,cl2.head);
                 return intersect(cl1.tail, cl2.tail).prepend(merge);
@@ -3434,7 +3463,7 @@
         final int CLASS_BOUND = 2;
         int boundkind = 0;
         for (Type t : ts) {
-            switch (t.tag) {
+            switch (t.getTag()) {
             case CLASS:
                 boundkind |= CLASS_BOUND;
                 break;
@@ -3444,8 +3473,8 @@
             case  TYPEVAR:
                 do {
                     t = t.getUpperBound();
-                } while (t.tag == TYPEVAR);
-                if (t.tag == ARRAY) {
+                } while (t.hasTag(TYPEVAR));
+                if (t.hasTag(ARRAY)) {
                     boundkind |= ARRAY_BOUND;
                 } else {
                     boundkind |= CLASS_BOUND;
@@ -3485,13 +3514,14 @@
 
         case CLASS_BOUND:
             // calculate lub(A, B)
-            while (ts.head.tag != CLASS && ts.head.tag != TYPEVAR)
+            while (!ts.head.hasTag(CLASS) && !ts.head.hasTag(TYPEVAR)) {
                 ts = ts.tail;
+            }
             Assert.check(!ts.isEmpty());
             //step 1 - compute erased candidate set (EC)
             List<Type> cl = erasedSupertypes(ts.head);
             for (Type t : ts.tail) {
-                if (t.tag == CLASS || t.tag == TYPEVAR)
+                if (t.hasTag(CLASS) || t.hasTag(TYPEVAR))
                     cl = intersect(cl, erasedSupertypes(t));
             }
             //step 2 - compute minimal erased candidate set (MEC)
@@ -3513,7 +3543,7 @@
             // calculate lub(A, B[])
             List<Type> classes = List.of(arraySuperType());
             for (Type t : ts) {
-                if (t.tag != ARRAY) // Filter out any arrays
+                if (!t.hasTag(ARRAY)) // Filter out any arrays
                     classes = classes.prepend(t);
             }
             // lub(A, B[]) is lub(A, arraySuperType)
@@ -3524,7 +3554,7 @@
         List<Type> erasedSupertypes(Type t) {
             ListBuffer<Type> buf = lb();
             for (Type sup : closure(t)) {
-                if (sup.tag == TYPEVAR) {
+                if (sup.hasTag(TYPEVAR)) {
                     buf.append(sup);
                 } else {
                     buf.append(erasure(sup));
@@ -3600,7 +3630,7 @@
         private static final UnaryVisitor<Integer> hashCode = new UnaryVisitor<Integer>() {
 
             public Integer visitType(Type t, Void ignored) {
-                return t.tag.ordinal();
+                return t.getTag().ordinal();
             }
 
             @Override
@@ -3726,7 +3756,7 @@
      * Return the class that boxes the given primitive.
      */
     public ClassSymbol boxedClass(Type t) {
-        return reader.enterClass(syms.boxedName[t.tag.ordinal()]);
+        return reader.enterClass(syms.boxedName[t.getTag().ordinal()]);
     }
 
     /**
@@ -3758,7 +3788,7 @@
      */
     public Type unboxedTypeOrType(Type t) {
         Type unboxedType = unboxedType(t);
-        return unboxedType.tag == NONE ? t : unboxedType;
+        return unboxedType.hasTag(NONE) ? t : unboxedType;
     }
     // </editor-fold>
 
@@ -3808,7 +3838,7 @@
         return buf.reverse();
     }
     public Type capture(Type t) {
-        if (t.tag != CLASS)
+        if (!t.hasTag(CLASS))
             return t;
         if (t.getEnclosingType() != Type.noType) {
             Type capturedEncl = capture(t.getEnclosingType());
@@ -3874,7 +3904,7 @@
         public List<Type> freshTypeVariables(List<Type> types) {
             ListBuffer<Type> result = lb();
             for (Type t : types) {
-                if (t.tag == WILDCARD) {
+                if (t.hasTag(WILDCARD)) {
                     t = t.unannotatedType();
                     Type bound = ((WildcardType)t).getExtendsBound();
                     if (bound == null)
@@ -4044,14 +4074,14 @@
 
         @Override
         public Void visitClassType(ClassType source, Type target) throws AdaptFailure {
-            if (target.tag == CLASS)
+            if (target.hasTag(CLASS))
                 adaptRecursive(source.allparams(), target.allparams());
             return null;
         }
 
         @Override
         public Void visitArrayType(ArrayType source, Type target) throws AdaptFailure {
-            if (target.tag == ARRAY)
+            if (target.hasTag(ARRAY))
                 adaptRecursive(elemtype(source), elemtype(target));
             return null;
         }
@@ -4233,7 +4263,7 @@
         }
 
         Type B(Type t) {
-            while (t.tag == WILDCARD) {
+            while (t.hasTag(WILDCARD)) {
                 WildcardType w = (WildcardType)t.unannotatedType();
                 t = high ?
                     w.getExtendsBound() :
@@ -4278,7 +4308,7 @@
      * substituted by the wildcard
      */
     private WildcardType makeSuperWildcard(Type bound, TypeVar formal) {
-        if (bound.tag == BOT) {
+        if (bound.hasTag(BOT)) {
             return new WildcardType(syms.objectType,
                                     BoundKind.UNBOUND,
                                     syms.boundClass,
--- a/src/share/classes/com/sun/tools/javac/comp/Annotate.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/comp/Annotate.java	Thu Aug 22 15:37:58 2013 +0100
@@ -273,7 +273,7 @@
                 continue;
             }
             JCIdent left = (JCIdent)assign.lhs;
-            Symbol method = rs.resolveQualifiedMethod(left.pos(),
+            Symbol method = rs.resolveQualifiedMethod(assign.rhs.pos(),
                                                           env,
                                                           a.type,
                                                           left.name,
--- a/src/share/classes/com/sun/tools/javac/comp/Attr.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/comp/Attr.java	Thu Aug 22 15:37:58 2013 +0100
@@ -134,6 +134,7 @@
         allowAnonOuterThis = source.allowAnonOuterThis();
         allowStringsInSwitch = source.allowStringsInSwitch();
         allowPoly = source.allowPoly();
+        allowTypeAnnos = source.allowTypeAnnotations();
         allowLambda = source.allowLambda();
         allowDefaultMethods = source.allowDefaultMethods();
         sourceName = source.name;
@@ -147,6 +148,7 @@
         statInfo = new ResultInfo(NIL, Type.noType);
         varInfo = new ResultInfo(VAR, Type.noType);
         unknownExprInfo = new ResultInfo(VAL, Type.noType);
+        unknownAnyPolyInfo = new ResultInfo(VAL, Infer.anyPoly);
         unknownTypeInfo = new ResultInfo(TYP, Type.noType);
         unknownTypeExprInfo = new ResultInfo(Kinds.TYP | Kinds.VAL, Type.noType);
         recoveryInfo = new RecoveryInfo(deferredAttr.emptyDeferredAttrContext);
@@ -160,6 +162,10 @@
      */
     boolean allowPoly;
 
+    /** Switch: support type annotations.
+     */
+    boolean allowTypeAnnos;
+
     /** Switch: support generics?
      */
     boolean allowGenerics;
@@ -240,7 +246,7 @@
         InferenceContext inferenceContext = resultInfo.checkContext.inferenceContext();
         Type owntype = found;
         if (!owntype.hasTag(ERROR) && !resultInfo.pt.hasTag(METHOD) && !resultInfo.pt.hasTag(FORALL)) {
-            if (inferenceContext.free(found)) {
+            if (allowPoly && inferenceContext.free(found)) {
                 inferenceContext.addFreeTypeListener(List.of(found, resultInfo.pt), new FreeTypeListener() {
                     @Override
                     public void typesInferred(InferenceContext inferenceContext) {
@@ -529,6 +535,7 @@
 
     final ResultInfo statInfo;
     final ResultInfo varInfo;
+    final ResultInfo unknownAnyPolyInfo;
     final ResultInfo unknownExprInfo;
     final ResultInfo unknownTypeInfo;
     final ResultInfo unknownTypeExprInfo;
@@ -585,7 +592,7 @@
             this.resultInfo = prevResult;
         }
     }
-    
+
     Env<AttrContext> copyEnv(Env<AttrContext> env) {
         Env<AttrContext> newEnv =
                 env.dup(env.tree, env.info.dup(copyScope(env.info.scope)));
@@ -659,17 +666,21 @@
             attribStat(l.head, env);
     }
 
-    /** Attribute the arguments in a method call, returning a list of types.
+    /** Attribute the arguments in a method call, returning the method kind.
      */
-    List<Type> attribArgs(List<JCExpression> trees, Env<AttrContext> env) {
-        ListBuffer<Type> argtypes = new ListBuffer<Type>();
+    int attribArgs(List<JCExpression> trees, Env<AttrContext> env, ListBuffer<Type> argtypes) {
+        int kind = VAL;
         for (JCExpression arg : trees) {
-            Type argtype = allowPoly && deferredAttr.isDeferred(env, arg) ?
-                    deferredAttr.new DeferredType(arg, env) :
-                    chk.checkNonVoid(arg, attribExpr(arg, env, Infer.anyPoly));
+            Type argtype;
+            if (allowPoly && deferredAttr.isDeferred(env, arg)) {
+                argtype = deferredAttr.new DeferredType(arg, env);
+                kind |= POLY;
+            } else {
+                argtype = chk.checkNonVoid(arg, attribTree(arg, env, unknownAnyPolyInfo));
+            }
             argtypes.append(argtype);
         }
-        return argtypes.toList();
+        return kind;
     }
 
     /** Attribute a type argument list, returning a list of types.
@@ -740,25 +751,15 @@
                                       JCTree.JCExpression initializer,
                                       Type type) {
 
-        // in case no lint value has been set up for this env, scan up
-        // env stack looking for smallest enclosing env for which it is set.
-        Env<AttrContext> lintEnv = env;
-        while (lintEnv.info.lint == null)
-            lintEnv = lintEnv.next;
-
-        // Having found the enclosing lint value, we can initialize the lint value for this class
-        // ... but ...
-        // There's a problem with evaluating annotations in the right order, such that
-        // 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.annotationsPendingCompletion()) {
-            env.info.lint = lintEnv.info.lint;
-        } else {
-            env.info.lint = lintEnv.info.lint.augment(env.info.enclVar);
-        }
-
-        Lint prevLint = chk.setLint(env.info.lint);
+        /*  When this env was created, it didn't have the correct lint nor had
+         *  annotations has been processed.
+         *  But now at this phase we have already processed annotations and the
+         *  correct lint must have been set in chk, so we should use that one to
+         *  attribute the initializer.
+         */
+        Lint prevLint = env.info.lint;
+        env.info.lint = chk.getLint();
+
         JavaFileObject prevSource = log.useSource(env.toplevel.sourcefile);
 
         try {
@@ -770,10 +771,11 @@
             memberEnter.typeAnnotate(initializer, env, null);
             annotate.flush();
             Type itype = attribExpr(initializer, env, type);
-            if (itype.constValue() != null)
+            if (itype.constValue() != null) {
                 return coerce(itype, type).constValue();
-            else
+            } else {
                 return null;
+            }
         } finally {
             env.info.lint = prevLint;
             log.useSource(prevSource);
@@ -1735,6 +1737,7 @@
         boolean isConstructorCall =
             methName == names._this || methName == names._super;
 
+        ListBuffer<Type> argtypesBuf = ListBuffer.lb();
         if (isConstructorCall) {
             // We are seeing a ...this(...) or ...super(...) call.
             // Check that this is the first statement in a constructor.
@@ -1745,7 +1748,8 @@
                 localEnv.info.isSelfCall = true;
 
                 // Attribute arguments, yielding list of argument types.
-                argtypes = attribArgs(tree.args, localEnv);
+                attribArgs(tree.args, localEnv, argtypesBuf);
+                argtypes = argtypesBuf.toList();
                 typeargtypes = attribTypes(tree.typeargs, localEnv);
 
                 // Variable `site' points to the class in which the called
@@ -1817,7 +1821,8 @@
         } else {
             // Otherwise, we are seeing a regular method call.
             // Attribute the arguments, yielding list of argument types, ...
-            argtypes = attribArgs(tree.args, localEnv);
+            int kind = attribArgs(tree.args, localEnv, argtypesBuf);
+            argtypes = argtypesBuf.toList();
             typeargtypes = attribAnyTypes(tree.typeargs, localEnv);
 
             // ... and attribute the method using as a prototype a methodtype
@@ -1825,7 +1830,7 @@
             // arguments (this will also set the method symbol).
             Type mpt = newMethodTemplate(resultInfo.pt, argtypes, typeargtypes);
             localEnv.info.pendingResolutionPhase = null;
-            Type mtype = attribTree(tree.meth, localEnv, new ResultInfo(VAL, mpt, resultInfo.checkContext));
+            Type mtype = attribTree(tree.meth, localEnv, new ResultInfo(kind, mpt, resultInfo.checkContext));
 
             // Compute the result type.
             Type restype = mtype.getReturnType();
@@ -1943,6 +1948,8 @@
             clazzid1 = make.at(clazz.pos).Select(make.Type(encltype),
                                                  ((JCIdent) clazzid).name);
 
+            EndPosTable endPosTable = this.env.toplevel.endPositions;
+            endPosTable.storeEnd(clazzid1, tree.getEndPosition(endPosTable));
             if (clazz.hasTag(ANNOTATED_TYPE)) {
                 JCAnnotatedType annoType = (JCAnnotatedType) clazz;
                 List<JCAnnotation> annos = annoType.annotations;
@@ -1995,7 +2002,9 @@
         }
 
         // Attribute constructor arguments.
-        List<Type> argtypes = attribArgs(tree.args, localEnv);
+        ListBuffer<Type> argtypesBuf = ListBuffer.lb();
+        int pkind = attribArgs(tree.args, localEnv, argtypesBuf);
+        List<Type> argtypes = argtypesBuf.toList();
         List<Type> typeargtypes = attribTypes(tree.typeargs, localEnv);
 
         // If we have made no mistakes in the class type...
@@ -2082,11 +2091,16 @@
                             clazztype,
                             tree.constructor,
                             rsEnv,
-                            new ResultInfo(MTH, newMethodTemplate(syms.voidType, argtypes, typeargtypes)));
+                            new ResultInfo(pkind, newMethodTemplate(syms.voidType, argtypes, typeargtypes)));
                     if (rsEnv.info.lastResolveVarargs())
                         Assert.check(tree.constructorType.isErroneous() || tree.varargsElement != null);
                 }
-                findDiamondIfNeeded(localEnv, tree, clazztype);
+                if (cdef == null &&
+                        !clazztype.isErroneous() &&
+                        clazztype.getTypeArguments().nonEmpty() &&
+                        findDiamonds) {
+                    findDiamond(localEnv, tree, clazztype);
+                }
             }
 
             if (cdef != null) {
@@ -2153,7 +2167,7 @@
                     clazztype,
                     tree.constructor,
                     localEnv,
-                    new ResultInfo(VAL, newMethodTemplate(syms.voidType, argtypes, typeargtypes)));
+                    new ResultInfo(pkind, newMethodTemplate(syms.voidType, argtypes, typeargtypes)));
             } else {
                 if (tree.clazz.hasTag(ANNOTATED_TYPE)) {
                     checkForDeclarationAnnotations(((JCAnnotatedType) tree.clazz).annotations,
@@ -2168,32 +2182,29 @@
         chk.validate(tree.typeargs, localEnv);
     }
     //where
-        void findDiamondIfNeeded(Env<AttrContext> env, JCNewClass tree, Type clazztype) {
-            if (tree.def == null &&
-                    !clazztype.isErroneous() &&
-                    clazztype.getTypeArguments().nonEmpty() &&
-                    findDiamonds) {
-                JCTypeApply ta = (JCTypeApply)tree.clazz;
-                List<JCExpression> prevTypeargs = ta.arguments;
-                try {
-                    //create a 'fake' diamond AST node by removing type-argument trees
-                    ta.arguments = List.nil();
-                    ResultInfo findDiamondResult = new ResultInfo(VAL,
-                            resultInfo.checkContext.inferenceContext().free(resultInfo.pt) ? Type.noType : pt());
-                    Type inferred = deferredAttr.attribSpeculative(tree, env, findDiamondResult).type;
-                    Type polyPt = allowPoly ?
-                            syms.objectType :
-                            clazztype;
-                    if (!inferred.isErroneous() &&
-                        types.isAssignable(inferred, pt().hasTag(NONE) ? polyPt : pt(), types.noWarnings)) {
-                        String key = types.isSameType(clazztype, inferred) ?
-                            "diamond.redundant.args" :
-                            "diamond.redundant.args.1";
-                        log.warning(tree.clazz.pos(), key, clazztype, inferred);
-                    }
-                } finally {
-                    ta.arguments = prevTypeargs;
+        void findDiamond(Env<AttrContext> env, JCNewClass tree, Type clazztype) {
+            JCTypeApply ta = (JCTypeApply)tree.clazz;
+            List<JCExpression> prevTypeargs = ta.arguments;
+            try {
+                //create a 'fake' diamond AST node by removing type-argument trees
+                ta.arguments = List.nil();
+                ResultInfo findDiamondResult = new ResultInfo(VAL,
+                        resultInfo.checkContext.inferenceContext().free(resultInfo.pt) ? Type.noType : pt());
+                Type inferred = deferredAttr.attribSpeculative(tree, env, findDiamondResult).type;
+                Type polyPt = allowPoly ?
+                        syms.objectType :
+                        clazztype;
+                if (!inferred.isErroneous() &&
+                    (allowPoly && pt() == Infer.anyPoly ?
+                        types.isSameType(inferred, clazztype) :
+                        types.isAssignable(inferred, pt().hasTag(NONE) ? polyPt : pt(), types.noWarnings))) {
+                    String key = types.isSameType(clazztype, inferred) ?
+                        "diamond.redundant.args" :
+                        "diamond.redundant.args.1";
+                    log.warning(tree.clazz.pos(), key, clazztype, inferred);
                 }
+            } finally {
+                ta.arguments = prevTypeargs;
             }
         }
 
@@ -2437,7 +2448,7 @@
                 }
             }.scan(tree);
         }
-    
+
         Types.MapVisitor<DiagnosticPosition> targetChecker = new Types.MapVisitor<DiagnosticPosition>() {
 
             @Override
@@ -2678,11 +2689,11 @@
             setFunctionalInfo(localEnv, that, pt(), desc, target, resultInfo.checkContext);
             List<Type> argtypes = desc.getParameterTypes();
             Resolve.MethodCheck referenceCheck = rs.resolveMethodCheck;
-            
+
             if (resultInfo.checkContext.inferenceContext().free(argtypes)) {
                 referenceCheck = rs.new MethodReferenceCheck(resultInfo.checkContext.inferenceContext());
             }
-            
+
             Pair<Symbol, Resolve.ReferenceLookupHelper> refResult = null;
             List<Type> saved_undet = resultInfo.checkContext.inferenceContext().save();
             try {
@@ -2806,10 +2817,10 @@
             ResultInfo checkInfo =
                     resultInfo.dup(newMethodTemplate(
                         desc.getReturnType().hasTag(VOID) ? Type.noType : desc.getReturnType(),
-                        lookupHelper.argtypes, typeargtypes));
+                        that.kind.isUnbound() ? argtypes.tail : argtypes, typeargtypes));
 
             Type refType = checkId(that, lookupHelper.site, refSym, localEnv, checkInfo);
-            
+
             if (that.kind.isUnbound() &&
                     resultInfo.checkContext.inferenceContext().free(argtypes.head)) {
                 //re-generate inference constraints for unbound receiver
@@ -3023,6 +3034,8 @@
                 !left.isErroneous() &&
                 !right.isErroneous()) {
             owntype = operator.type.getReturnType();
+            // This will figure out when unboxing can happen and
+            // choose the right comparison operator.
             int opc = chk.checkOperator(tree.lhs.pos(),
                                         (OperatorSymbol)operator,
                                         tree.getTag(),
@@ -3050,9 +3063,11 @@
             }
 
             // Check that argument types of a reference ==, != are
-            // castable to each other, (JLS???).
+            // castable to each other, (JLS 15.21).  Note: unboxing
+            // comparisons will not have an acmp* opc at this point.
             if ((opc == ByteCodes.if_acmpeq || opc == ByteCodes.if_acmpne)) {
-                if (!types.isCastable(left, right, new Warner(tree.pos()))) {
+                if (!types.isEqualityComparable(left, right,
+                                                new Warner(tree.pos()))) {
                     log.error(tree.pos(), "incomparable.types", left, right);
                 }
             }
@@ -3071,7 +3086,7 @@
         //should we propagate the target type?
         final ResultInfo castInfo;
         JCExpression expr = TreeInfo.skipParens(tree.expr);
-        boolean isPoly = expr.hasTag(LAMBDA) || expr.hasTag(REFERENCE);
+        boolean isPoly = allowPoly && (expr.hasTag(LAMBDA) || expr.hasTag(REFERENCE));
         if (isPoly) {
             //expression is a poly - we need to propagate target type info
             castInfo = new ResultInfo(VAL, clazztype, new Check.NestedCheckContext(resultInfo.checkContext) {
@@ -3210,7 +3225,7 @@
         if (skind == TYP) {
             Type elt = site;
             while (elt.hasTag(ARRAY))
-                elt = ((ArrayType)elt).elemtype;
+                elt = ((ArrayType)elt.unannotatedType()).elemtype;
             if (elt.hasTag(TYPEVAR)) {
                 log.error(tree.pos(), "type.var.cant.be.deref");
                 result = types.createErrorType(tree.type);
@@ -3460,10 +3475,14 @@
                      Symbol sym,
                      Env<AttrContext> env,
                      ResultInfo resultInfo) {
-            Type pt = resultInfo.pt.map(deferredAttr.new RecoveryDeferredTypeMap(AttrMode.SPECULATIVE, sym, env.info.pendingResolutionPhase));
-            Type owntype = checkIdInternal(tree, site, sym, pt, env, resultInfo);
-            resultInfo.pt.map(deferredAttr.new RecoveryDeferredTypeMap(AttrMode.CHECK, sym, env.info.pendingResolutionPhase));
-            return owntype;
+            if ((resultInfo.pkind & POLY) != 0) {
+                Type pt = resultInfo.pt.map(deferredAttr.new RecoveryDeferredTypeMap(AttrMode.SPECULATIVE, sym, env.info.pendingResolutionPhase));
+                Type owntype = checkIdInternal(tree, site, sym, pt, env, resultInfo);
+                resultInfo.pt.map(deferredAttr.new RecoveryDeferredTypeMap(AttrMode.CHECK, sym, env.info.pendingResolutionPhase));
+                return owntype;
+            } else {
+                return checkIdInternal(tree, site, sym, resultInfo.pt, env, resultInfo);
+            }
         }
 
         Type checkIdInternal(JCTree tree,
@@ -3561,7 +3580,7 @@
                 break;
             case MTH: {
                 owntype = checkMethod(site, sym,
-                        new ResultInfo(VAL, resultInfo.pt.getReturnType(), resultInfo.checkContext),
+                        new ResultInfo(resultInfo.pkind, resultInfo.pt.getReturnType(), resultInfo.checkContext),
                         env, TreeInfo.args(env.tree), resultInfo.pt.getParameterTypes(),
                         resultInfo.pt.getTypeArguments());
                 break;
@@ -4317,17 +4336,34 @@
         if (env.info.lint.isEnabled(LintCategory.SERIAL) &&
             isSerializable(c) &&
             (c.flags() & Flags.ENUM) == 0 &&
-            (c.flags() & ABSTRACT) == 0) {
+            checkForSerial(c)) {
             checkSerialVersionUID(tree, c);
         }
-
-        // Correctly organize the postions of the type annotations
-        TypeAnnotations.organizeTypeAnnotationsBodies(this.syms, this.names, this.log, tree);
-
-        // Check type annotations applicability rules
-        validateTypeAnnotations(tree);
+        if (allowTypeAnnos) {
+            // Correctly organize the postions of the type annotations
+            TypeAnnotations.organizeTypeAnnotationsBodies(this.syms, this.names, this.log, tree);
+
+            // Check type annotations applicability rules
+            validateTypeAnnotations(tree);
+        }
     }
         // where
+        boolean checkForSerial(ClassSymbol c) {
+            if ((c.flags() & ABSTRACT) == 0) {
+                return true;
+            } else {
+                return c.members().anyMatch(anyNonAbstractOrDefaultMethod);
+            }
+        }
+
+        public static final Filter<Symbol> anyNonAbstractOrDefaultMethod = new Filter<Symbol>() {
+            @Override
+            public boolean accepts(Symbol s) {
+                return s.kind == Kinds.MTH &&
+                       (s.flags() & (DEFAULT | ABSTRACT)) != ABSTRACT;
+            }
+        };
+
         /** get a diagnostic position for an attribute of Type t, or null if attribute missing */
         private DiagnosticPosition getDiagnosticPosition(JCClassDecl tree, Type t) {
             for(List<JCAnnotation> al = tree.mods.annotations; !al.isEmpty(); al = al.tail) {
--- a/src/share/classes/com/sun/tools/javac/comp/Check.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/comp/Check.java	Thu Aug 22 15:37:58 2013 +0100
@@ -218,6 +218,14 @@
         return prev;
     }
 
+    /*  This idiom should be used only in cases when it is needed to set the lint
+     *  of an environment that has been created in a phase previous to annotations
+     *  processing.
+     */
+    Lint getLint() {
+        return lint;
+    }
+
     DeferredLintHandler setDeferredLintHandler(DeferredLintHandler newDeferredLintHandler) {
         DeferredLintHandler prev = deferredLintHandler;
         deferredLintHandler = newDeferredLintHandler;
@@ -889,7 +897,8 @@
                     assertConvertible(arg, arg.type, varArg, warn);
                     args = args.tail;
                 }
-            } else if ((sym.flags() & VARARGS) != 0 && allowVarargs) {
+            } else if ((sym.flags() & (VARARGS | SIGNATURE_POLYMORPHIC)) == VARARGS &&
+                    allowVarargs) {
                 // non-varargs call to varargs method
                 Type varParam = owntype.getParameterTypes().last();
                 Type lastArg = argtypes.last();
@@ -3050,7 +3059,7 @@
         for (Scope.Entry e = a.annotationType.type.tsym.members().elems;
                 e != null;
                 e = e.sibling)
-            if (e.sym.kind == MTH && e.sym.name != names.clinit && 
+            if (e.sym.kind == MTH && e.sym.name != names.clinit &&
                     (e.sym.flags() & SYNTHETIC) == 0)
                 members.add((MethodSymbol) e.sym);
 
--- a/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java	Thu Aug 22 15:37:58 2013 +0100
@@ -38,6 +38,7 @@
 import com.sun.tools.javac.comp.Resolve.ReferenceLookupHelper;
 import com.sun.tools.javac.tree.JCTree.*;
 
+
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.EnumSet;
@@ -127,12 +128,17 @@
         SpeculativeCache speculativeCache;
 
         DeferredType(JCExpression tree, Env<AttrContext> env) {
-            super(DEFERRED, null);
+            super(null);
             this.tree = tree;
             this.env = attr.copyEnv(env);
             this.speculativeCache = new SpeculativeCache();
         }
 
+        @Override
+        public TypeTag getTag() {
+            return DEFERRED;
+        }
+
         /**
          * A speculative cache is used to keep track of all overload resolution rounds
          * that triggered speculative attribution on a given deferred type. Each entry
@@ -1117,7 +1123,7 @@
             Type site = rec != null ?
                     attribSpeculative(rec, env, attr.unknownTypeExprInfo).type :
                     env.enclClass.sym.type;
-            
+
             while (site.hasTag(TYPEVAR)) {
                 site = site.getUpperBound();
             }
@@ -1142,10 +1148,8 @@
             if (sym.kind == Kinds.AMBIGUOUS) {
                 Resolve.AmbiguityError err = (Resolve.AmbiguityError)sym.baseSymbol();
                 result = ArgumentExpressionKind.PRIMITIVE;
-                for (List<Symbol> ambigousSyms = err.ambiguousSyms ;
-                        ambigousSyms.nonEmpty() && !result.isPoly() ;
-                        ambigousSyms = ambigousSyms.tail) {
-                    Symbol s = ambigousSyms.head;
+                for (Symbol s : err.ambiguousSyms) {
+                    if (result.isPoly()) break;
                     if (s.kind == Kinds.MTH) {
                         result = reduce(ArgumentExpressionKind.methodKind(s, types));
                     }
--- a/src/share/classes/com/sun/tools/javac/comp/Env.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/comp/Env.java	Thu Aug 22 15:37:58 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -124,7 +124,16 @@
 
     @Override
     public String toString() {
-        return "Env[" + info + (outer == null ? "" : ",outer=" + outer) + "]";
+        StringBuilder sb = new StringBuilder();
+        sb.append("Env[").append(info);
+//        if (enclMethod != null)
+//            sb.append(",enclMethod=").append(Pretty.toSimpleString(enclMethod));
+//        if (enclClass != null)
+//            sb.append(",enclClass=").append(Pretty.toSimpleString(enclClass));
+        if (outer != null)
+            sb.append(",outer=").append(outer);
+        sb.append("]");
+        return sb.toString();
     }
 
     public Iterator<Env<A>> iterator() {
--- a/src/share/classes/com/sun/tools/javac/comp/Flow.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/comp/Flow.java	Thu Aug 22 15:37:58 2013 +0100
@@ -1339,7 +1339,7 @@
 
         /** A mapping from addresses to variable symbols.
          */
-        VarSymbol[] vars;
+        JCVariableDecl[] vardecls;
 
         /** The current class being defined.
          */
@@ -1417,13 +1417,14 @@
          *  to the next available sequence number and entering it under that
          *  index into the vars array.
          */
-        void newVar(VarSymbol sym) {
-            vars = ArrayUtils.ensureCapacity(vars, nextadr);
+        void newVar(JCVariableDecl varDecl) {
+            VarSymbol sym = varDecl.sym;
+            vardecls = ArrayUtils.ensureCapacity(vardecls, nextadr);
             if ((sym.flags() & FINAL) == 0) {
                 sym.flags_field |= EFFECTIVELY_FINAL;
             }
             sym.adr = nextadr;
-            vars[nextadr] = sym;
+            vardecls[nextadr] = varDecl;
             inits.excl(nextadr);
             uninits.incl(nextadr);
             nextadr++;
@@ -1493,11 +1494,13 @@
         /** Check that trackable variable is initialized.
          */
         void checkInit(DiagnosticPosition pos, VarSymbol sym) {
+            checkInit(pos, sym, "var.might.not.have.been.initialized");
+        }
+        void checkInit(DiagnosticPosition pos, VarSymbol sym, String errkey) {
             if ((sym.adr >= firstadr || sym.owner.kind != TYP) &&
                 trackable(sym) &&
                 !inits.isMember(sym.adr)) {
-                log.error(pos, "var.might.not.have.been.initialized",
-                          sym);
+                log.error(pos, errkey, sym);
                 inits.incl(sym.adr);
             }
         }
@@ -1599,7 +1602,7 @@
                         if ((def.mods.flags & STATIC) != 0) {
                             VarSymbol sym = def.sym;
                             if (trackable(sym))
-                                newVar(sym);
+                                newVar(def);
                         }
                     }
                 }
@@ -1619,7 +1622,7 @@
                         if ((def.mods.flags & STATIC) == 0) {
                             VarSymbol sym = def.sym;
                             if (trackable(sym))
-                                newVar(sym);
+                                newVar(def);
                         }
                     }
                 }
@@ -1678,9 +1681,22 @@
                 scan(tree.body);
 
                 if (isInitialConstructor) {
-                    for (int i = firstadr; i < nextadr; i++)
-                        if (vars[i].owner == classDef.sym)
-                            checkInit(TreeInfo.diagEndPos(tree.body), vars[i]);
+                    boolean isSynthesized = (tree.sym.flags() &
+                                             GENERATEDCONSTR) != 0;
+                    for (int i = firstadr; i < nextadr; i++) {
+                        JCVariableDecl vardecl = vardecls[i];
+                        VarSymbol var = vardecl.sym;
+                        if (var.owner == classDef.sym) {
+                            // choose the diagnostic position based on whether
+                            // the ctor is default(synthesized) or not
+                            if (isSynthesized) {
+                                checkInit(TreeInfo.diagnosticPositionFor(var, vardecl),
+                                    var, "var.not.initialized.in.default.constructor");
+                            } else {
+                                checkInit(TreeInfo.diagEndPos(tree.body), var);
+                            }
+                        }
+                    }
                 }
                 List<AssignPendingExit> exits = pendingExits.toList();
                 pendingExits = new ListBuffer<AssignPendingExit>();
@@ -1691,7 +1707,7 @@
                     if (isInitialConstructor) {
                         inits.assign(exit.exit_inits);
                         for (int i = firstadr; i < nextadr; i++)
-                            checkInit(exit.tree.pos(), vars[i]);
+                            checkInit(exit.tree.pos(), vardecls[i].sym);
                     }
                 }
             } finally {
@@ -1706,7 +1722,7 @@
 
         public void visitVarDef(JCVariableDecl tree) {
             boolean track = trackable(tree.sym);
-            if (track && tree.sym.owner.kind == MTH) newVar(tree.sym);
+            if (track && tree.sym.owner.kind == MTH) newVar(tree);
             if (tree.init != null) {
                 Lint lintPrev = lint;
                 lint = lint.augment(tree.sym);
@@ -1954,10 +1970,17 @@
                 }
             }
 
+            /*  The analysis of each catch should be independent.
+             *  Each one should have the same initial values of inits and
+             *  uninits.
+             */
+            final Bits initsCatchPrev = new Bits(initsTry);
+            final Bits uninitsCatchPrev = new Bits(uninitsTry);
+
             for (List<JCCatch> l = tree.catchers; l.nonEmpty(); l = l.tail) {
                 JCVariableDecl param = l.head.param;
-                inits.assign(initsTry);
-                uninits.assign(uninitsTry);
+                inits.assign(initsCatchPrev);
+                uninits.assign(uninitsCatchPrev);
                 scan(param);
                 inits.incl(param.sym.adr);
                 uninits.excl(param.sym.adr);
@@ -2232,11 +2255,11 @@
                 Flow.this.make = make;
                 startPos = tree.pos().getStartPosition();
 
-                if (vars == null)
-                    vars = new VarSymbol[32];
+                if (vardecls == null)
+                    vardecls = new JCVariableDecl[32];
                 else
-                    for (int i=0; i<vars.length; i++)
-                        vars[i] = null;
+                    for (int i=0; i<vardecls.length; i++)
+                        vardecls[i] = null;
                 firstadr = 0;
                 nextadr = 0;
                 pendingExits = new ListBuffer<AssignPendingExit>();
@@ -2248,8 +2271,8 @@
                 startPos = -1;
                 resetBits(inits, uninits, uninitsTry, initsWhenTrue,
                         initsWhenFalse, uninitsWhenTrue, uninitsWhenFalse);
-                if (vars != null) for (int i=0; i<vars.length; i++)
-                    vars[i] = null;
+                if (vardecls != null) for (int i=0; i<vardecls.length; i++)
+                    vardecls[i] = null;
                 firstadr = 0;
                 nextadr = 0;
                 pendingExits = null;
--- a/src/share/classes/com/sun/tools/javac/comp/Infer.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/comp/Infer.java	Thu Aug 22 15:37:58 2013 +0100
@@ -98,7 +98,7 @@
     }
 
     /** A value for prototypes that admit any type, including polymorphic ones. */
-    public static final Type anyPoly = new Type(NONE, null);
+    public static final Type anyPoly = new JCNoType();
 
    /**
     * This exception class is design to store a list of diagnostics corresponding
@@ -177,7 +177,7 @@
                     return mt;
                 }
             }
-            
+
             deferredAttrContext.complete();
 
             // minimize as yet undetermined type variables
@@ -589,7 +589,7 @@
          * Check consistency of equality constraints.
          */
         EQ_CHECK() {
-            public void apply(UndetVar uv, InferenceContext inferenceContext, Warner warn) {                
+            public void apply(UndetVar uv, InferenceContext inferenceContext, Warner warn) {
                 Infer infer = inferenceContext.infer();
                 for (Type e : uv.getBounds(InferenceBound.EQ)) {
                     if (e.containsAny(inferenceContext.inferenceVars())) continue;
@@ -611,7 +611,7 @@
          * perform {@code S <: T} (which could lead to new bounds).
          */
         CROSS_UPPER_LOWER() {
-            public void apply(UndetVar uv, InferenceContext inferenceContext, Warner warn) {                
+            public void apply(UndetVar uv, InferenceContext inferenceContext, Warner warn) {
                 Infer infer = inferenceContext.infer();
                 for (Type b1 : uv.getBounds(InferenceBound.UPPER)) {
                     for (Type b2 : uv.getBounds(InferenceBound.LOWER)) {
@@ -625,7 +625,7 @@
          * perform {@code S <: T} (which could lead to new bounds).
          */
         CROSS_UPPER_EQ() {
-            public void apply(UndetVar uv, InferenceContext inferenceContext, Warner warn) {                
+            public void apply(UndetVar uv, InferenceContext inferenceContext, Warner warn) {
                 Infer infer = inferenceContext.infer();
                 for (Type b1 : uv.getBounds(InferenceBound.UPPER)) {
                     for (Type b2 : uv.getBounds(InferenceBound.EQ)) {
@@ -639,7 +639,7 @@
          * perform {@code S <: T} (which could lead to new bounds).
          */
         CROSS_EQ_LOWER() {
-            public void apply(UndetVar uv, InferenceContext inferenceContext, Warner warn) {                
+            public void apply(UndetVar uv, InferenceContext inferenceContext, Warner warn) {
                 Infer infer = inferenceContext.infer();
                 for (Type b1 : uv.getBounds(InferenceBound.EQ)) {
                     for (Type b2 : uv.getBounds(InferenceBound.LOWER)) {
@@ -653,7 +653,7 @@
          * perform {@code S == T} (which could lead to new bounds).
          */
         CROSS_EQ_EQ() {
-            public void apply(UndetVar uv, InferenceContext inferenceContext, Warner warn) {                
+            public void apply(UndetVar uv, InferenceContext inferenceContext, Warner warn) {
                 Infer infer = inferenceContext.infer();
                 for (Type b1 : uv.getBounds(InferenceBound.EQ)) {
                     for (Type b2 : uv.getBounds(InferenceBound.EQ)) {
@@ -733,7 +733,7 @@
                         //1. copy all alpha's bounds to beta's
                         for (InferenceBound ib : InferenceBound.values()) {
                             for (Type b2 : uv.getBounds(ib)) {
-                                if (b2 != uv2) {                                    
+                                if (b2 != uv2) {
                                     addBound(ib, uv2, inferenceContext.asInstType(b2), infer);
                                 }
                             }
@@ -752,23 +752,23 @@
         };
 
         abstract void apply(UndetVar uv, InferenceContext inferenceContext, Warner warn);
-        
+
         boolean accepts(UndetVar uv, InferenceContext inferenceContext) {
             return !uv.isCaptured();
         }
-        
+
         boolean isSubtype(Type s, Type t, Warner warn, Infer infer) {
             return doIncorporationOp(IncorporationBinaryOpKind.IS_SUBTYPE, s, t, warn, infer);
         }
-        
+
         boolean isSameType(Type s, Type t, Infer infer) {
             return doIncorporationOp(IncorporationBinaryOpKind.IS_SAME_TYPE, s, t, null, infer);
         }
-        
+
         void addBound(InferenceBound ib, UndetVar uv, Type b, Infer infer) {
             doIncorporationOp(opFor(ib), uv, b, null, infer);
         }
-        
+
         IncorporationBinaryOpKind opFor(InferenceBound boundKind) {
             switch (boundKind) {
                 case EQ:
@@ -782,7 +782,7 @@
                     return null;
             }
         }
-        
+
         boolean doIncorporationOp(IncorporationBinaryOpKind opKind, Type op1, Type op2, Warner warn, Infer infer) {
             IncorporationBinaryOp newOp = infer.new IncorporationBinaryOp(opKind, op1, op2);
             Boolean res = infer.incorporationCache.get(newOp);
@@ -799,7 +799,7 @@
     /** incorporation steps to be executed when running in graph mode */
     EnumSet<IncorporationStep> incorporationStepsGraph =
             EnumSet.complementOf(EnumSet.of(IncorporationStep.EQ_CHECK_LEGACY));
-    
+
     /**
      * Three kinds of basic operation are supported as part of an incorporation step:
      * (i) subtype check, (ii) same type check and (iii) bound addition (either
@@ -845,7 +845,7 @@
 
         abstract boolean apply(Type op1, Type op2, Warner warn, Types types);
     }
-    
+
     /**
      * This class encapsulates a basic incorporation operation; incorporation
      * operations takes two type operands and a kind. Each operation performed
@@ -854,7 +854,7 @@
      * same bounds over and over).
      */
     class IncorporationBinaryOp {
-        
+
         IncorporationBinaryOpKind opKind;
         Type op1;
         Type op2;
@@ -862,7 +862,7 @@
         IncorporationBinaryOp(IncorporationBinaryOpKind opKind, Type op1, Type op2) {
             this.opKind = opKind;
             this.op1 = op1;
-            this.op2 = op2;            
+            this.op2 = op2;
         }
 
         @Override
@@ -1166,7 +1166,6 @@
                 }
             }
         },
-
         /**
          * Infer uninstantiated/unbound inference variables occurring in 'throws'
          * clause as RuntimeException
@@ -1314,7 +1313,7 @@
 
         EQ(EnumSet.of(InferenceStep.EQ)),
         EQ_LOWER(EnumSet.of(InferenceStep.EQ, InferenceStep.LOWER)),
-        EQ_LOWER_THROWS_UPPER(EnumSet.of(InferenceStep.EQ, InferenceStep.LOWER, InferenceStep.THROWS, InferenceStep.UPPER, InferenceStep.CAPTURED));
+        EQ_LOWER_THROWS_UPPER_CAPTURED(EnumSet.of(InferenceStep.EQ, InferenceStep.LOWER, InferenceStep.UPPER, InferenceStep.THROWS, InferenceStep.CAPTURED));
 
         final EnumSet<InferenceStep> steps;
 
@@ -1741,7 +1740,7 @@
                     }
                 }
             };
-            
+
         /**
          * add a new inference var to this inference context
          */
@@ -1951,7 +1950,7 @@
          * Restore the state of this inference context to the previous known checkpoint
          */
         void rollback(List<Type> saved_undet) {
-            Assert.check(saved_undet != null && saved_undet.length() == undetvars.length());
+             Assert.check(saved_undet != null && saved_undet.length() == undetvars.length());
             //restore bounds (note: we need to preserve the old instances)
             for (Type t : undetvars) {
                 UndetVar uv = (UndetVar)t;
--- a/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java	Thu Aug 22 15:37:58 2013 +0100
@@ -911,7 +911,7 @@
     private void bridgeMemberReference(JCMemberReference tree, ReferenceTranslationContext localContext) {
         kInfo.addMethod(new MemberReferenceBridger(tree, localContext).bridge());
     }
-    
+
     private MethodType typeToMethodType(Type mt) {
         Type type = types.erasure(mt);
         return new MethodType(type.getParameterTypes(),
--- a/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java	Thu Aug 22 15:37:58 2013 +0100
@@ -109,15 +109,20 @@
         source = Source.instance(context);
         target = Target.instance(context);
         deferredLintHandler = DeferredLintHandler.instance(context);
+        allowTypeAnnos = source.allowTypeAnnotations();
     }
 
+    /** Switch: support type annotations.
+     */
+    boolean allowTypeAnnos;
+
     /** A queue for classes whose members still need to be entered into the
      *  symbol table.
      */
     ListBuffer<Env<AttrContext>> halfcompleted = new ListBuffer<Env<AttrContext>>();
 
     /** Set to true only when the first of a set of classes is
-     *  processed from the halfcompleted queue.
+     *  processed from the half completed queue.
      */
     boolean isFirst = true;
 
@@ -503,11 +508,17 @@
         // process package annotations
         annotateLater(tree.packageAnnotations, env, tree.packge);
 
-        // Import-on-demand java.lang.
-        importAll(tree.pos, reader.enterPackage(names.java_lang), env);
+        DeferredLintHandler prevLintHandler = chk.setDeferredLintHandler(DeferredLintHandler.immediateHandler);
 
-        // Process all import clauses.
-        memberEnter(tree.defs, env);
+        try {
+            // Import-on-demand java.lang.
+            importAll(tree.pos, reader.enterPackage(names.java_lang), env);
+
+            // Process all import clauses.
+            memberEnter(tree.defs, env);
+        } finally {
+            chk.setDeferredLintHandler(prevLintHandler);
+        }
     }
 
     // process the non-static imports and the static imports of types.
@@ -1077,7 +1088,9 @@
                 isFirst = true;
             }
         }
-        TypeAnnotations.organizeTypeAnnotationsSignatures(syms, names, log, tree, annotate);
+        if (allowTypeAnnos) {
+            TypeAnnotations.organizeTypeAnnotationsSignatures(syms, names, log, tree, annotate);
+        }
     }
 
     /*
@@ -1122,7 +1135,9 @@
     }
 
     public void typeAnnotate(final JCTree tree, final Env<AttrContext> env, final Symbol sym) {
-        tree.accept(new TypeAnnotate(env, sym));
+        if (allowTypeAnnos) {
+            tree.accept(new TypeAnnotate(env, sym));
+        }
     }
 
     /**
--- a/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Thu Aug 22 15:37:58 2013 +0100
@@ -345,7 +345,7 @@
 
     boolean isAccessible(Env<AttrContext> env, Type t, boolean checkInner) {
         return (t.hasTag(ARRAY))
-            ? isAccessible(env, types.elemtype(t))
+            ? isAccessible(env, types.upperBound(types.elemtype(t)))
             : isAccessible(env, t.tsym, checkInner);
     }
 
@@ -586,7 +586,7 @@
         try {
             currentResolutionContext = new MethodResolutionContext();
             currentResolutionContext.attrMode = DeferredAttr.AttrMode.CHECK;
-            if (env.tree.getTag() == JCTree.Tag.REFERENCE) {
+            if (env.tree.hasTag(JCTree.Tag.REFERENCE)) {
                 //method/constructor references need special check class
                 //to handle inference variables in 'argtypes' (might happen
                 //during an unsticking round)
@@ -781,7 +781,7 @@
             //do nothing - actual always compatible to formals
         }
     };
-    
+
     List<Type> dummyArgs(int length) {
         ListBuffer<Type> buf = ListBuffer.lb();
         for (int i = 0 ; i < length ; i++) {
@@ -874,7 +874,7 @@
      * extended so that inference variables are 'opened' as needed.
      */
     class MethodReferenceCheck extends AbstractMethodCheck {
-        
+
         InferenceContext pendingInferenceContext;
 
         MethodReferenceCheck(InferenceContext pendingInferenceContext) {
@@ -972,7 +972,7 @@
                 return super.check(pos, chk.checkNonVoid(pos, types.capture(U(found.baseType()))));
             }
         }
-        
+
         /**
          * javac has a long-standing 'simplification' (see 6391995):
          * given an actual argument type, the method check is performed
@@ -981,7 +981,7 @@
          * a type-variable T, it is not true that {@code U(T) <: T},
          * so we need to guard against that.
          */
-        private Type U(Type found) {            
+        private Type U(Type found) {
             return found == pt ?
                     found : types.upperBound(found);
         }
@@ -1651,7 +1651,6 @@
                           allowBoxing,
                           useVarargs,
                           operator);
-        reportVerboseResolutionDiagnostic(env.tree.pos(), name, site, argtypes, typeargtypes, bestSoFar);
         return bestSoFar;
     }
     // where
@@ -2302,7 +2301,7 @@
         return lookupMethod(env, pos, env.enclClass.sym, resolveMethodCheck,
                 new BasicLookupHelper(name, env.enclClass.sym.type, argtypes, typeargtypes) {
                     @Override
-                    Symbol lookup(Env<AttrContext> env, MethodResolutionPhase phase) {
+                    Symbol doLookup(Env<AttrContext> env, MethodResolutionPhase phase) {
                         return findFun(env, name, argtypes, typeargtypes,
                                 phase.isBoxingRequired(),
                                 phase.isVarargsRequired());
@@ -2334,7 +2333,7 @@
                                   List<Type> typeargtypes) {
         return lookupMethod(env, pos, location, resolveContext, new BasicLookupHelper(name, site, argtypes, typeargtypes) {
             @Override
-            Symbol lookup(Env<AttrContext> env, MethodResolutionPhase phase) {
+            Symbol doLookup(Env<AttrContext> env, MethodResolutionPhase phase) {
                 return findMethod(env, site, name, argtypes, typeargtypes,
                         phase.isBoxingRequired(),
                         phase.isVarargsRequired(), false);
@@ -2433,7 +2432,7 @@
                               List<Type> typeargtypes) {
         return lookupMethod(env, pos, site.tsym, resolveContext, new BasicLookupHelper(names.init, site, argtypes, typeargtypes) {
             @Override
-            Symbol lookup(Env<AttrContext> env, MethodResolutionPhase phase) {
+            Symbol doLookup(Env<AttrContext> env, MethodResolutionPhase phase) {
                 return findConstructor(pos, env, site, argtypes, typeargtypes,
                         phase.isBoxingRequired(),
                         phase.isVarargsRequired());
@@ -2491,7 +2490,7 @@
         return lookupMethod(env, pos, site.tsym, resolveMethodCheck,
                 new BasicLookupHelper(names.init, site, argtypes, typeargtypes) {
                     @Override
-                    Symbol lookup(Env<AttrContext> env, MethodResolutionPhase phase) {
+                    Symbol doLookup(Env<AttrContext> env, MethodResolutionPhase phase) {
                         return findDiamond(env, site, argtypes, typeargtypes,
                                 phase.isBoxingRequired(),
                                 phase.isVarargsRequired());
@@ -2581,7 +2580,7 @@
             return lookupMethod(env, pos, syms.predefClass, currentResolutionContext,
                     new BasicLookupHelper(name, syms.predefClass.type, argtypes, null, BOX) {
                 @Override
-                Symbol lookup(Env<AttrContext> env, MethodResolutionPhase phase) {
+                Symbol doLookup(Env<AttrContext> env, MethodResolutionPhase phase) {
                     return findMethod(env, site, name, argtypes, typeargtypes,
                             phase.isBoxingRequired(),
                             phase.isVarargsRequired(), true);
@@ -2658,12 +2657,12 @@
                                   MethodCheck methodCheck,
                                   InferenceContext inferenceContext) {
         MethodResolutionPhase maxPhase = boxingAllowed ? VARARITY : BASIC;
-        
+
         if (site.hasTag(TYPEVAR)) {
             return resolveMemberReference(pos, env, referenceTree, site.getUpperBound(),
                     name, argtypes, typeargtypes, boxingAllowed, methodCheck, inferenceContext);
         }
-        
+
         site = types.capture(site);
 
         ReferenceLookupHelper boundLookupHelper;
@@ -2715,11 +2714,11 @@
                 return s1;
             }
         }
-        
+
         private boolean lookupSuccess(Symbol s) {
             return s.kind == MTH || s.kind == AMBIGUOUS;
         }
-        
+
         private boolean canIgnore(Symbol s) {
             switch (s.kind) {
                 case ABSENT_MTH:
@@ -2729,7 +2728,7 @@
                             (InapplicableSymbolError)s;
                     return new Template(MethodCheckDiag.ARITY_MISMATCH.regex())
                             .matches(errSym.errCandidate().snd);
-                case WRONG_MTHS: 
+                case WRONG_MTHS:
                     InapplicableSymbolsError errSyms =
                             (InapplicableSymbolsError)s;
                     return errSyms.filterCandidates(errSyms.mapCandidates()).isEmpty();
@@ -2783,6 +2782,13 @@
         abstract Symbol lookup(Env<AttrContext> env, MethodResolutionPhase phase);
 
         /**
+         * Dump overload resolution info
+         */
+        void debug(DiagnosticPosition pos, Symbol sym) {
+            //do nothing
+        }
+
+        /**
          * Validate the result of the lookup
          */
         abstract Symbol access(Env<AttrContext> env, DiagnosticPosition pos, Symbol location, Symbol sym);
@@ -2799,17 +2805,30 @@
         }
 
         @Override
-        Symbol access(Env<AttrContext> env, DiagnosticPosition pos, Symbol location, Symbol sym) {
+        final Symbol lookup(Env<AttrContext> env, MethodResolutionPhase phase) {
+            Symbol sym = doLookup(env, phase);
             if (sym.kind == AMBIGUOUS) {
                 AmbiguityError a_err = (AmbiguityError)sym;
                 sym = a_err.mergeAbstracts(site);
             }
+            return sym;
+        }
+
+        abstract Symbol doLookup(Env<AttrContext> env, MethodResolutionPhase phase);
+
+        @Override
+        Symbol access(Env<AttrContext> env, DiagnosticPosition pos, Symbol location, Symbol sym) {
             if (sym.kind >= AMBIGUOUS) {
                 //if nothing is found return the 'first' error
                 sym = accessMethod(sym, pos, location, site, name, true, argtypes, typeargtypes);
             }
             return sym;
         }
+
+        @Override
+        void debug(DiagnosticPosition pos, Symbol sym) {
+            reportVerboseResolutionDiagnostic(pos, name, site, argtypes, typeargtypes, sym);
+        }
     }
 
     /**
@@ -2958,7 +2977,7 @@
         protected Symbol lookup(Env<AttrContext> env, MethodResolutionPhase phase) {
             Scope sc = new Scope(syms.arrayClass);
             MethodSymbol arrayConstr = new MethodSymbol(PUBLIC, name, null, site.tsym);
-            arrayConstr.type = new MethodType(List.of(syms.intType), site, List.<Type>nil(), syms.methodClass);
+            arrayConstr.type = new MethodType(List.<Type>of(syms.intType), site, List.<Type>nil(), syms.methodClass);
             sc.enter(arrayConstr);
             return findMethodInScope(env, site, name, argtypes, typeargtypes, sc, methodNotFound, phase.isBoxingRequired(), phase.isVarargsRequired(), false, false);
         }
@@ -3039,7 +3058,9 @@
                 MethodResolutionPhase prevPhase = currentResolutionContext.step;
                 Symbol prevBest = bestSoFar;
                 currentResolutionContext.step = phase;
-                bestSoFar = phase.mergeResults(bestSoFar, lookupHelper.lookup(env, phase));
+                Symbol sym = lookupHelper.lookup(env, phase);
+                lookupHelper.debug(pos, sym);
+                bestSoFar = phase.mergeResults(bestSoFar, sym);
                 env.info.pendingResolutionPhase = (prevBest == bestSoFar) ? prevPhase : phase;
             }
             return lookupHelper.access(env, pos, location, bestSoFar);
@@ -3754,35 +3775,39 @@
          * is more specific than the others, attempt to merge their signatures.
          */
         Symbol mergeAbstracts(Type site) {
-            Symbol fst = ambiguousSyms.last();
-            Symbol res = fst;
-            for (Symbol s : ambiguousSyms.reverse()) {
-                Type mt1 = types.memberType(site, res);
-                Type mt2 = types.memberType(site, s);
-                if ((s.flags() & ABSTRACT) == 0 ||
-                        !types.overrideEquivalent(mt1, mt2) ||
-                        !types.isSameTypes(fst.erasure(types).getParameterTypes(),
-                                       s.erasure(types).getParameterTypes())) {
-                    //ambiguity cannot be resolved
-                    return this;
-                } else {
-                    Type mst = mostSpecificReturnType(mt1, mt2);
-                    if (mst == null) {
-                        // Theoretically, this can't happen, but it is possible
-                        // due to error recovery or mixing incompatible class files
+            List<Symbol> ambiguousInOrder = ambiguousSyms.reverse();
+            for (Symbol s : ambiguousInOrder) {
+                Type mt = types.memberType(site, s);
+                boolean found = true;
+                List<Type> allThrown = mt.getThrownTypes();
+                for (Symbol s2 : ambiguousInOrder) {
+                    Type mt2 = types.memberType(site, s2);
+                    if ((s2.flags() & ABSTRACT) == 0 ||
+                        !types.overrideEquivalent(mt, mt2) ||
+                        !types.isSameTypes(s.erasure(types).getParameterTypes(),
+                                       s2.erasure(types).getParameterTypes())) {
+                        //ambiguity cannot be resolved
                         return this;
                     }
-                    Symbol mostSpecific = mst == mt1 ? res : s;
-                    List<Type> allThrown = chk.intersect(mt1.getThrownTypes(), mt2.getThrownTypes());
-                    Type newSig = types.createMethodTypeWithThrown(mostSpecific.type, allThrown);
-                    res = new MethodSymbol(
-                            mostSpecific.flags() & ~DEFAULT,
-                            mostSpecific.name,
-                            newSig,
-                            mostSpecific.owner);
+                    Type mst = mostSpecificReturnType(mt, mt2);
+                    if (mst == null || mst != mt) {
+                        found = false;
+                        break;
+                    }
+                    allThrown = chk.intersect(allThrown, mt2.getThrownTypes());
+                }
+                if (found) {
+                    //all ambiguous methods were abstract and one method had
+                    //most specific return type then others
+                    return (allThrown == mt.getThrownTypes()) ?
+                            s : new MethodSymbol(
+                                s.flags(),
+                                s.name,
+                                types.createMethodTypeWithThrown(mt, allThrown),
+                                s.owner);
                 }
             }
-            return res;
+            return this;
         }
 
         @Override
@@ -3899,6 +3924,16 @@
 
         static {
             String argMismatchRegex = MethodCheckDiag.ARG_MISMATCH.regex();
+            rewriters.put(new Template(argMismatchRegex, new Template("(.*)(bad.arg.types.in.lambda)", skip, skip)),
+                    new DiagnosticRewriter() {
+                @Override
+                public JCDiagnostic rewriteDiagnostic(JCDiagnostic.Factory diags,
+                        DiagnosticPosition preferedPos, DiagnosticSource preferredSource,
+                        DiagnosticType preferredKind, JCDiagnostic d) {
+                    return (JCDiagnostic)((JCDiagnostic)d.getArgs()[0]).getArgs()[1];
+                }
+            });
+
             rewriters.put(new Template(argMismatchRegex, skip),
                     new DiagnosticRewriter() {
                 @Override
--- a/src/share/classes/com/sun/tools/javac/comp/TransTypes.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/comp/TransTypes.java	Thu Aug 22 15:37:58 2013 +0100
@@ -369,28 +369,25 @@
                     // reflection design error.
                     addBridge(pos, meth, impl, origin, false, bridges);
                 }
-            } else if (!allowInterfaceBridges) {
-                //close gaps left open during type-checking
-                if ((bridge.flags() & (SYNTHETIC | OVERRIDE_BRIDGE)) == SYNTHETIC) {
-                    MethodSymbol other = overridden.get(bridge);
-                    if (other != null && other != meth) {
-                        if (impl == null || !impl.overrides(other, origin, types, true)) {
-                            // Bridge for other symbol pair was added
-                            log.error(pos, "name.clash.same.erasure.no.override",
-                                      other, other.location(origin.type, types),
-                                      meth,  meth.location(origin.type, types));
-                        }
+            } else if ((bridge.flags() & (SYNTHETIC | OVERRIDE_BRIDGE)) == SYNTHETIC) {
+                MethodSymbol other = overridden.get(bridge);
+                if (other != null && other != meth) {
+                    if (impl == null || !impl.overrides(other, origin, types, true)) {
+                        // Bridge for other symbol pair was added
+                        log.error(pos, "name.clash.same.erasure.no.override",
+                                  other, other.location(origin.type, types),
+                                  meth,  meth.location(origin.type, types));
                     }
-                } else if (!bridge.overrides(meth, origin, types, true)) {
-                    // Accidental binary override without source override.
-                    if (bridge.owner == origin ||
-                        types.asSuper(bridge.owner.type, meth.owner) == null)
-                        // Don't diagnose the problem if it would already
-                        // have been reported in the superclass
-                        log.error(pos, "name.clash.same.erasure.no.override",
-                                  bridge, bridge.location(origin.type, types),
-                                  meth,  meth.location(origin.type, types));
                 }
+            } else if (!bridge.overrides(meth, origin, types, true)) {
+                // Accidental binary override without source override.
+                if (bridge.owner == origin ||
+                    types.asSuper(bridge.owner.type, meth.owner) == null)
+                    // Don't diagnose the problem if it would already
+                    // have been reported in the superclass
+                    log.error(pos, "name.clash.same.erasure.no.override",
+                              bridge, bridge.location(origin.type, types),
+                              meth,  meth.location(origin.type, types));
             }
         }
     }
@@ -683,7 +680,11 @@
         if (tree.varargsElement != null)
             tree.varargsElement = types.erasure(tree.varargsElement);
         else
-            Assert.check(tree.args.length() == argtypes.length());
+            if (tree.args.length() != argtypes.length()) {
+                log.error(tree.pos(),
+                              "method.invoked.with.incorrect.number.arguments",
+                              tree.args.length(), argtypes.length());
+            }
         tree.args = translateArgs(tree.args, argtypes, tree.varargsElement);
 
         tree.type = types.erasure(tree.type);
@@ -998,45 +999,34 @@
         try {
             env = myEnv;
             // class has not been translated yet
-            translateClass((JCClassDecl)env.tree);
+
+            TreeMaker savedMake = make;
+            Type savedPt = pt;
+            make = make.forToplevel(env.toplevel);
+            pt = null;
+            try {
+                JCClassDecl tree = (JCClassDecl) env.tree;
+                tree.typarams = List.nil();
+                super.visitClassDef(tree);
+                make.at(tree.pos);
+                if (addBridges) {
+                    ListBuffer<JCTree> bridges = new ListBuffer<JCTree>();
+                    if (false) //see CR: 6996415
+                        bridges.appendList(addOverrideBridgesIfNeeded(tree, c));
+                    if (allowInterfaceBridges || (tree.sym.flags() & INTERFACE) == 0) {
+                        addBridges(tree.pos(), c, bridges);
+                    }
+                    tree.defs = bridges.toList().prependList(tree.defs);
+                }
+                tree.type = erasure(tree.type);
+            } finally {
+                make = savedMake;
+                pt = savedPt;
+            }
         } finally {
             env = oldEnv;
         }
     }
-    
-    void translateClass(JCClassDecl tree) {
-        TreeMaker savedMake = make;
-        Type savedPt = pt;
-        List<JCTree> savedBridgedFunctionalInterfaces =
-                bridgedFunctionalInterfaces;
-        make = make.forToplevel(env.toplevel);
-        pt = null;
-        if (tree.sym.outermostClass() == tree.sym) {
-            bridgedFunctionalInterfaces = List.nil();
-        }
-        try {
-            tree.typarams = List.nil();
-            super.visitClassDef(tree);
-            make.at(tree.pos);
-            if (addBridges) {
-                ListBuffer<JCTree> bridges = new ListBuffer<JCTree>();
-                if (false) //see CR: 6996415
-                    bridges.appendList(addOverrideBridgesIfNeeded(tree, tree.sym));
-                if (allowInterfaceBridges || (tree.sym.flags() & INTERFACE) == 0) {
-                    addBridges(tree.pos(), tree.sym, bridges);
-                }
-                tree.defs = bridges.toList().prependList(tree.defs);
-            }
-            if (tree.sym.outermostClass() == tree.sym) {
-                tree.defs = tree.defs.appendList(bridgedFunctionalInterfaces);
-            }
-            tree.type = erasure(tree.type);
-        } finally {
-            make = savedMake;
-            pt = savedPt;
-            bridgedFunctionalInterfaces = savedBridgedFunctionalInterfaces;
-        }
-    }
 
     /** Translate a toplevel class definition.
      *  @param cdef    The definition to be translated.
--- a/src/share/classes/com/sun/tools/javac/jvm/Code.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/jvm/Code.java	Thu Aug 22 15:37:58 2013 +0100
@@ -919,11 +919,15 @@
         if (o instanceof Long) return syms.longType;
         if (o instanceof Double) return syms.doubleType;
         if (o instanceof ClassSymbol) return syms.classType;
-        if (o instanceof Type.ArrayType) return syms.classType;
-        if (o instanceof Type.MethodType) return syms.methodTypeType;
+        if (o instanceof Pool.MethodHandle) return syms.methodHandleType;
         if (o instanceof UniqueType) return typeForPool(((UniqueType)o).type);
-        if (o instanceof Pool.MethodHandle) return syms.methodHandleType;
-        throw new AssertionError(o);
+        if (o instanceof Type) {
+            Type ty = ((Type)o).unannotatedType();
+
+            if (ty instanceof Type.ArrayType) return syms.classType;
+            if (ty instanceof Type.MethodType) return syms.methodTypeType;
+        }
+        throw new AssertionError("Invalid type of constant pool entry: " + o.getClass());
     }
 
     /** Emit an opcode with a one-byte operand field;
@@ -1855,7 +1859,7 @@
         }
     }
 
-    static final Type jsrReturnValue = new Type(INT, null);
+    static final Type jsrReturnValue = new JCPrimitiveType(INT, null);
 
 
 /* **************************************************************************
--- a/src/share/classes/com/sun/tools/javac/jvm/Gen.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/jvm/Gen.java	Thu Aug 22 15:37:58 2013 +0100
@@ -991,9 +991,19 @@
          */
         void genMethod(JCMethodDecl tree, Env<GenContext> env, boolean fatcode) {
             MethodSymbol meth = tree.sym;
-//      System.err.println("Generating " + meth + " in " + meth.owner); //DEBUG
-            if (Code.width(types.erasure(env.enclMethod.sym.type).getParameterTypes())  +
-                (((tree.mods.flags & STATIC) == 0 || meth.isConstructor()) ? 1 : 0) >
+            int extras = 0;
+            // Count up extra parameters
+            if (meth.isConstructor()) {
+                extras++;
+                if (meth.enclClass().isInner() &&
+                    !meth.enclClass().isStatic()) {
+                    extras++;
+                }
+            } else if ((tree.mods.flags & STATIC) == 0) {
+                extras++;
+            }
+            //      System.err.println("Generating " + meth + " in " + meth.owner); //DEBUG
+            if (Code.width(types.erasure(env.enclMethod.sym.type).getParameterTypes()) + extras >
                 ClassFile.MAX_PARAMETERS) {
                 log.error(tree.pos(), "limit.parameters");
                 nerrs++;
@@ -1468,74 +1478,82 @@
             code.statBegin(TreeInfo.endPos(body));
             genFinalizer(env);
             code.statBegin(TreeInfo.endPos(env.tree));
-            Chain exitChain = code.branch(goto_);
+            Chain exitChain;
+            if (startpc != endpc) {
+                exitChain = code.branch(goto_);
+            } else {
+                exitChain = code.branch(dontgoto);
+            }
             endFinalizerGap(env);
-            if (startpc != endpc) for (List<JCCatch> l = catchers; l.nonEmpty(); l = l.tail) {
-                // start off with exception on stack
-                code.entryPoint(stateTry, l.head.param.sym.type);
-                genCatch(l.head, env, startpc, endpc, gaps);
-                genFinalizer(env);
-                if (hasFinalizer || l.tail.nonEmpty()) {
-                    code.statBegin(TreeInfo.endPos(env.tree));
-                    exitChain = Code.mergeChains(exitChain,
-                                                 code.branch(goto_));
+            if (startpc != endpc) {
+                for (List<JCCatch> l = catchers; l.nonEmpty(); l = l.tail) {
+                    // start off with exception on stack
+                    code.entryPoint(stateTry, l.head.param.sym.type);
+                    genCatch(l.head, env, startpc, endpc, gaps);
+                    genFinalizer(env);
+                    if (hasFinalizer || l.tail.nonEmpty()) {
+                        code.statBegin(TreeInfo.endPos(env.tree));
+                        exitChain = Code.mergeChains(exitChain,
+                                                     code.branch(goto_));
+                    }
+                    endFinalizerGap(env);
                 }
-                endFinalizerGap(env);
-            }
-            if (hasFinalizer) {
-                // Create a new register segement to avoid allocating
-                // the same variables in finalizers and other statements.
-                code.newRegSegment();
 
-                // Add a catch-all clause.
+                if (hasFinalizer) {
+                    // Create a new register segement to avoid allocating
+                    // the same variables in finalizers and other statements.
+                    code.newRegSegment();
 
-                // start off with exception on stack
-                int catchallpc = code.entryPoint(stateTry, syms.throwableType);
+                    // Add a catch-all clause.
 
-                // Register all exception ranges for catch all clause.
-                // The range of the catch all clause is from the beginning
-                // of the try or synchronized block until the present
-                // code pointer excluding all gaps in the current
-                // environment's GenContext.
-                int startseg = startpc;
-                while (env.info.gaps.nonEmpty()) {
-                    int endseg = env.info.gaps.next().intValue();
-                    registerCatch(body.pos(), startseg, endseg,
-                                  catchallpc, 0);
-                    startseg = env.info.gaps.next().intValue();
-                }
-                code.statBegin(TreeInfo.finalizerPos(env.tree));
-                code.markStatBegin();
+                    // start off with exception on stack
+                    int catchallpc = code.entryPoint(stateTry, syms.throwableType);
 
-                Item excVar = makeTemp(syms.throwableType);
-                excVar.store();
-                genFinalizer(env);
-                excVar.load();
-                registerCatch(body.pos(), startseg,
-                              env.info.gaps.next().intValue(),
-                              catchallpc, 0);
-                code.emitop0(athrow);
-                code.markDead();
-
-                // If there are jsr's to this finalizer, ...
-                if (env.info.cont != null) {
-                    // Resolve all jsr's.
-                    code.resolve(env.info.cont);
-
-                    // Mark statement line number
+                    // Register all exception ranges for catch all clause.
+                    // The range of the catch all clause is from the beginning
+                    // of the try or synchronized block until the present
+                    // code pointer excluding all gaps in the current
+                    // environment's GenContext.
+                    int startseg = startpc;
+                    while (env.info.gaps.nonEmpty()) {
+                        int endseg = env.info.gaps.next().intValue();
+                        registerCatch(body.pos(), startseg, endseg,
+                                      catchallpc, 0);
+                        startseg = env.info.gaps.next().intValue();
+                    }
                     code.statBegin(TreeInfo.finalizerPos(env.tree));
                     code.markStatBegin();
 
-                    // Save return address.
-                    LocalItem retVar = makeTemp(syms.throwableType);
-                    retVar.store();
+                    Item excVar = makeTemp(syms.throwableType);
+                    excVar.store();
+                    genFinalizer(env);
+                    excVar.load();
+                    registerCatch(body.pos(), startseg,
+                                  env.info.gaps.next().intValue(),
+                                  catchallpc, 0);
+                    code.emitop0(athrow);
+                    code.markDead();
 
-                    // Generate finalizer code.
-                    env.info.finalize.genLast();
+                    // If there are jsr's to this finalizer, ...
+                    if (env.info.cont != null) {
+                        // Resolve all jsr's.
+                        code.resolve(env.info.cont);
 
-                    // Return.
-                    code.emitop1w(ret, retVar.reg);
-                    code.markDead();
+                        // Mark statement line number
+                        code.statBegin(TreeInfo.finalizerPos(env.tree));
+                        code.markStatBegin();
+
+                        // Save return address.
+                        LocalItem retVar = makeTemp(syms.throwableType);
+                        retVar.store();
+
+                        // Generate finalizer code.
+                        env.info.finalize.genLast();
+
+                        // Return.
+                        code.emitop1w(ret, retVar.reg);
+                        code.markDead();
+                    }
                 }
             }
             // Resolve all breaks.
@@ -1773,7 +1791,16 @@
             r.load();
             code.emitop0(ireturn + Code.truncate(Code.typecode(pt)));
         } else {
+            /*  If we have a statement like:
+             *
+             *  return;
+             *
+             *  we need to store the code.pendingStatPos value before generating
+             *  the finalizer.
+             */
+            int tmpPos = code.pendingStatPos;
             targetEnv = unwind(env.enclMethod, env);
+            code.pendingStatPos = tmpPos;
             code.emitop0(return_);
         }
         endFinalizerGaps(env, targetEnv);
@@ -1801,7 +1828,6 @@
                 msym.externalType(types).getParameterTypes());
         if (!msym.isDynamic()) {
             code.statBegin(tree.pos);
-            code.markStatBegin();
         }
         result = m.invoke();
     }
--- a/src/share/classes/com/sun/tools/javac/main/Main.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/main/Main.java	Thu Aug 22 15:37:58 2013 +0100
@@ -377,10 +377,10 @@
     }
 
     public Result compile(String[] args,
-                       String[] classNames,
-                       Context context,
-                       List<JavaFileObject> fileObjects,
-                       Iterable<? extends Processor> processors)
+                          String[] classNames,
+                          Context context,
+                          List<JavaFileObject> fileObjects,
+                          Iterable<? extends Processor> processors)
     {
         context.put(Log.outKey, out);
         log = Log.instance(context);
--- a/src/share/classes/com/sun/tools/javac/model/JavacAnnoConstructs.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/model/JavacAnnoConstructs.java	Thu Aug 22 15:37:58 2013 +0100
@@ -108,20 +108,38 @@
     }
 
     // Helper to getAnnotation[s]
-    private static <A extends Annotation> Attribute.Compound getAttributeOnClass(ClassSymbol annotated,
-                                                                Class<A> annoType) {
+    private static <A extends Annotation> Attribute.Compound getAttributeOnClass(
+            ClassSymbol annotated,
+            final Class<A> annoType)
+    {
         boolean inherited = annoType.isAnnotationPresent(Inherited.class);
         Attribute.Compound result = null;
-        while (annotated.name != annotated.name.table.names.java_lang_Object) {
+
+        result = getAttribute(annotated, annoType);
+        if (result != null || !inherited)
+            return result;
+
+        while ((annotated = nextSupertypeToSearch(annotated)) != null) {
             result = getAttribute(annotated, annoType);
-            if (result != null || !inherited)
-                break;
-            Type sup = annotated.getSuperclass();
-            if (!sup.hasTag(CLASS) || sup.isErroneous())
-                break;
-            annotated = (ClassSymbol) sup.tsym;
+            if (result != null)
+                return result;
         }
-        return result;
+        return null; // no more supertypes to search
+    }
+
+    /**
+     * Returns the next type to search for inherited annotations or {@code null}
+     * if the next type can't be found.
+     */
+    private static ClassSymbol nextSupertypeToSearch(ClassSymbol annotated) {
+        if (annotated.name == annotated.name.table.names.java_lang_Object)
+            return null;
+
+        Type sup = annotated.getSuperclass();
+        if (!sup.hasTag(CLASS) || sup.isErroneous())
+            return null;
+
+        return (ClassSymbol) sup.tsym;
     }
 
     /**
@@ -129,8 +147,9 @@
      * annotations. This is the implementation of
      * Element.getAnnotations(Class).
      */
-    public static <A extends Annotation> A[] getAnnotations(Symbol annotated,
-                                                            Class<A> annoType) {
+    public static <A extends Annotation> A[] getAnnotationsByType(Symbol annotated,
+            Class<A> annoType)
+    {
         if (!annoType.isAnnotation())
             throw new IllegalArgumentException("Not an annotation type: "
                                                + annoType);
@@ -153,62 +172,48 @@
         }
 
         // So we have a containing type
-        String name = annoType.getName();
-        String annoTypeName = annoType.getSimpleName();
-        String containerTypeName = containerType.getSimpleName();
+        String annoTypeName = annoType.getName();
+        String containerTypeName = containerType.getName();
         int directIndex = -1, containerIndex = -1;
         Attribute.Compound direct = null, container = null;
-        Attribute.Compound[] rawAttributes = annotated.getRawAttributes().toArray(new Attribute.Compound[0]);
-
-        // Find directly present annotations
-        for (int i = 0; i < rawAttributes.length; i++) {
-            if (annoTypeName.equals(rawAttributes[i].type.tsym.flatName().toString())) {
-                directIndex = i;
-                direct = rawAttributes[i];
+        // Find directly (explicit or implicit) present annotations
+        int index = -1;
+        for (List<Attribute.Compound> list = annotated.getAnnotationMirrors();
+                !list.isEmpty();
+                list = list.tail) {
+            Attribute.Compound attribute = list.head;
+            index++;
+            if (attribute.type.tsym.flatName().contentEquals(annoTypeName)) {
+                directIndex = index;
+                direct = attribute;
             } else if(containerTypeName != null &&
-                      containerTypeName.equals(rawAttributes[i].type.tsym.flatName().toString())) {
-                containerIndex = i;
-                container = rawAttributes[i];
+                      attribute.type.tsym.flatName().contentEquals(containerTypeName)) {
+                containerIndex = index;
+                container = attribute;
             }
         }
 
         // Deal with inherited annotations
-        if (annotated.kind == Kinds.TYP &&
-                (annotated instanceof ClassSymbol)) {
-            ClassSymbol s = (ClassSymbol)annotated;
-            if (direct == null && container == null) {
-                direct = getAttributeOnClass(s, annoType);
-                container = getAttributeOnClass(s, containerType);
-
-                // both are inherited and found, put container last
-                if (direct != null && container != null) {
-                    directIndex = 0;
-                    containerIndex = 1;
-                } else if (direct != null) {
-                    directIndex = 0;
-                } else {
-                    containerIndex = 0;
-                }
-            } else if (direct == null) {
-                direct = getAttributeOnClass(s, annoType);
-                if (direct != null)
-                    directIndex = containerIndex + 1;
-            } else if (container == null) {
-                container = getAttributeOnClass(s, containerType);
-                if (container != null)
-                    containerIndex = directIndex + 1;
+        if (direct == null && container == null) {
+            if (annotated.kind == Kinds.TYP &&
+                    (annotated instanceof ClassSymbol)) {
+                ClassSymbol s = nextSupertypeToSearch((ClassSymbol)annotated);
+                if (s != null)
+                    return getAnnotationsByType(s, annoType);
             }
         }
 
         // Pack them in an array
-        Attribute[] contained0 = new Attribute[0];
+        Attribute[] contained0 = null;
         if (container != null)
             contained0 = unpackAttributes(container);
         ListBuffer<Attribute.Compound> compounds = ListBuffer.lb();
-        for (Attribute a : contained0)
-            if (a instanceof Attribute.Compound)
-                compounds = compounds.append((Attribute.Compound)a);
-        Attribute.Compound[] contained = compounds.toArray(new Attribute.Compound[0]);
+        if (contained0 != null) {
+            for (Attribute a : contained0)
+                if (a instanceof Attribute.Compound)
+                    compounds = compounds.append((Attribute.Compound)a);
+        }
+        Attribute.Compound[] contained = compounds.toArray(new Attribute.Compound[compounds.size()]);
 
         int size = (direct == null ? 0 : 1) + contained.length;
         @SuppressWarnings("unchecked") // annoType is the Class for A
@@ -298,35 +303,38 @@
         }
 
         // So we have a containing type
-        String name = annoType.getName();
-        String annoTypeName = annoType.getSimpleName();
-        String containerTypeName = containerType.getSimpleName();
+        String annoTypeName = annoType.getName();
+        String containerTypeName = containerType.getName();
         int directIndex = -1, containerIndex = -1;
         Attribute.Compound direct = null, container = null;
-        Attribute.Compound[] rawAttributes = annotated.getAnnotationMirrors().toArray(new Attribute.Compound[0]);
-
-        // Find directly present annotations
-        for (int i = 0; i < rawAttributes.length; i++) {
-            if (annoTypeName.equals(rawAttributes[i].type.tsym.flatName().toString())) {
-                directIndex = i;
-                direct = rawAttributes[i];
+        // Find directly (explicit or implicit) present annotations
+        int index = -1;
+        for (List<? extends Attribute.Compound> list = annotated.getAnnotationMirrors();
+                !list.isEmpty();
+                list = list.tail) {
+            Attribute.Compound attribute = list.head;
+            index++;
+            if (attribute.type.tsym.flatName().contentEquals(annoTypeName)) {
+                directIndex = index;
+                direct = attribute;
             } else if(containerTypeName != null &&
-                      containerTypeName.equals(rawAttributes[i].type.tsym.flatName().toString())) {
-                containerIndex = i;
-                container = rawAttributes[i];
+                      attribute.type.tsym.flatName().contentEquals(containerTypeName)) {
+                containerIndex = index;
+                container = attribute;
             }
         }
 
         // Pack them in an array
-        Attribute[] contained0 = new Attribute[0];
+        Attribute[] contained0 = null;
         if (container != null)
             contained0 = unpackAttributes(container);
         ListBuffer<Attribute.Compound> compounds = ListBuffer.lb();
-        for (Attribute a : contained0) {
-            if (a instanceof Attribute.Compound)
-                compounds = compounds.append((Attribute.Compound)a);
+        if (contained0 != null) {
+            for (Attribute a : contained0)
+                if (a instanceof Attribute.Compound)
+                    compounds = compounds.append((Attribute.Compound)a);
         }
-        Attribute.Compound[] contained = compounds.toArray(new Attribute.Compound[0]);
+        Attribute.Compound[] contained = compounds.toArray(new Attribute.Compound[compounds.size()]);
 
         int size = (direct == null ? 0 : 1) + contained.length;
         @SuppressWarnings("unchecked") // annoType is the Class for A
--- a/src/share/classes/com/sun/tools/javac/model/JavacTypes.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/model/JavacTypes.java	Thu Aug 22 15:37:58 2013 +0100
@@ -139,7 +139,7 @@
         Type unboxed = types.unboxedType((Type) t);
         if (! unboxed.isPrimitive())    // only true primitives, not void
             throw new IllegalArgumentException(t.toString());
-        return unboxed;
+        return (PrimitiveType)unboxed;
     }
 
     public TypeMirror capture(TypeMirror t) {
--- a/src/share/classes/com/sun/tools/javac/parser/JavacParser.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/parser/JavacParser.java	Thu Aug 22 15:37:58 2013 +0100
@@ -2914,7 +2914,9 @@
             pos = token.pos;
             accept(LBRACE);
             ListBuffer<JCExpression> buf = new ListBuffer<JCExpression>();
-            if (token.kind != RBRACE) {
+            if (token.kind == COMMA) {
+                nextToken();
+            } else if (token.kind != RBRACE) {
                 buf.append(annotationValue());
                 while (token.kind == COMMA) {
                     nextToken();
@@ -4051,7 +4053,7 @@
             endPosMap = new HashMap<JCTree, Integer>();
         }
 
-        protected void storeEnd(JCTree tree, int endpos) {
+        public void storeEnd(JCTree tree, int endpos) {
             endPosMap.put(tree, errorEndPos > endpos ? errorEndPos : endpos);
         }
 
@@ -4089,7 +4091,7 @@
             super(parser);
         }
 
-        protected void storeEnd(JCTree tree, int endpos) { /* empty */ }
+        public void storeEnd(JCTree tree, int endpos) { /* empty */ }
 
         protected <T extends JCTree> T to(T t) {
             return t;
@@ -4125,14 +4127,6 @@
         }
 
         /**
-         * Store ending position for a tree, the value of which is the greater
-         * of last error position and the given ending position.
-         * @param tree   The tree.
-         * @param endpos The ending position to associate with the tree.
-         */
-        protected abstract void storeEnd(JCTree tree, int endpos);
-
-        /**
          * Store current token's ending position for a tree, the value of which
          * will be the greater of last error position and the ending position of
          * the current token.
--- a/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java	Thu Aug 22 15:37:58 2013 +0100
@@ -36,10 +36,7 @@
 
 import javax.annotation.processing.*;
 import javax.lang.model.SourceVersion;
-import javax.lang.model.element.AnnotationMirror;
-import javax.lang.model.element.Element;
-import javax.lang.model.element.PackageElement;
-import javax.lang.model.element.TypeElement;
+import javax.lang.model.element.*;
 import javax.lang.model.util.*;
 import javax.tools.DiagnosticListener;
 import javax.tools.JavaFileManager;
@@ -762,12 +759,30 @@
         }
 
         @Override
-        public Set<TypeElement> scan(Element e, Set<TypeElement> p) {
+        public Set<TypeElement> visitType(TypeElement e, Set<TypeElement> p) {
+            // Type parameters are not considered to be enclosed by a type
+            scan(e.getTypeParameters(), p);
+            return scan(e.getEnclosedElements(), p);
+        }
+
+        @Override
+        public Set<TypeElement> visitExecutable(ExecutableElement e, Set<TypeElement> p) {
+            // Type parameters are not considered to be enclosed by an executable
+            scan(e.getTypeParameters(), p);
+            return scan(e.getEnclosedElements(), p);
+        }
+
+        void addAnnotations(Element e, Set<TypeElement> p) {
             for (AnnotationMirror annotationMirror :
                      elements.getAllAnnotationMirrors(e) ) {
                 Element e2 = annotationMirror.getAnnotationType().asElement();
                 p.add((TypeElement) e2);
             }
+        }
+
+        @Override
+        public Set<TypeElement> scan(Element e, Set<TypeElement> p) {
+            addAnnotations(e, p);
             return super.scan(e, p);
         }
     }
--- a/src/share/classes/com/sun/tools/javac/processing/JavacRoundEnvironment.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/processing/JavacRoundEnvironment.java	Thu Aug 22 15:37:58 2013 +0100
@@ -147,6 +147,20 @@
         }
 
         @Override
+        public Set<Element> visitType(TypeElement e, DeclaredType p) {
+            // Type parameters are not considered to be enclosed by a type
+            scan(e.getTypeParameters(), p);
+            return scan(e.getEnclosedElements(), p);
+        }
+
+        @Override
+        public Set<Element> visitExecutable(ExecutableElement e, DeclaredType p) {
+            // Type parameters are not considered to be enclosed by an executable
+            scan(e.getTypeParameters(), p);
+            return scan(e.getEnclosedElements(), p);
+        }
+
+        @Override
         public Set<Element> scan(Element e, DeclaredType p) {
             java.util.List<? extends AnnotationMirror> annotationMirrors =
                 processingEnv.getElementUtils().getAllAnnotationMirrors(e);
@@ -157,7 +171,6 @@
             e.accept(this, p);
             return annotatedElements;
         }
-
     }
 
     /**
--- a/src/share/classes/com/sun/tools/javac/resources/compiler.properties	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/resources/compiler.properties	Thu Aug 22 15:37:58 2013 +0100
@@ -913,6 +913,10 @@
 compiler.err.signature.doesnt.match.intf=\
     signature does not match {0}; incompatible interfaces
 
+# 0: number, 1: number
+compiler.err.method.invoked.with.incorrect.number.arguments=\
+    method invoked with incorrect number of arguments; expected {0}, found {1}
+
 # 0: symbol, 1: symbol, 2: symbol
 compiler.err.does.not.override.abstract=\
     {0} is not abstract and does not override abstract method {1} in {2}
@@ -1068,6 +1072,10 @@
     variable {0} might not have been initialized
 
 # 0: symbol
+compiler.err.var.not.initialized.in.default.constructor=\
+    variable {0} not initialized in the default constructor
+
+# 0: symbol
 compiler.err.var.might.be.assigned.in.loop=\
     variable {0} might be assigned in loop
 
--- a/src/share/classes/com/sun/tools/javac/tree/EndPosTable.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/tree/EndPosTable.java	Thu Aug 22 15:37:58 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -43,10 +43,17 @@
     public int getEndPos(JCTree tree);
 
     /**
+     * Store ending position for a tree, the value of which is the greater of
+     * last error position and the given ending position.
+     * @param tree The tree.
+     * @param endpos The ending position to associate with the tree.
+     */
+    public abstract void storeEnd(JCTree tree, int endpos);
+
+    /**
      * Give an old tree and a new tree, the old tree will be replaced with
      * the new tree, the position of the new tree will be that of the old
      * tree.
-     * not exist.
      * @param oldtree a JCTree to be replaced
      * @param newtree a JCTree to be replaced with
      * @return position of the old tree or Positions.NOPOS for non-existent mapping
--- a/src/share/classes/com/sun/tools/javac/tree/JCTree.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/tree/JCTree.java	Thu Aug 22 15:37:58 2013 +0100
@@ -640,10 +640,10 @@
             //a functional expression is always a 'true' poly
             polyKind = PolyKind.POLY;
         }
-        
+
         /** list of target types inferred for this functional expression. */
         public List<Type> targets;
-        
+
         public Type getDescriptorType(Types types) {
             return types.findDescriptorType(targets.head);
         }
--- a/src/share/classes/com/sun/tools/javac/tree/Pretty.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/tree/Pretty.java	Thu Aug 22 15:37:58 2013 +0100
@@ -973,7 +973,6 @@
                     printBrackets((JCArrayTypeTree) elem);
             }
             if (tree.elems != null) {
-                if (tree.elemtype != null) print("[]");
                 print("{");
                 printExprs(tree.elems);
                 print("}");
--- a/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java	Thu Aug 22 15:37:58 2013 +0100
@@ -781,7 +781,7 @@
     class AnnotationBuilder implements Attribute.Visitor {
         JCExpression result = null;
         public void visitConstant(Attribute.Constant v) {
-            result = Literal(v.value);
+            result = Literal(v.type.getTag(), v.value);
         }
         public void visitClass(Attribute.Class clazz) {
             result = ClassLiteral(clazz.classType).setType(syms.classType);
--- a/src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java	Thu Aug 22 15:37:58 2013 +0100
@@ -46,6 +46,7 @@
 import com.sun.tools.javac.code.Symbol.*;
 import com.sun.tools.javac.code.Type;
 import com.sun.tools.javac.code.Type.ClassType;
+import com.sun.tools.javac.code.TypeTag;
 import com.sun.tools.javac.comp.AttrContext;
 import com.sun.tools.javac.comp.Env;
 import com.sun.tools.javac.tree.JCTree;
@@ -516,7 +517,7 @@
             return null;
         Type sup = env.types.supertype(type);
         return TypeMaker.getType(env,
-                                 (sup != type) ? sup : env.syms.objectType);
+                                 (sup.hasTag(TypeTag.NONE)) ? env.syms.objectType : sup);
     }
 
     /**
--- a/src/share/classes/com/sun/tools/javadoc/ToolOption.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javadoc/ToolOption.java	Thu Aug 22 15:37:58 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -56,6 +56,13 @@
         }
     },
 
+    CP("-cp", true) {
+        @Override
+        public void process(Helper helper, String arg) {
+            helper.setCompilerOpt(opt, arg);
+        }
+    },
+
     EXTDIRS("-extdirs", true) {
         @Override
         public void process(Helper helper, String arg) {
--- a/src/share/classes/com/sun/tools/javadoc/resources/javadoc.properties	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javadoc/resources/javadoc.properties	Thu Aug 22 15:37:58 2013 +0100
@@ -39,6 +39,7 @@
 \  -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\
+\  -cp <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\
--- a/src/share/classes/com/sun/tools/javah/JavahTask.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javah/JavahTask.java	Thu Aug 22 15:37:58 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -220,12 +220,6 @@
             }
         },
 
-        new HiddenOption(false, "-old") {
-            void process(JavahTask task, String opt, String arg) {
-                task.old = true;
-            }
-        },
-
         new HiddenOption(false, "-llni", "-Xllni") {
             void process(JavahTask task, String opt, String arg) {
                 task.llni = true;
@@ -537,7 +531,7 @@
             String name = o.aliases[0].substring(1); // there must always be at least one name
             log.println(getMessage("main.opt." + name));
         }
-        String[] fmOptions = { "-classpath", "-bootclasspath" };
+        String[] fmOptions = { "-classpath", "-cp", "-bootclasspath" };
         for (String o: fmOptions) {
             if (fileManager.isSupportedOption(o) == -1)
                 continue;
@@ -663,7 +657,6 @@
     boolean llni;
     boolean doubleAlign;
     boolean force;
-    boolean old;
     Set<String> javac_extras = new LinkedHashSet<String>();
 
     PrintWriter log;
--- a/src/share/classes/com/sun/tools/javah/resources/l10n.properties	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javah/resources/l10n.properties	Thu Aug 22 15:37:58 2013 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 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
@@ -77,6 +77,7 @@
 \n\t\
 -help                 Print this help message and exit\n\t\
 -classpath <path>     Path from which to load classes\n\t\
+-cp <path>            Path from which to load classes\n\t\
 -bootclasspath <path> Path from which to load bootstrap classes\n\t\
 -d <dir>              Output directory\n\t\
 -o <file>             Output file (only one of -d or -o may be used)\n\t\
@@ -108,6 +109,8 @@
 \  -force                   Always write output files
 main.opt.classpath=\
 \  -classpath <path>        Path from which to load classes
+main.opt.cp=\
+\  -cp <path>               Path from which to load classes
 main.opt.bootclasspath=\
 \  -bootclasspath <path>    Path from which to load bootstrap classes
 main.usage.foot=\
--- a/src/share/classes/com/sun/tools/javap/AttributeWriter.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javap/AttributeWriter.java	Thu Aug 22 15:37:58 2013 +0100
@@ -114,6 +114,9 @@
     }
 
     public Void visitDefault(DefaultAttribute attr, Void ignore) {
+        if (attr.reason != null) {
+            report(attr.reason);
+        }
         byte[] data = attr.info;
         int i = 0;
         int j = 0;
@@ -365,8 +368,7 @@
         indent(+1);
         println("Start  Length  Slot  Name   Signature");
         for (LocalVariableTable_attribute.Entry entry : attr.local_variable_table) {
-            Formatter formatter = new Formatter();
-            println(formatter.format("%8d %7d %5d %5s   %s",
+            println(String.format("%5d %7d %5d %5s   %s",
                     entry.start_pc, entry.length, entry.index,
                     constantWriter.stringValue(entry.name_index),
                     constantWriter.stringValue(entry.descriptor_index)));
@@ -511,7 +513,12 @@
     }
 
     public Void visitSourceDebugExtension(SourceDebugExtension_attribute attr, Void ignore) {
-        println("SourceDebugExtension: " + attr.getValue());
+        println("SourceDebugExtension:");
+        indent(+1);
+        for (String s: attr.getValue().split("[\r\n]+")) {
+            println(s);
+        }
+        indent(-1);
         return null;
     }
 
@@ -609,7 +616,8 @@
         public Void visit_append_frame(StackMapTable_attribute.append_frame frame, Void p) {
             printHeader(frame);
             println(" /* append */");
-            println("     offset_delta = " + frame.offset_delta);
+            indent(+1);
+            println("offset_delta = " + frame.offset_delta);
             printMap("locals", frame.locals);
             return null;
         }
--- a/src/share/classes/com/sun/tools/javap/JavapTask.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javap/JavapTask.java	Thu Aug 22 15:37:58 2013 +0100
@@ -885,7 +885,7 @@
                 continue;
             log.println(getMessage("main.opt." + name));
         }
-        String[] fmOptions = { "-classpath", "-bootclasspath" };
+        String[] fmOptions = { "-classpath", "-cp", "-bootclasspath" };
         for (String o: fmOptions) {
             if (fileManager.isSupportedOption(o) == -1)
                 continue;
--- a/src/share/classes/com/sun/tools/javap/resources/javap.properties	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/javap/resources/javap.properties	Thu Aug 22 15:37:58 2013 +0100
@@ -1,5 +1,5 @@
 
-err.prefix=Error: 
+err.prefix=Error:
 
 err.bad.constant.pool=error while reading constant pool for {0}: {1}
 err.class.not.found=class not found: {0}
@@ -73,6 +73,9 @@
 main.opt.classpath=\
 \  -classpath <path>        Specify where to find user class files
 
+main.opt.cp=\
+\  -cp <path>               Specify where to find user class files
+
 main.opt.bootclasspath=\
 \  -bootclasspath <path>    Override location of bootstrap class files
 
--- a/src/share/classes/com/sun/tools/sjavac/CompileJavaPackages.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/com/sun/tools/sjavac/CompileJavaPackages.java	Thu Aug 22 15:37:58 2013 +0100
@@ -136,7 +136,8 @@
         // for each compile.....
         int kbPerFile = 175;
         String osarch = System.getProperty("os.arch");
-        if (osarch.equals("i386")) {
+        String dataModel = System.getProperty("sun.arch.data.model");
+        if ("32".equals(dataModel)) {
             // For 32 bit platforms, assume it is slightly smaller
             // because of smaller object headers and pointers.
             kbPerFile = 119;
--- a/src/share/classes/javax/annotation/processing/AbstractProcessor.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/javax/annotation/processing/AbstractProcessor.java	Thu Aug 22 15:37:58 2013 +0100
@@ -38,7 +38,7 @@
  * superclass for most concrete annotation processors.  This class
  * examines annotation values to compute the {@linkplain
  * #getSupportedOptions options}, {@linkplain
- * #getSupportedAnnotationTypes annotations}, and {@linkplain
+ * #getSupportedAnnotationTypes annotation types}, and {@linkplain
  * #getSupportedSourceVersion source version} supported by its
  * subtypes.
  *
--- a/src/share/classes/javax/annotation/processing/Processor.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/javax/annotation/processing/Processor.java	Thu Aug 22 15:37:58 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
 package javax.annotation.processing;
 
 import java.util.Set;
+import javax.lang.model.util.Elements;
+import javax.lang.model.AnnotatedConstruct;
 import javax.lang.model.element.*;
 import javax.lang.model.SourceVersion;
 
@@ -88,23 +90,52 @@
  * configuration mechanisms, such as command line options; for
  * details, refer to the particular tool's documentation.  Which
  * processors the tool asks to {@linkplain #process run} is a function
- * of what annotations are present on the {@linkplain
+ * of the types of the annotations <em>{@linkplain AnnotatedConstruct present}</em>
+ * on the {@linkplain
  * RoundEnvironment#getRootElements root elements}, what {@linkplain
  * #getSupportedAnnotationTypes annotation types a processor
- * processes}, and whether or not a processor {@linkplain #process
- * claims the annotations it processes}.  A processor will be asked to
+ * supports}, and whether or not a processor {@linkplain #process
+ * claims the annotation types it processes}.  A processor will be asked to
  * process a subset of the annotation types it supports, possibly an
  * empty set.
  *
- * For a given round, the tool computes the set of annotation types on
- * the root elements.  If there is at least one annotation type
- * present, as processors claim annotation types, they are removed
- * from the set of unmatched annotations.  When the set is empty or no
- * more processors are available, the round has run to completion.  If
+ * For a given round, the tool computes the set of annotation types
+ * that are present on the elements enclosed within the root elements.
+ * If there is at least one annotation type present, then as
+ * processors claim annotation types, they are removed from the set of
+ * unmatched annotation types.  When the set is empty or no more
+ * processors are available, the round has run to completion.  If
  * there are no annotation types present, annotation processing still
  * occurs but only <i>universal processors</i> which support
- * processing {@code "*"} can claim the (empty) set of annotation
- * types.
+ * processing all annotation types, {@code "*"}, can claim the (empty)
+ * set of annotation types.
+ *
+ * <p>An annotation type is considered present if there is at least
+ * one annotation of that type present on an element enclosed within
+ * the root elements of a round. For this purpose, a type parameter is
+ * considered to be enclosed by its {@linkplain
+ * TypeParameterElement#getGenericElement generic
+ * element}. Annotations on {@linkplain
+ * java.lang.annotation.ElementType#TYPE_USE type uses}, as opposed to
+ * annotations on elements, are ignored when computing whether or not
+ * an annotation type is present.
+ *
+ * <p>An annotation is present if it meets the definition of being
+ * present given in {@link AnnotatedConstruct}. In brief, an
+ * annotation is considered present for the purposes of discovery if
+ * it is directly present or present via inheritance. An annotation is
+ * <em>not</em> considered present by virtue of being wrapped by a
+ * container annotation. Operationally, this is equivalent to an
+ * annotation being present on an element if and only if it would be
+ * included in the results of {@link
+ * Elements#getAllAnnotationMirrors(Element)} called on that element. Since
+ * annotations inside container annotations are not considered
+ * present, to properly process {@linkplain
+ * java.lang.annotation.Repeatable repeatable annotation types},
+ * processors are advised to include both the repeatable annotation
+ * type and its containing annotation type in the set of {@linkplain
+ * #getSupportedAnnotationTypes() supported annotation types} of a
+ * processor.
  *
  * <p>Note that if a processor supports {@code "*"} and returns {@code
  * true}, all annotations are claimed.  Therefore, a universal
@@ -257,10 +288,10 @@
     /**
      * Processes a set of annotation types on type elements
      * originating from the prior round and returns whether or not
-     * these annotations are claimed by this processor.  If {@code
-     * true} is returned, the annotations are claimed and subsequent
+     * these annotation types are claimed by this processor.  If {@code
+     * true} is returned, the annotation types are claimed and subsequent
      * processors will not be asked to process them; if {@code false}
-     * is returned, the annotations are unclaimed and subsequent
+     * is returned, the annotation types are unclaimed and subsequent
      * processors may be asked to process them.  A processor may
      * always return the same boolean value or may vary the result
      * based on chosen criteria.
@@ -271,7 +302,7 @@
      *
      * @param annotations the annotation types requested to be processed
      * @param roundEnv  environment for information about the current and prior round
-     * @return whether or not the set of annotations are claimed by this processor
+     * @return whether or not the set of annotation types are claimed by this processor
      */
     boolean process(Set<? extends TypeElement> annotations,
                     RoundEnvironment roundEnv);
--- a/src/share/classes/javax/lang/model/SourceVersion.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/src/share/classes/javax/lang/model/SourceVersion.java	Thu Aug 22 15:37:58 2013 +0100
@@ -53,6 +53,8 @@
      * 1.4: assert
      * 1.5: annotations, generics, autoboxing, var-args...
      * 1.6: no changes
+     * 1.7: diamond syntax, try-with-resources, etc.
+     * 1.8: lambda expressions and default methods
      */
 
     /**
@@ -122,6 +124,9 @@
      * The version recognized by the Java Platform, Standard Edition
      * 7.
      *
+     * Additions in this release include, diamond syntax for
+     * constructors, {@code try}-with-resources, strings in switch,
+     * binary literals, and multi-catch.
      * @since 1.7
      */
     RELEASE_7,
@@ -130,6 +135,7 @@
      * The version recognized by the Java Platform, Standard Edition
      * 8.
      *
+     * Additions in this release include lambda expressions and default methods.
      * @since 1.8
      */
     RELEASE_8;
--- a/test/com/sun/javadoc/testCRLineSeparator/TestCRLineSeparator.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/com/sun/javadoc/testCRLineSeparator/TestCRLineSeparator.java	Thu Aug 22 15:37:58 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -38,7 +38,7 @@
 public class TestCRLineSeparator extends JavadocTester {
 
     //Test information.
-    private static final String BUG_ID = "4979486";
+    private static final String BUG_ID = "4979486-8014636";
 
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
@@ -47,7 +47,7 @@
 
     //Input for string search tests.
     private static final String[][] TEST = {
-        {BUG_ID + FS + "pkg" + FS + "MyClass.html", "Line 1\n Line 2"}
+        {BUG_ID + FS + "pkg" + FS + "MyClass.html", "Line 1" + NL + " Line 2"}
     };
 
     private static final String[][] NEGATED_TEST = NO_TEST;
--- a/test/com/sun/javadoc/testClassCrossReferences/TestClassCrossReferences.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/com/sun/javadoc/testClassCrossReferences/TestClassCrossReferences.java	Thu Aug 22 15:37:58 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -48,7 +48,7 @@
             "<a href=\"http://java.sun.com/j2se/1.4/docs/api/java/math/BigInteger.html?is-external=true#gcd(java.math.BigInteger)\" " +
                 "title=\"class or interface in java.math\"><code>Link to external member gcd</code></a>"},
         {BUG_ID + FS + "C.html",
-            "<dl>" + NL + "<dt><strong>Overrides:</strong></dt>" + NL +
+            "<dl>" + NL + "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
             "<dd><code>toString</code>&nbsp;in class&nbsp;<code>java.lang.Object</code></dd>" + NL +
             "</dl>"}
     };
--- a/test/com/sun/javadoc/testExternalOverridenMethod/TestExternalOverridenMethod.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/com/sun/javadoc/testExternalOverridenMethod/TestExternalOverridenMethod.java	Thu Aug 22 15:37:58 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, 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
@@ -39,13 +39,13 @@
     private static final String BUG_ID = "4857717";
     private static final String[][] TEST = {
         {BUG_ID + FS + "pkg" + FS + "XReader.html",
-            "<dt><strong>Overrides:</strong></dt>" + NL +
+            "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
             "<dd><code><a href=\"http://java.sun.com/j2se/1.4.1/docs/api/java/io/FilterReader.html?is-external=true#read()\" " +
             "title=\"class or interface in java.io\">read</a></code>&nbsp;in class&nbsp;<code>" +
             "<a href=\"http://java.sun.com/j2se/1.4.1/docs/api/java/io/FilterReader.html?is-external=true\" " +
             "title=\"class or interface in java.io\">FilterReader</a></code></dd>"},
         {BUG_ID + FS + "pkg" + FS + "XReader.html",
-            "<dt><strong>Specified by:</strong></dt>" + NL +
+            "<dt><span class=\"strong\">Specified by:</span></dt>" + NL +
             "<dd><code><a href=\"http://java.sun.com/j2se/1.4.1/docs/api/java/io/DataInput.html?is-external=true#readInt()\" " +
             "title=\"class or interface in java.io\">readInt</a></code>&nbsp;in interface&nbsp;<code>" +
             "<a href=\"http://java.sun.com/j2se/1.4.1/docs/api/java/io/DataInput.html?is-external=true\" " +
--- a/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java	Thu Aug 22 15:37:58 2013 +0100
@@ -94,18 +94,18 @@
                  "</dt>" + NL + "<dd><a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
                  "<code>C1.setUndecorated(boolean)</code></a></dd>" + NL + "</dl>"},
         {BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
-                 "&nbsp;<i>As of JDK version 1.5, replaced by" + NL +
+                 "&nbsp;<span class=\"italic\">As of JDK version 1.5, replaced by" + NL +
                  " <a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
-                 "<code>setUndecorated(boolean)</code></a>.</i></div>" + NL +
+                 "<code>setUndecorated(boolean)</code></a>.</span></div>" + NL +
                  "<div class=\"block\">This field indicates whether the C1 is " +
                  "undecorated.</div>" + NL + "&nbsp;" + NL + "<dl>" + NL + "<dt><span class=\"strong\">Since:</span></dt>" + NL +
                  "<dd>1.4</dd>" + NL + "<dt><span class=\"strong\">See Also:</span>" +
                  "</dt>" + NL + "<dd><a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
                  "<code>C1.setUndecorated(boolean)</code></a></dd>" + NL + "</dl>"},
         {BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
-                 "&nbsp;<i>As of JDK version 1.5, replaced by" + NL +
+                 "&nbsp;<span class=\"italic\">As of JDK version 1.5, replaced by" + NL +
                  " <a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
-                 "<code>setUndecorated(boolean)</code></a>.</i></div>" + NL +
+                 "<code>setUndecorated(boolean)</code></a>.</span></div>" + NL +
                  "<div class=\"block\">Reads the object stream.</div>" + NL +
                  "<dl>" + NL + "<dt><span class=\"strong\">Throws:" +
                  "</span></dt>" + NL + "<dd><code><code>" +
@@ -153,18 +153,18 @@
                  "</dt>" + NL + "<dd><a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
                  "<code>C1.setUndecorated(boolean)</code></a></dd>" + NL + "</dl>"},
         {BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
-                 "&nbsp;<i>As of JDK version 1.5, replaced by" + NL +
+                 "&nbsp;<span class=\"italic\">As of JDK version 1.5, replaced by" + NL +
                  " <a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
-                 "<code>setUndecorated(boolean)</code></a>.</i></div>" + NL +
+                 "<code>setUndecorated(boolean)</code></a>.</span></div>" + NL +
                  "<div class=\"block\">This field indicates whether the C1 is " +
                  "undecorated.</div>" + NL + "&nbsp;" + NL + "<dl>" + NL + "<dt><span class=\"strong\">Since:</span></dt>" + NL +
                  "<dd>1.4</dd>" + NL + "<dt><span class=\"strong\">See Also:</span>" +
                  "</dt>" + NL + "<dd><a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
                  "<code>C1.setUndecorated(boolean)</code></a></dd>" + NL + "</dl>"},
         {BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
-                 "&nbsp;<i>As of JDK version 1.5, replaced by" + NL +
+                 "&nbsp;<span class=\"italic\">As of JDK version 1.5, replaced by" + NL +
                  " <a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
-                 "<code>setUndecorated(boolean)</code></a>.</i></div>" + NL +
+                 "<code>setUndecorated(boolean)</code></a>.</span></div>" + NL +
                  "<div class=\"block\">Reads the object stream.</div>" + NL +
                  "<dl>" + NL + "<dt><span class=\"strong\">Throws:" +
                  "</span></dt>" + NL + "<dd><code><code>" +
@@ -187,14 +187,14 @@
                  "APPLICATION_EXCLUDE</pre>" + NL + "</li>"},
         {BUG_ID + FS + "serialized-form.html", "<pre>boolean " +
                  "undecorated</pre>" + NL + "<div class=\"block\"><span class=\"strong\">" +
-                 "Deprecated.</span>&nbsp;<i>As of JDK version 1.5, replaced by" + NL +
+                 "Deprecated.</span>&nbsp;<span class=\"italic\">As of JDK version 1.5, replaced by" + NL +
                  " <a href=\"pkg1/C1.html#setUndecorated(boolean)\"><code>" +
-                 "setUndecorated(boolean)</code></a>.</i></div>" + NL + "</li>"},
+                 "setUndecorated(boolean)</code></a>.</span></div>" + NL + "</li>"},
         {BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">" +
-                 "Deprecated.</span>&nbsp;<i>As of JDK version" +
+                 "Deprecated.</span>&nbsp;<span class=\"italic\">As of JDK version" +
                  " 1.5, replaced by" + NL +
                  " <a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
-                 "<code>setUndecorated(boolean)</code></a>.</i></div>" + NL + "</li>"}};
+                 "<code>setUndecorated(boolean)</code></a>.</span></div>" + NL + "</li>"}};
 
     // Test for valid HTML generation which should not comprise of empty
     // definition list tags.
--- a/test/com/sun/javadoc/testInterface/TestInterface.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/com/sun/javadoc/testInterface/TestInterface.java	Thu Aug 22 15:37:58 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, 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
@@ -83,7 +83,7 @@
         },
         //Make sure "Specified By" has substituted type parameters.
         {BUG_ID + FS + "pkg" + FS + "Child.html",
-            "<dt><strong>Specified by:</strong></dt>" + NL +
+            "<dt><span class=\"strong\">Specified by:</span></dt>" + NL +
             "<dd><code><a href=\"../pkg/Interface.html#method()\">method</a>" +
             "</code>&nbsp;in interface&nbsp;<code>" +
             "<a href=\"../pkg/Interface.html\" title=\"interface in pkg\">" +
@@ -92,7 +92,7 @@
          },
         //Make sure "Overrides" has substituted type parameters.
         {BUG_ID + FS + "pkg" + FS + "Child.html",
-            "<dt><strong>Overrides:</strong></dt>" + NL +
+            "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
             "<dd><code><a href=\"../pkg/Parent.html#method()\">method</a>" +
             "</code>&nbsp;in class&nbsp;<code><a href=\"../pkg/Parent.html\" " +
             "title=\"class in pkg\">Parent</a>&lt;<a href=\"../pkg/Child.html\" " +
--- a/test/com/sun/javadoc/testJavaFX/C.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/com/sun/javadoc/testJavaFX/C.java	Thu Aug 22 15:37:58 2013 +0100
@@ -57,6 +57,7 @@
      * Defines the direction/speed at which the {@code Timeline} is expected to
      * be played.
      * @defaultValue 11
+     * @since JavaFX 8.0
      */
     private DoubleProperty rate;
 
--- a/test/com/sun/javadoc/testJavaFX/TestJavaFX.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/com/sun/javadoc/testJavaFX/TestJavaFX.java	Thu Aug 22 15:37:58 2013 +0100
@@ -49,19 +49,21 @@
                 "<div class=\"block\">Gets the value of the property rate.</div>" + NL +
                 "<dl>" + NL + "<dt><span class=\"strong\">Property description:</span></dt>" },
             {"./" + BUG_ID + "/C.html",
-                "<td class=\"colLast\"><code><strong><a href=\"C.html#rateProperty\">rate</a></strong></code>" + NL +
+                "<td class=\"colLast\"><code><span class=\"strong\"><a href=\"C.html#rateProperty\">rate</a></span></code>" + NL +
                 "<div class=\"block\">Defines the direction/speed at which the <code>Timeline</code> is expected to"},
 
             {"./" + BUG_ID + "/C.html",
                 "<span class=\"strong\">Default value:</span>"},
             {"./" + BUG_ID + "/C.html",
+                "<span class=\"strong\">Since:</span></dt>" + NL + "<dd>JavaFX 8.0</dd>" },
+            {"./" + BUG_ID + "/C.html",
                 "<p>Sets the value of the property <code>Property</code>"},
             {"./" + BUG_ID + "/C.html",
                 "<p>Gets the value of the property <code>Property</code>"},
             {"./" + BUG_ID + "/C.html",
                 "<span class=\"strong\">Property description:</span>"},
             {"./" + BUG_ID + "/C.html",
-                "<td class=\"colLast\"><code><strong><a href=\"C.html#setTestMethodProperty()\">setTestMethodProperty</a></strong>()</code>&nbsp;</td>" },
+                "<td class=\"colLast\"><code><span class=\"strong\"><a href=\"C.html#setTestMethodProperty()\">setTestMethodProperty</a></span>()</code>&nbsp;</td>" },
             {"./" + BUG_ID + "/C.html",
                 "<h4>isPaused</h4>" + NL +
                 "<pre>public final&nbsp;double&nbsp;isPaused()</pre>" + NL +
@@ -78,7 +80,7 @@
 
 
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "-private", "-javafx",
+        "-d", BUG_ID, "-sourcepath", SRC_DIR, "-javafx",
         SRC_DIR + FS + "C.java", SRC_DIR + FS + "D.java"
     };
 
--- a/test/com/sun/javadoc/testLeadingSpaces/LeadingSpaces.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/com/sun/javadoc/testLeadingSpaces/LeadingSpaces.java	Thu Aug 22 15:37:58 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,11 @@
 
 /*
  * @test
- * @bug 4232882
+ * @bug 4232882 8014636
  * @summary Javadoc strips all of the leading spaces when the comment
  *    does not begin with a star.  This RFE allows users to
  *    begin their comment without a leading star without leading
- *    spaces striped
+ *    spaces stripped
  * @author jamieh
  * @library ../lib/
  * @build JavadocTester
@@ -37,15 +37,15 @@
 
 public class LeadingSpaces extends JavadocTester {
 
-    private static final String BUG_ID = "4232882";
+    private static final String BUG_ID = "4232882-8014636";
     private static final String[][] TEST = {
         {BUG_ID + FS + "LeadingSpaces.html",
-"        1\n" +
-"          2\n" +
-"            3\n" +
-"              4\n" +
-"                5\n" +
-"                  6\n" +
+"        1" + NL +
+"          2" + NL +
+"            3" + NL +
+"              4" + NL +
+"                5" + NL +
+"                  6" + NL +
 "                    7"}
     };
     private static final String[][] NEGATED_TEST = NO_TEST;
--- a/test/com/sun/javadoc/testLinkTaglet/TestLinkTaglet.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/com/sun/javadoc/testLinkTaglet/TestLinkTaglet.java	Thu Aug 22 15:37:58 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      4732864 6280605 7064544
+ * @bug      4732864 6280605 7064544 8014636
  * @summary  Make sure that you can link from one member to another using
  *           non-qualified name, furthermore, ensure the right one is linked.
  * @author   jamieh
@@ -36,7 +36,7 @@
 public class TestLinkTaglet extends JavadocTester {
 
     //Test information.
-    private static final String BUG_ID = "4732864-6280605-7064544";
+    private static final String BUG_ID = "4732864-6280605-7064544-8014636";
 
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
@@ -46,16 +46,16 @@
     //Input for string search tests.
     private static final String[][] TEST = {
         {BUG_ID + FS + "pkg" + FS + "C.html",
-            "Qualified Link: <a href=\"../pkg/C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>\n" +
-            " Unqualified Link1: <a href=\"../pkg/C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>\n" +
-            " Unqualified Link2: <a href=\"../pkg/C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>\n" +
-            " Qualified Link: <a href=\"../pkg/C.html#method(pkg.C.InnerC, pkg.C.InnerC2)\"><code>method(pkg.C.InnerC, pkg.C.InnerC2)</code></a>.<br/>\n" +
-            " Unqualified Link: <a href=\"../pkg/C.html#method(pkg.C.InnerC, pkg.C.InnerC2)\"><code>method(C.InnerC, C.InnerC2)</code></a>.<br/>\n" +
+            "Qualified Link: <a href=\"../pkg/C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>" + NL +
+            " Unqualified Link1: <a href=\"../pkg/C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>" + NL +
+            " Unqualified Link2: <a href=\"../pkg/C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>" + NL +
+            " Qualified Link: <a href=\"../pkg/C.html#method(pkg.C.InnerC, pkg.C.InnerC2)\"><code>method(pkg.C.InnerC, pkg.C.InnerC2)</code></a>.<br/>" + NL +
+            " Unqualified Link: <a href=\"../pkg/C.html#method(pkg.C.InnerC, pkg.C.InnerC2)\"><code>method(C.InnerC, C.InnerC2)</code></a>.<br/>" + NL +
             " Unqualified Link: <a href=\"../pkg/C.html#method(pkg.C.InnerC, pkg.C.InnerC2)\"><code>method(InnerC, InnerC2)</code></a>.<br/>"
         },
         {BUG_ID + FS + "pkg" + FS + "C.InnerC.html",
-            "Link to member in outer class: <a href=\"../pkg/C.html#MEMBER\"><code>C.MEMBER</code></a> <br/>\n" +
-            " Link to member in inner class: <a href=\"../pkg/C.InnerC2.html#MEMBER2\"><code>C.InnerC2.MEMBER2</code></a> <br/>\n" +
+            "Link to member in outer class: <a href=\"../pkg/C.html#MEMBER\"><code>C.MEMBER</code></a> <br/>" + NL +
+            " Link to member in inner class: <a href=\"../pkg/C.InnerC2.html#MEMBER2\"><code>C.InnerC2.MEMBER2</code></a> <br/>" + NL +
             " Link to another inner class: <a href=\"../pkg/C.InnerC2.html\" title=\"class in pkg\"><code>C.InnerC2</code></a>"
         },
         {BUG_ID + FS + "pkg" + FS + "C.InnerC2.html",
--- a/test/com/sun/javadoc/testLiteralCodeInPre/TestLiteralCodeInPre.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/com/sun/javadoc/testLiteralCodeInPre/TestLiteralCodeInPre.java	Thu Aug 22 15:37:58 2013 +0100
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      8002387
+ * @bug      8002387 8014636
  * @summary  Improve rendered HTML formatting for {@code}
  * @library  ../lib/
  * @build    JavadocTester TestLiteralCodeInPre
@@ -33,7 +33,7 @@
 public class TestLiteralCodeInPre extends JavadocTester {
 
     //Test information.
-    private static final String BUG_ID = "8002387";
+    private static final String BUG_ID = "8002387-8014636";
     private static final String OUTPUT_DIR = BUG_ID;
 
     //Javadoc arguments.
--- a/test/com/sun/javadoc/testMemberInheritence/TestMemberInheritence.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/com/sun/javadoc/testMemberInheritence/TestMemberInheritence.java	Thu Aug 22 15:37:58 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -72,7 +72,7 @@
 
          // Test overriding/implementing methods with generic parameters.
                  {BUG_ID + FS + "pkg" + FS + "BaseClass.html",
-         "<dl>" + NL + "<dt><strong>Specified by:</strong></dt>" + NL +
+         "<dl>" + NL + "<dt><span class=\"strong\">Specified by:</span></dt>" + NL +
                           "<dd><code><a href=\"../pkg/BaseInterface.html#getAnnotation(java.lang.Class)\">" +
                           "getAnnotation</a></code>&nbsp;in interface&nbsp;<code>" +
                           "<a href=\"../pkg/BaseInterface.html\" title=\"interface in pkg\">" +
--- a/test/com/sun/javadoc/testMemberSummary/TestMemberSummary.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/com/sun/javadoc/testMemberSummary/TestMemberSummary.java	Thu Aug 22 15:37:58 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, 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
@@ -49,8 +49,8 @@
         // Check return type in member summary.
         {BUG_ID + FS + "pkg" + FS + "PublicChild.html",
             "<code><a href=\"../pkg/PublicChild.html\" title=\"class in pkg\">PublicChild</a></code></td>" + NL +
-            "<td class=\"colLast\"><code><strong><a href=\"../pkg/PublicChild.html#returnTypeTest()\">" +
-            "returnTypeTest</a></strong>()</code>"
+            "<td class=\"colLast\"><code><span class=\"strong\"><a href=\"../pkg/PublicChild.html#returnTypeTest()\">" +
+            "returnTypeTest</a></span>()</code>"
         },
         // Check return type in member detail.
         {BUG_ID + FS + "pkg" + FS + "PublicChild.html",
--- a/test/com/sun/javadoc/testNestedInlineTag/TestNestedInlineTag.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/com/sun/javadoc/testNestedInlineTag/TestNestedInlineTag.java	Thu Aug 22 15:37:58 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -21,10 +21,8 @@
  * questions.
  */
 
-/**
- * This should be green, underlined and bold (Class): {@underline {@bold {@green My test}}} .
+/*
  * @test
- * @bug 0000000
  * @summary Test for nested inline tags. *
  * @author jamieh
  * @library ../lib/
@@ -36,6 +34,9 @@
  * @run main TestNestedInlineTag
  */
 
+/**
+ * This should be green, underlined and bold (Class): {@underline {@bold {@green My test}}} .
+ */
 public class TestNestedInlineTag extends JavadocTester {
 
     /**
--- a/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java	Thu Aug 22 15:37:58 2013 +0100
@@ -62,7 +62,7 @@
                      "</span><span class=\"tabEnd\">&nbsp;</span></caption>"},
             //Detail for enum constant
             {BUG_ID + FS + "pkg" + FS + "Coin.html",
-                "<strong><a href=\"../pkg/Coin.html#Dime\">Dime</a></strong>"},
+                "<span class=\"strong\"><a href=\"../pkg/Coin.html#Dime\">Dime</a></span>"},
             //Automatically insert documentation for values() and valueOf().
             {BUG_ID + FS + "pkg" + FS + "Coin.html",
                 "Returns an array containing the constants of this enum type,"},
@@ -320,11 +320,11 @@
                      "Foo</a></span><span class=\"tabEnd\">&nbsp;</span></caption>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
-                     "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/ClassUseTest1.html\" " +
+                     "<td class=\"colLast\"><code><span class=\"strong\"><a href=\"../../pkg2/ClassUseTest1.html\" " +
                      "title=\"class in pkg2\">ClassUseTest1</a>&lt;T extends " +
                      "<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo" +
                      "</a> &amp; <a href=\"../../pkg2/Foo2.html\" title=\"interface in pkg2\">" +
-                     "Foo2</a>&gt;</strong></code>&nbsp;</td>"
+                     "Foo2</a>&gt;</span></code>&nbsp;</td>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
                      "<caption><span>Methods in <a href=\"../../pkg2/" +
@@ -334,8 +334,8 @@
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
                      "<td class=\"colLast\"><span class=\"strong\">ClassUseTest1." +
-                     "</span><code><strong><a href=\"../../pkg2/" +
-                     "ClassUseTest1.html#method(T)\">method</a></strong>" +
+                     "</span><code><span class=\"strong\"><a href=\"../../pkg2/" +
+                     "ClassUseTest1.html#method(T)\">method</a></span>" +
                      "(T&nbsp;t)</code>&nbsp;</td>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
@@ -372,11 +372,11 @@
                     "</span></caption>"
            },
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html",
-                    "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/ClassUseTest1.html\" " +
+                    "<td class=\"colLast\"><code><span class=\"strong\"><a href=\"../../pkg2/ClassUseTest1.html\" " +
                      "title=\"class in pkg2\">ClassUseTest1</a>&lt;T extends " +
                      "<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo" +
                      "</a> &amp; <a href=\"../../pkg2/Foo2.html\" title=\"interface in pkg2\">" +
-                     "Foo2</a>&gt;</strong></code>&nbsp;</td>"
+                     "Foo2</a>&gt;</span></code>&nbsp;</td>"
            },
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html",
                     "<caption><span>Methods in <a href=\"../../pkg2/" +
@@ -387,8 +387,8 @@
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html",
                      "<td class=\"colLast\"><span class=\"strong\">" +
-                     "ClassUseTest1.</span><code><strong><a href=\"../../" +
-                     "pkg2/ClassUseTest1.html#method(T)\">method</a></strong>" +
+                     "ClassUseTest1.</span><code><span class=\"strong\"><a href=\"../../" +
+                     "pkg2/ClassUseTest1.html#method(T)\">method</a></span>" +
                      "(T&nbsp;t)</code>&nbsp;</td>"
             },
 
@@ -401,11 +401,11 @@
                      "&nbsp;</span></caption>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
-                     "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/ClassUseTest2.html\" " +
+                     "<td class=\"colLast\"><code><span class=\"strong\"><a href=\"../../pkg2/ClassUseTest2.html\" " +
                      "title=\"class in pkg2\">ClassUseTest2</a>&lt;T extends " +
                      "<a href=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">" +
                      "ParamTest</a>&lt;<a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">" +
-                     "Foo3</a>&gt;&gt;</strong></code>&nbsp;</td>"
+                     "Foo3</a>&gt;&gt;</span></code>&nbsp;</td>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
                      "<caption><span>Methods in <a href=\"../../pkg2/" +
@@ -416,8 +416,8 @@
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
                      "<td class=\"colLast\"><span class=\"strong\">ClassUseTest2." +
-                     "</span><code><strong><a href=\"../../pkg2/" +
-                     "ClassUseTest2.html#method(T)\">method</a></strong>" +
+                     "</span><code><span class=\"strong\"><a href=\"../../pkg2/" +
+                     "ClassUseTest2.html#method(T)\">method</a></span>" +
                      "(T&nbsp;t)</code>&nbsp;</td>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
@@ -456,11 +456,11 @@
                      "Foo3</a></span><span class=\"tabEnd\">&nbsp;</span></caption>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
-                     "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/ClassUseTest2.html\" " +
+                     "<td class=\"colLast\"><code><span class=\"strong\"><a href=\"../../pkg2/ClassUseTest2.html\" " +
                      "title=\"class in pkg2\">ClassUseTest2</a>&lt;T extends " +
                      "<a href=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">" +
                      "ParamTest</a>&lt;<a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">" +
-                     "Foo3</a>&gt;&gt;</strong></code>&nbsp;</td>"
+                     "Foo3</a>&gt;&gt;</span></code>&nbsp;</td>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
                      "<caption><span>Methods in <a href=\"../../pkg2/" +
@@ -471,8 +471,8 @@
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
                      "<td class=\"colLast\"><span class=\"strong\">ClassUseTest2." +
-                     "</span><code><strong><a href=\"../../pkg2/" +
-                     "ClassUseTest2.html#method(T)\">method</a></strong>" +
+                     "</span><code><span class=\"strong\"><a href=\"../../pkg2/" +
+                     "ClassUseTest2.html#method(T)\">method</a></span>" +
                      "(T&nbsp;t)</code>&nbsp;</td>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
@@ -500,12 +500,12 @@
                      "&nbsp;</span></caption>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
-                     "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/ClassUseTest3.html\" " +
+                     "<td class=\"colLast\"><code><span class=\"strong\"><a href=\"../../pkg2/ClassUseTest3.html\" " +
                      "title=\"class in pkg2\">ClassUseTest3</a>&lt;T extends " +
                      "<a href=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">" +
                      "ParamTest2</a>&lt;java.util.List&lt;? extends " +
                      "<a href=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">" +
-                     "Foo4</a>&gt;&gt;&gt;</strong></code>&nbsp;</td>"
+                     "Foo4</a>&gt;&gt;&gt;</span></code>&nbsp;</td>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
                      "<caption><span>Methods in <a href=\"../../pkg2/" +
@@ -516,8 +516,8 @@
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
                      "<td class=\"colLast\"><span class=\"strong\">ClassUseTest3" +
-                     ".</span><code><strong><a href=\"../../pkg2/ClassUseTest3." +
-                     "html#method(T)\">method</a></strong>(T&nbsp;t)</code>&nbsp;</td>"
+                     ".</span><code><span class=\"strong\"><a href=\"../../pkg2/ClassUseTest3." +
+                     "html#method(T)\">method</a></span>(T&nbsp;t)</code>&nbsp;</td>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
                      "<td class=\"colFirst\"><code>&lt;T extends <a href=\"../" +
@@ -538,12 +538,12 @@
                      "</span></caption>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
-                     "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/ClassUseTest3.html\" " +
+                     "<td class=\"colLast\"><code><span class=\"strong\"><a href=\"../../pkg2/ClassUseTest3.html\" " +
                      "title=\"class in pkg2\">ClassUseTest3</a>&lt;T extends " +
                      "<a href=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">" +
                      "ParamTest2</a>&lt;java.util.List&lt;? extends " +
                      "<a href=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">" +
-                     "Foo4</a>&gt;&gt;&gt;</strong></code>&nbsp;</td>"
+                     "Foo4</a>&gt;&gt;&gt;</span></code>&nbsp;</td>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
                      "<caption><span>Methods in <a href=\"../../pkg2/" +
@@ -553,8 +553,8 @@
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
                      "<td class=\"colLast\"><span class=\"strong\">ClassUseTest3." +
-                     "</span><code><strong><a href=\"../../pkg2/ClassUseTest3." +
-                     "html#method(T)\">method</a></strong>(T&nbsp;t)</code>" +
+                     "</span><code><span class=\"strong\"><a href=\"../../pkg2/ClassUseTest3." +
+                     "html#method(T)\">method</a></span>(T&nbsp;t)</code>" +
                      "&nbsp;</td>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
@@ -587,8 +587,8 @@
                      "</tr>" + NL + "<tbody>" + NL + "<tr class=\"altColor\">" + NL +
                      "<td class=\"colFirst\"><code>void</code></td>" + NL +
                      "<td class=\"colLast\"><span class=\"strong\">ClassUseTest3." +
-                     "</span><code><strong><a href=\"../../pkg2/ClassUseTest3." +
-                     "html#method(java.util.Set)\">method</a></strong>(java." +
+                     "</span><code><span class=\"strong\"><a href=\"../../pkg2/ClassUseTest3." +
+                     "html#method(java.util.Set)\">method</a></span>(java." +
                      "util.Set&lt;<a href=\"../../pkg2/Foo4.html\" title=\"" +
                      "class in pkg2\">Foo4</a>&gt;&nbsp;p)</code>&nbsp;</td>" + NL +
                      "</tr>" + NL + "</tbody>"
@@ -698,25 +698,25 @@
         {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
             "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Class Annotation\"," + NL +
             "                <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)" + NL +
-            "public class <strong>AnnotationTypeUsage</strong></dt><dt>extends java.lang.Object</dt>"},
+            "public class <span class=\"strong\">AnnotationTypeUsage</span></dt><dt>extends java.lang.Object</dt>"},
 
         //FIELD
         {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
             "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Field Annotation\"," + NL +
             "                <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)" + NL +
-            "public int <strong>field</strong>"},
+            "public int <span class=\"strong\">field</span>"},
 
         //CONSTRUCTOR
         {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
             "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Constructor Annotation\"," + NL +
             "                <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)" + NL +
-            "public <strong>AnnotationTypeUsage</strong>()"},
+            "public <span class=\"strong\">AnnotationTypeUsage</span>()"},
 
         //METHOD
         {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
             "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Method Annotation\"," + NL +
             "                <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)" + NL +
-            "public void <strong>method</strong>()"},
+            "public void <span class=\"strong\">method</span>()"},
 
         //=================================
         // Make sure annotation types do not
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/javadoc/testOptions/TestOptions.java	Thu Aug 22 15:37:58 2013 +0100
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug      4749567
+ * @summary  Test the output for -header and -footer options.
+ * @author   Bhavesh Patel
+ * @library  ../lib/
+ * @build    JavadocTester TestOptions
+ * @run main TestOptions
+ */
+
+public class TestOptions extends JavadocTester {
+
+    //Test information.
+    private static final String BUG_ID = "4749567";
+
+    //Javadoc arguments.
+    private static final String[] ARGS = new String[] {
+        "-d", BUG_ID, "-header", "Test header", "-footer", "Test footer",
+        "-sourcepath", SRC_DIR, "pkg"
+    };
+
+    private static final String[][] TEST = {
+        {BUG_ID + FS + "pkg" + FS + "package-summary.html",
+            "<div class=\"aboutLanguage\">Test header</div>"},
+        {BUG_ID + FS + "pkg" + FS + "package-summary.html",
+            "<div class=\"aboutLanguage\">Test footer</div>"}
+    };
+
+    private static final String[][] NEGATED_TEST = NO_TEST;
+
+    /**
+     * The entry point of the test.
+     * @param args the array of command line arguments.
+     */
+    public static void main(String[] args) {
+        TestOptions tester = new TestOptions();
+        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.printSummary();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getBugId() {
+        return BUG_ID;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getBugName() {
+        return getClass().getName();
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/javadoc/testOptions/pkg/Foo.java	Thu Aug 22 15:37:58 2013 +0100
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package pkg;
+
+public class Foo {}
+
--- a/test/com/sun/javadoc/testOverridenMethods/TestOverridenMethodDocCopy.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/com/sun/javadoc/testOverridenMethods/TestOverridenMethodDocCopy.java	Thu Aug 22 15:37:58 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, 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
@@ -46,9 +46,9 @@
     //Input for string search tests.
     private static final String[][] TEST = {
         {BUG_ID + FS + "pkg1" + FS + "SubClass.html",
-            "<strong>Description copied from class:&nbsp;<code>" +
+            "<span class=\"strong\">Description copied from class:&nbsp;<code>" +
             "<a href=\"../pkg1/BaseClass.html#overridenMethodWithDocsToCopy()\">" +
-            "BaseClass</a></code></strong>"
+            "BaseClass</a></code></span>"
         }
     };
     private static final String[][] NEGATED_TEST = NO_TEST;
--- a/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethods.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethods.java	Thu Aug 22 15:37:58 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -40,12 +40,12 @@
     private static final String[][] TEST = {
         //The public method should be overriden
         {BUG_ID + FS + "pkg1" + FS + "SubClass.html",
-         "<dt><strong>Overrides:</strong></dt>" + NL +
+         "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod"},
 
         //The public method in different package should be overriden
         {BUG_ID + FS + "pkg2" + FS + "SubClass.html",
-         "<dt><strong>Overrides:</strong></dt>" + NL +
+         "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod"}
     };
 
@@ -54,23 +54,23 @@
         //The package private method should be overriden since the base and sub class are in the same
         //package.  However, the link should not show up because the package private methods are not documented.
         {BUG_ID + FS + "pkg1" + FS + "SubClass.html",
-         "<dt><strong>Overrides:</strong></dt>" + NL +
+         "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod"},
 
         //The private method in should not be overriden
         {BUG_ID + FS + "pkg1" + FS + "SubClass.html",
-         "<dt><strong>Overrides:</strong></dt>" + NL +
+         "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod"},
 
         //The private method in different package should not be overriden
         {BUG_ID + FS + "pkg2" + FS + "SubClass.html",
-         "<dt><strong>Overrides:</strong></dt>" + NL +
+         "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod"},
 
         //The package private method should not be overriden since the base and sub class are in
         //different packages.
         {BUG_ID + FS + "pkg2" + FS + "SubClass.html",
-         "Overrides:</strong></dt><dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod"}
+         "Overrides:</span></dt><dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod"}
     };
 
     private static final String[] ARGS =
--- a/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPackageFlag.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPackageFlag.java	Thu Aug 22 15:37:58 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -40,14 +40,14 @@
     private static final String[][] TEST = {
         //The public method should be overriden
         {BUG_ID + FS + "pkg1" + FS + "SubClass.html",
-         "<dt><strong>Overrides:</strong></dt>" + NL +
+         "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod()\">" +
                  "publicMethod</a></code>&nbsp;in class&nbsp;<code>" +
                  "<a href=\"../pkg1/BaseClass.html\" title=\"class in pkg1\">BaseClass</a></code></dd>"},
 
         //The public method in different package should be overriden
         {BUG_ID + FS + "pkg2" + FS + "SubClass.html",
-         "<dt><strong>Overrides:</strong></dt>" + NL +
+         "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod()\">" +
                  "publicMethod</a></code>&nbsp;in class&nbsp;<code>" +
                  "<a href=\"../pkg1/BaseClass.html\" title=\"class in pkg1\">BaseClass</a></code></dd>"},
@@ -55,7 +55,7 @@
         //The package private method should be overriden since the base and sub class are in the same
         //package.
         {BUG_ID + FS + "pkg1" + FS + "SubClass.html",
-         "<dt><strong>Overrides:</strong></dt>" + NL +
+         "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod()\">" +
                  "packagePrivateMethod</a></code>&nbsp;in class&nbsp;<code>" +
                  "<a href=\"../pkg1/BaseClass.html\" title=\"class in pkg1\">BaseClass</a></code></dd>"}
@@ -65,18 +65,18 @@
 
         //The private method in should not be overriden
         {BUG_ID + FS + "pkg1" + FS + "SubClass.html",
-         "<dt><strong>Overrides:</strong></dt>" + NL +
+         "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod()\">"},
 
         //The private method in different package should not be overriden
         {BUG_ID + FS + "pkg2" + FS + "SubClass.html",
-         "<dt><strong>Overrides:</strong></dt>" + NL +
+         "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod()\">"},
 
         //The package private method should not be overriden since the base and sub class are in
         //different packages.
         {BUG_ID + FS + "pkg2" + FS + "SubClass.html",
-         "<dt><strong>Overrides:</strong></dt>" + NL +
+         "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod()\">"},
     };
 
--- a/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPrivateFlag.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPrivateFlag.java	Thu Aug 22 15:37:58 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -40,18 +40,18 @@
     private static final String[][] TEST = {
         //The public method should be overriden
         {BUG_ID + FS + "pkg1" + FS + "SubClass.html",
-         "<dt><strong>Overrides:</strong></dt>" + NL +
+         "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod"},
 
         //The package private method should be overriden since the base and sub class are in the same
         //package.
         {BUG_ID + FS + "pkg1" + FS + "SubClass.html",
-         "<dt><strong>Overrides:</strong></dt>" + NL +
+         "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod"},
 
         //The public method in different package should be overriden
         {BUG_ID + FS + "pkg2" + FS + "SubClass.html",
-         "<dt><strong>Overrides:</strong></dt>" + NL +
+         "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod"},
     };
 
@@ -59,18 +59,18 @@
 
         //The private method in should not be overriden
         {BUG_ID + FS + "pkg1" + FS + "SubClass.html",
-         "<dt><strong>Overrides:</strong></dt>" + NL +
+         "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod"},
 
         //The private method in different package should not be overriden
         {BUG_ID + FS + "pkg2" + FS + "SubClass.html",
-         "<dt><strong>Overrides:</strong></dt>" + NL +
+         "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod"},
 
         //The package private method should not be overriden since the base and sub class are in
         //different packages.
         {BUG_ID + FS + "pkg2" + FS + "SubClass.html",
-         "<dt><strong>Overrides:</strong></dt>" + NL +
+         "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod"}
 
 
--- a/test/com/sun/javadoc/testPackageDeprecation/TestPackageDeprecation.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/com/sun/javadoc/testPackageDeprecation/TestPackageDeprecation.java	Thu Aug 22 15:37:58 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,7 +50,8 @@
     private static final String[][] TEST1 = {
         {BUG_ID + "-1" + FS + "pkg1" + FS + "package-summary.html",
             "<div class=\"deprecatedContent\"><span class=\"strong\">Deprecated.</span>" + NL +
-            "<div class=\"block\"><i>This package is Deprecated.</i></div>"
+            "<div class=\"block\"><span class=\"italic\">This package is Deprecated." +
+            "</span></div>"
         },
         {BUG_ID + "-1" + FS + "deprecated-list.html",
             "<li><a href=\"#package\">Deprecated Packages</a></li>"
--- a/test/com/sun/javadoc/testPrivateClasses/TestPrivateClasses.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/com/sun/javadoc/testPrivateClasses/TestPrivateClasses.java	Thu Aug 22 15:37:58 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, 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
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      4780441 4874845 4978816
+ * @bug      4780441 4874845 4978816 8014017
  * @summary  Make sure that when the -private flag is not used, members
  *           inherited from package private class are documented in the child.
  *
@@ -33,17 +33,19 @@
  *
  *           Make sure that when a private interface method with generic parameters
  *           is implemented, the comments can be inherited properly.
+ *
+ *           Make sure when no modifier appear in the class signature, the
+ *           signature is displayed correctly without extra space at the beginning.
  * @author   jamieh
  * @library  ../lib/
- * @build    JavadocTester
- * @build    TestPrivateClasses
+ * @build    JavadocTester TestPrivateClasses
  * @run main TestPrivateClasses
  */
 
 public class TestPrivateClasses extends JavadocTester {
 
     //Test information.
-    private static final String BUG_ID = "4780441-4874845-4978816";
+    private static final String BUG_ID = "4780441-4874845-4978816-8014017";
 
     //Javadoc arguments.
     private static final String[] ARGS1 = new String[] {
@@ -110,12 +112,12 @@
     private static final String[][] NEGATED_TEST1 = {
        // Should not document that a method overrides method from private class.
       {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
-        "<strong>Overrides:</strong>"},
+        "<span class=\"strong\">Overrides:</span>"},
       // Should not document that a method specified by private interface.
       {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
-        "<strong>Specified by:</strong>"},
+        "<span class=\"strong\">Specified by:</span>"},
       {BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html",
-        "<strong>Specified by:</strong>"},
+        "<span class=\"strong\">Specified by:</span>"},
       // Should not mention that any documentation was copied.
       {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
         "Description copied from"},
@@ -137,7 +139,7 @@
         //Do not inherit private interface method with generic parameters.
         //This method has been implemented.
         {BUG_ID + "-1" + FS + "pkg2" + FS + "C.html",
-            "<strong><a href=\"../pkg2/I.html#hello(T)\">hello</a></strong>"},
+            "<span class=\"strong\"><a href=\"../pkg2/I.html#hello(T)\">hello</a></span>"},
     };
 
     // Test output when -private flag is used.
@@ -174,14 +176,14 @@
         },
         // Should document that a method overrides method from private class.
        {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
-            "<dt><strong>Overrides:</strong></dt>" + NL +
+            "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
             "<dd><code><a href=\"../pkg/PrivateParent.html#methodOverridenFromParent(char[], int, T, V, java.util.List)\">" +
             "methodOverridenFromParent</a></code>&nbsp;in class&nbsp;<code>" +
             "<a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">" +
             "PrivateParent</a></code></dd>"},
        // Should document that a method is specified by private interface.
        {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
-            "<dt><strong>Specified by:</strong></dt>" + NL +
+            "<dt><span class=\"strong\">Specified by:</span></dt>" + NL +
             "<dd><code><a href=\"../pkg/PrivateInterface.html#methodInterface(int)\">" +
             "methodInterface</a></code>&nbsp;in interface&nbsp;<code>" +
             "<a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">" +
@@ -225,17 +227,28 @@
       //Since private flag is used, we can document that private interface method
       //with generic parameters has been implemented.
       {BUG_ID + "-2" + FS + "pkg2" + FS + "C.html",
-            "<strong>Description copied from interface:&nbsp;<code>" +
-            "<a href=\"../pkg2/I.html#hello(T)\">I</a></code></strong>"},
+            "<span class=\"strong\">Description copied from interface:&nbsp;<code>" +
+            "<a href=\"../pkg2/I.html#hello(T)\">I</a></code></span>"},
 
       {BUG_ID + "-2" + FS + "pkg2" + FS + "C.html",
-            "<dt><strong>Specified by:</strong></dt>" + NL +
+            "<dt><span class=\"strong\">Specified by:</span></dt>" + NL +
             "<dd><code><a href=\"../pkg2/I.html#hello(T)\">hello</a></code>" +
             "&nbsp;in interface&nbsp;<code>" +
             "<a href=\"../pkg2/I.html\" title=\"interface in pkg2\">I</a>" +
             "&lt;java.lang.String&gt;</code></dd>"},
+
+      //Make sure when no modifier appear in the class signature, the
+      //signature is displayed correctly without extra space at the beginning.
+      {BUG_ID + "-2" + FS + "pkg" + FS + "PrivateParent.html",
+            "<pre>class <span class=\"strong\">PrivateParent</span>"},
+
+      {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
+            "<pre>public class <span class=\"strong\">PublicChild</span>"},
     };
-    private static final String[][] NEGATED_TEST2 = NO_TEST;
+    private static final String[][] NEGATED_TEST2 = {
+        {BUG_ID + "-2" + FS + "pkg" + FS + "PrivateParent.html",
+            "<pre> class <span class=\"strong\">PrivateParent</span>"},
+    };
 
     /**
      * The entry point of the test.
--- a/test/com/sun/javadoc/testRelativeLinks/TestRelativeLinks.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/com/sun/javadoc/testRelativeLinks/TestRelativeLinks.java	Thu Aug 22 15:37:58 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2004, 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
@@ -23,11 +23,9 @@
 
 /*
  * @test
- * @bug      4460354
+ * @bug      4460354 8014636
  * @summary  Test to make sure that relative paths are redirected in the
  *           output so that they are not broken.
- *           NOTE: these tests have \\n instead of NL because they are user
- *           generated new lines, not Java generated.
  * @author   jamieh
  * @library  ../lib/
  * @build    JavadocTester
@@ -38,7 +36,7 @@
 public class TestRelativeLinks extends JavadocTester {
 
     //Test information.
-    private static final String BUG_ID = "4460354";
+    private static final String BUG_ID = "4460354-8014636";
 
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
@@ -58,7 +56,7 @@
         {BUG_ID + FS + "pkg" + FS + "package-summary.html",
             "<a href=\"relative-package-link.html\">relative package link</a>"},
         {BUG_ID + FS + "pkg" + FS + "C.html",
-            " <a\n" +
+            " <a" + NL +
             " href=\"relative-multi-line-link.html\">relative-multi-line-link</a>."},
 
         //These relative paths should be redirected because they are in different
@@ -74,7 +72,7 @@
         {BUG_ID + FS + "index-all.html",
             "<a href=\"./pkg/relative-package-link.html\">relative package link</a>"},
         {BUG_ID + FS + "index-all.html",
-            " <a\n" +
+            " <a" + NL +
             " href=\"./pkg/relative-multi-line-link.html\">relative-multi-line-link</a>."},
 
 
@@ -92,7 +90,7 @@
         {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "C.html",
             "<a href=\"../../pkg/relative-package-link.html\">relative package link</a>"},
         {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "C.html",
-            " <a\n" +
+            " <a" + NL +
             " href=\"../../pkg/relative-multi-line-link.html\">relative-multi-line-link</a>."},
 
         //PACKAGE OVERVIEW
--- a/test/com/sun/javadoc/testSerializedFormDeprecationInfo/TestSerializedFormDeprecationInfo.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/com/sun/javadoc/testSerializedFormDeprecationInfo/TestSerializedFormDeprecationInfo.java	Thu Aug 22 15:37:58 2013 +0100
@@ -47,9 +47,9 @@
                  "</dt>" + NL + "<dd><a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
                  "<code>C1.setUndecorated(boolean)</code></a></dd>" + NL + "</dl>"},
         {BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
-                 "&nbsp;<i>As of JDK version 1.5, replaced by" + NL +
+                 "&nbsp;<span class=\"italic\">As of JDK version 1.5, replaced by" + NL +
                  " <a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
-                 "<code>setUndecorated(boolean)</code></a>.</i></div>" + NL +
+                 "<code>setUndecorated(boolean)</code></a>.</span></div>" + NL +
                  "<div class=\"block\">This field indicates whether the C1 " +
                  "is undecorated.</div>" + NL + "&nbsp;" + NL +
                  "<dl>" + NL + "<dt><span class=\"strong\">Since:</span></dt>" + NL +
@@ -57,9 +57,9 @@
                  "</dt>" + NL + "<dd><a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
                  "<code>C1.setUndecorated(boolean)</code></a></dd>" + NL + "</dl>"},
         {BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
-                 "&nbsp;<i>As of JDK version 1.5, replaced by" + NL +
+                 "&nbsp;<span class=\"italic\">As of JDK version 1.5, replaced by" + NL +
                  " <a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
-                 "<code>setUndecorated(boolean)</code></a>.</i></div>" + NL +
+                 "<code>setUndecorated(boolean)</code></a>.</span></div>" + NL +
                  "<div class=\"block\">Reads the object stream.</div>" + NL +
                  "<dl>" + NL + "<dt><span class=\"strong\">Throws:</span></dt>" + NL + "<dd><code><code>" +
                  "IOException</code></code></dd>" + NL +
@@ -73,15 +73,15 @@
     // information if any.
     private static final String[][] TEST_NOCMNT = {
         {BUG_ID + FS + "serialized-form.html", "<pre>boolean undecorated</pre>" + NL +
-                 "<div class=\"block\"><span class=\"strong\">Deprecated.</span>&nbsp;<i>" +
+                 "<div class=\"block\"><span class=\"strong\">Deprecated.</span>&nbsp;<span class=\"italic\">" +
                  "As of JDK version 1.5, replaced by" + NL +
                  " <a href=\"pkg1/C1.html#setUndecorated(boolean)\"><code>" +
-                 "setUndecorated(boolean)</code></a>.</i></div>" + NL + "</li>"},
+                 "setUndecorated(boolean)</code></a>.</span></div>" + NL + "</li>"},
         {BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">" +
-                 "Deprecated.</span>&nbsp;<i>As of JDK version" +
+                 "Deprecated.</span>&nbsp;<span class=\"italic\">As of JDK version" +
                  " 1.5, replaced by" + NL +
                  " <a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
-                 "<code>setUndecorated(boolean)</code></a>.</i></div>" + NL + "</li>"}};
+                 "<code>setUndecorated(boolean)</code></a>.</span></div>" + NL + "</li>"}};
 
     // Test with -nodeprecated option. The serialized-form.html should
     // ignore the -nodeprecated tag and display the deprecation info. This
--- a/test/com/sun/javadoc/testStylesheet/TestStylesheet.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/com/sun/javadoc/testStylesheet/TestStylesheet.java	Thu Aug 22 15:37:58 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      4494033 7028815 7052425
+ * @bug      4494033 7028815 7052425 8007338
  * @summary  Run tests on doclet stylesheet.
  * @author   jamieh
  * @library  ../lib/
@@ -34,7 +34,7 @@
 public class TestStylesheet extends JavadocTester {
 
     //Test information.
-    private static final String BUG_ID = "4494033-7028815-7052425";
+    private static final String BUG_ID = "4494033-7028815-7052425-8007338";
 
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
@@ -44,29 +44,45 @@
     //Input for string search tests.
     private static final String[][] TEST = {
         {BUG_ID + FS + "stylesheet.css",
-                "/* Javadoc style sheet */"},
+            "/* Javadoc style sheet */"},
         {BUG_ID + FS + "stylesheet.css",
-                "/*" + NL + "Overall document style" + NL + "*/"},
+            "/*" + NL + "Overall document style" + NL + "*/"},
         {BUG_ID + FS + "stylesheet.css",
-                "/*" + NL + "Heading styles" + NL + "*/"},
+            "/*" + NL + "Heading styles" + NL + "*/"},
         {BUG_ID + FS + "stylesheet.css",
-                "/*" + NL + "Navigation bar styles" + NL + "*/"},
+            "/*" + NL + "Navigation bar styles" + NL + "*/"},
         {BUG_ID + FS + "stylesheet.css",
-                "body {" + NL + "    background-color:#ffffff;" + NL +
-                "    color:#353833;" + NL +
-                "    font-family:Arial, Helvetica, sans-serif;" + NL +
-                "    font-size:76%;" + NL + "    margin:0;" + NL + "}"},
+            "body {" + NL + "    background-color:#ffffff;" + NL +
+            "    color:#353833;" + NL +
+            "    font-family:Arial, Helvetica, sans-serif;" + NL +
+            "    font-size:76%;" + NL + "    margin:0;" + NL + "}"},
         {BUG_ID + FS + "stylesheet.css",
-                "ul {" + NL + "    list-style-type:disc;" + NL + "}"},
+            "ul {" + NL + "    list-style-type:disc;" + NL + "}"},
+        {BUG_ID + FS + "stylesheet.css",
+            ".overviewSummary caption, .packageSummary caption, " +
+            ".contentContainer ul.blockList li.blockList caption, " +
+            ".summary caption, .classUseContainer caption, " +
+            ".constantValuesContainer caption {" + NL +
+            "    position:relative;" + NL +
+            "    text-align:left;" + NL +
+            "    background-repeat:no-repeat;" + NL +
+            "    color:#FFFFFF;" + NL +
+            "    font-weight:bold;" + NL +
+            "    clear:none;" + NL +
+            "    overflow:hidden;" + NL +
+            "    padding:0px;" + NL +
+            "    margin:0px;" + NL +
+            "    white-space:pre;" + NL +
+            "}"},
         // Test whether a link to the stylesheet file is inserted properly
         // in the class documentation.
         {BUG_ID + FS + "pkg" + FS + "A.html",
-                "<link rel=\"stylesheet\" type=\"text/css\" " +
-                "href=\"../stylesheet.css\" title=\"Style\">"}
+            "<link rel=\"stylesheet\" type=\"text/css\" " +
+            "href=\"../stylesheet.css\" title=\"Style\">"}
     };
     private static final String[][] NEGATED_TEST = {
         {BUG_ID + FS + "stylesheet.css",
-                "* {" + NL + "    margin:0;" + NL + "    padding:0;" + NL + "}"}
+            "* {" + NL + "    margin:0;" + NL + "    padding:0;" + NL + "}"}
     };
 
     /**
--- a/test/com/sun/javadoc/testTagMisuse/TestTagMisuse.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/com/sun/javadoc/testTagMisuse/TestTagMisuse.java	Thu Aug 22 15:37:58 2013 +0100
@@ -21,9 +21,8 @@
  * questions.
  */
 
-/**
+/*
  * @test
- * @bug 0000000
  * @summary Determine if proper warning messages are printed when know.
  * @author jamieh
  * @library ../lib/
--- a/test/com/sun/javadoc/testTypeAnnotations/TestTypeAnnotations.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/com/sun/javadoc/testTypeAnnotations/TestTypeAnnotations.java	Thu Aug 22 15:37:58 2013 +0100
@@ -78,7 +78,7 @@
             "typeannos\">@ClassParamA</a> java.lang.String&gt;</span>"
         },
         {BUG_ID + FS + "typeannos" + FS + "ExtendsGeneric.html",
-            "<pre> class <span class=\"strong\">ExtendsGeneric&lt;K extends " +
+            "<pre>class <span class=\"strong\">ExtendsGeneric&lt;K extends " +
             "<a href=\"../typeannos/ClassParamA.html\" title=\"annotation in " +
             "typeannos\">@ClassParamA</a> <a href=\"../typeannos/Unannotated.html\" " +
             "title=\"class in typeannos\">Unannotated</a>&lt;<a href=\"" +
@@ -86,7 +86,7 @@
             "@ClassParamB</a> java.lang.String&gt;&gt;</span>"
         },
         {BUG_ID + FS + "typeannos" + FS + "TwoBounds.html",
-            "<pre> class <span class=\"strong\">TwoBounds&lt;K extends <a href=\"" +
+            "<pre>class <span class=\"strong\">TwoBounds&lt;K extends <a href=\"" +
             "../typeannos/ClassParamA.html\" title=\"annotation in typeannos\">" +
             "@ClassParamA</a> java.lang.String,V extends <a href=\"../typeannos/" +
             "ClassParamB.html\" title=\"annotation in typeannos\">@ClassParamB" +
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/doclint/AnchorTest2.java	Thu Aug 22 15:37:58 2013 +0100
@@ -0,0 +1,20 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8020313
+ * @summary doclint doesn't reset HTML anchors correctly
+ * @build DocLintTester
+ * @run main DocLintTester -ref AnchorTest2.out AnchorTest2.java AnchorTest2a.java
+ * @run main DocLintTester -ref AnchorTest2.out AnchorTest2a.java AnchorTest2.java
+ */
+
+/** */
+public class AnchorTest2 {
+    /** <a name="AnchorTest2"> </a> */
+    public void a_name_AnchorTest2() { }
+
+    /** <a name="AnchorTest2"> </a> */
+    public void a_name_AnchorTest2_already_defined() { }
+
+    /** <a name="AnchorTest2a"> </a> */
+    public void a_name_AnchorTest2a_defined_in_other_file() { }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/doclint/AnchorTest2.out	Thu Aug 22 15:37:58 2013 +0100
@@ -0,0 +1,4 @@
+AnchorTest2.java:15: error: anchor already defined: AnchorTest2
+    /** <a name="AnchorTest2"> </a> */
+           ^
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/doclint/AnchorTest2a.java	Thu Aug 22 15:37:58 2013 +0100
@@ -0,0 +1,7 @@
+/* /nodynamiccopyright/ */
+
+/**
+ * <a name="AnchorTest2a"> </a>
+ */
+public class AnchorTest2a { }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/doclint/BadPackageCommentTest.java	Thu Aug 22 15:37:58 2013 +0100
@@ -0,0 +1,13 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8020278
+ * @summary NPE in javadoc (bad handling of bad tag in package-info.java)
+ * @build DocLintTester
+ * @run main DocLintTester -ref BadPackageCommentTest.out BadPackageCommentTest.java
+ */
+
+/**
+ * abc.
+ * @@@
+ */
+package p;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/doclint/BadPackageCommentTest.out	Thu Aug 22 15:37:58 2013 +0100
@@ -0,0 +1,14 @@
+BadPackageCommentTest.java:13: warning: documentation comment not expected here
+package p;
+^
+BadPackageCommentTest.java:11: error: no tag name after @
+ * @@@
+   ^
+BadPackageCommentTest.java:11: error: no tag name after @
+ * @@@
+    ^
+BadPackageCommentTest.java:11: error: no tag name after @
+ * @@@
+     ^
+3 errors
+1 warning
--- a/test/tools/doclint/DocLintTester.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/tools/doclint/DocLintTester.java	Thu Aug 22 15:37:58 2013 +0100
@@ -123,7 +123,7 @@
     private static final Pattern dirFileLine = Pattern.compile(
             "(?m)"                          // multi-line mode
             + "^(.*?)"                      // directory part of file name
-            + "([A-Za-z0-9.]+:[0-9]+:)");   // file name and line number
+            + "([-A-Za-z0-9.]+:[0-9]+:)");  // file name and line number
 
     String removeFileNames(String s) {
         Matcher m = dirFileLine.matcher(s);
--- a/test/tools/doclint/ReferenceTest.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/tools/doclint/ReferenceTest.java	Thu Aug 22 15:37:58 2013 +0100
@@ -1,6 +1,6 @@
 /*
  * @test /nodynamiccopyright/
- * @bug 8004832
+ * @bug 8004832 8020556
  * @summary Add new doclint package
  * @build DocLintTester
  * @run main DocLintTester -Xmsgs:-reference ReferenceTest.java
@@ -48,5 +48,11 @@
      * @throws Exception description
      */
     public void exception_not_thrown() { }
+
+    /**
+     * @param <T> throwable
+     * @throws T description
+     */
+    public <T extends Throwable> void valid_throws_generic() throws T { }
 }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/doclint/packageTests/bad/Test.java	Thu Aug 22 15:37:58 2013 +0100
@@ -0,0 +1,16 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8020664 8021215
+ * @summary doclint gives incorrect warnings on normal package statements
+ * @library ../..
+ * @build DocLintTester
+ * @run main DocLintTester -ref Test.out Test.java
+ * @compile/fail/ref=Test.javac.out -XDrawDiagnostics -Werror -Xdoclint:all Test.java
+ */
+
+/** Unexpected comment */
+package bad;
+
+/** */
+class Test { }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/doclint/packageTests/bad/Test.javac.out	Thu Aug 22 15:37:58 2013 +0100
@@ -0,0 +1,4 @@
+Test.java:12:1: compiler.warn.proc.messager: documentation comment not expected here
+- compiler.err.warnings.and.werror
+1 error
+1 warning
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/doclint/packageTests/bad/Test.out	Thu Aug 22 15:37:58 2013 +0100
@@ -0,0 +1,4 @@
+Test.java:12: warning: documentation comment not expected here
+package bad;
+^
+1 warning
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/doclint/packageTests/bad/package-info.java	Thu Aug 22 15:37:58 2013 +0100
@@ -0,0 +1,12 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8020664 8021215
+ * @summary doclint gives incorrect warnings on normal package statements
+ * @library ../..
+ * @build DocLintTester
+ * @run main DocLintTester -ref package-info.out package-info.java
+ * @compile/fail/ref=package-info.javac.out -XDrawDiagnostics -Werror -Xdoclint:all package-info.java
+ */
+
+// missing comment
+package bad;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/doclint/packageTests/bad/package-info.javac.out	Thu Aug 22 15:37:58 2013 +0100
@@ -0,0 +1,4 @@
+package-info.java:12:1: compiler.warn.proc.messager: no comment
+- compiler.err.warnings.and.werror
+1 error
+1 warning
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/doclint/packageTests/bad/package-info.out	Thu Aug 22 15:37:58 2013 +0100
@@ -0,0 +1,4 @@
+package-info.java:12: warning: no comment
+package bad;
+^
+1 warning
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/doclint/packageTests/good/Test.java	Thu Aug 22 15:37:58 2013 +0100
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * 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 /nodynamiccopyright/
+ * @bug 8020664 8021215
+ * @summary doclint gives incorrect warnings on normal package statements
+ * @library ../..
+ * @build DocLintTester
+ * @run main DocLintTester Test.java
+ * @compile -Xdoclint:all Test.java
+ */
+
+// no doc comment
+package good;
+
+/** */
+class Test { }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/doclint/packageTests/good/package-info.java	Thu Aug 22 15:37:58 2013 +0100
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * 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 /nodynamiccopyright/
+ * @bug 8020664 8021215
+ * @summary doclint gives incorrect warnings on normal package statements
+ * @library ../..
+ * @build DocLintTester
+ * @run main DocLintTester package-info.java
+ * @compile -Xdoclint:all package-info.java
+ */
+
+/** Description. */
+package good;
--- a/test/tools/doclint/tool/HelpTest.out	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/tools/doclint/tool/HelpTest.out	Thu Aug 22 15:37:58 2013 +0100
@@ -36,7 +36,7 @@
     Show this message.
 
 The following javac options are also supported
-  -bootclasspath, -classpath, -sourcepath, -Xmaxerrs, -Xmaxwarns
+  -bootclasspath, -classpath, -cp, -sourcepath, -Xmaxerrs, -Xmaxwarns
 
 To run doclint on part of a project, put the compiled classes for your
 project on the classpath (or bootclasspath), then specify the source files
--- a/test/tools/javac/Diagnostics/compressed/T8020286.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/tools/javac/Diagnostics/compressed/T8020286.java	Thu Aug 22 15:37:58 2013 +0100
@@ -1,7 +1,7 @@
 /**
  * @test /nodynamiccopyright/
  * @bug     8020286
- * @summary Wrong diagnostic after compaction 
+ * @summary Wrong diagnostic after compaction
  * @compile/fail/ref=T8020286.out -XDrawDiagnostics -Xdiags:compact T8020286.java
  */
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/T6326693/FinalVariableAssignedToInCatchBlockTest.java	Thu Aug 22 15:37:58 2013 +0100
@@ -0,0 +1,94 @@
+/*
+ * 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 6356530
+ * @summary -Xlint:serial does not flag abstract classes with concrete methods/members
+ * @compile/fail/ref=FinalVariableAssignedToInCatchBlockTest.out -XDrawDiagnostics FinalVariableAssignedToInCatchBlockTest.java
+ */
+
+import java.io.IOException;
+
+public class FinalVariableAssignedToInCatchBlockTest {
+    public void m1(int o)
+    {
+        final int i;
+        try {
+            if (o == 1) {
+                throw new IOException();
+            } else if (o == 2) {
+                throw new InterruptedException();
+            } else {
+                throw new Exception();
+            }
+        } catch (IOException e) {
+            i = 1;
+        } catch (InterruptedException ie) {
+            i = 2;
+        } catch (Exception e) {
+            i = 3;
+        } finally {
+            i = 4;
+        }
+    }
+
+    public void m2(int o)
+    {
+        final int i;
+        try {
+            if (o == 1) {
+                throw new IOException();
+            } else if (o == 2) {
+                throw new InterruptedException();
+            } else {
+                throw new Exception();
+            }
+        } catch (IOException e) {
+            i = 1;
+        } catch (InterruptedException ie) {
+            i = 2;
+        } catch (Exception e) {
+            i = 3;
+        }
+    }
+
+    public void m3(int o) throws Exception
+    {
+        final int i;
+        try {
+            if (o == 1) {
+                throw new IOException();
+            } else if (o == 2) {
+                throw new InterruptedException();
+            } else {
+                throw new Exception();
+            }
+        } catch (IOException e) {
+            i = 1;
+        } catch (InterruptedException ie) {
+            i = 2;
+        }
+        i = 3;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/T6326693/FinalVariableAssignedToInCatchBlockTest.out	Thu Aug 22 15:37:58 2013 +0100
@@ -0,0 +1,3 @@
+FinalVariableAssignedToInCatchBlockTest.java:52:13: compiler.err.var.might.already.be.assigned: i
+FinalVariableAssignedToInCatchBlockTest.java:92:9: compiler.err.var.might.already.be.assigned: i
+2 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/T6356530/SerializableAbstractClassWithNonAbstractMethodsTest.java	Thu Aug 22 15:37:58 2013 +0100
@@ -0,0 +1,48 @@
+/*
+ * 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 6356530
+ * @summary -Xlint:serial does not flag abstract classes with concrete methods/members
+ * @compile/fail/ref=SerializableAbstractClassWithNonAbstractMethodsTest.out -XDrawDiagnostics -Werror -Xlint:serial SerializableAbstractClassWithNonAbstractMethodsTest.java
+ */
+
+abstract class SerializableAbstractClassWithNonAbstractMethodsTest implements java.io.Serializable {
+    void m1() {}
+    abstract void m2();
+
+    abstract class AWithUID implements java.io.Serializable {
+        private static final long serialVersionUID = 0;
+        void m(){}
+    }
+
+    interface IDefault extends java.io.Serializable {
+        default int m() { return 1; }
+    }
+
+    interface IDefaultAndUID extends java.io.Serializable {
+        static final long serialVersionUID = 0;
+        default int m() { return 1; }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/T6356530/SerializableAbstractClassWithNonAbstractMethodsTest.out	Thu Aug 22 15:37:58 2013 +0100
@@ -0,0 +1,5 @@
+SerializableAbstractClassWithNonAbstractMethodsTest.java:40:5: compiler.warn.missing.SVUID: SerializableAbstractClassWithNonAbstractMethodsTest.IDefault
+SerializableAbstractClassWithNonAbstractMethodsTest.java:31:10: compiler.warn.missing.SVUID: SerializableAbstractClassWithNonAbstractMethodsTest
+- compiler.err.warnings.and.werror
+1 error
+2 warnings
--- a/test/tools/javac/T6725036.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/tools/javac/T6725036.java	Thu Aug 22 15:37:58 2013 +0100
@@ -24,6 +24,7 @@
 /*
  * @test
  * @bug 6725036
+ * @ignore 8016760: failure of regression test langtools/tools/javac/T6725036.java
  * @summary javac returns incorrect value for lastModifiedTime() when
  *          source is a zip file archive
  */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/T7008643/InlinedFinallyConfuseDebuggersTest.java	Thu Aug 22 15:37:58 2013 +0100
@@ -0,0 +1,117 @@
+/*
+ * 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 7008643
+ * @summary inlined finally clauses confuse debuggers
+ * @library /tools/javac/lib
+ * @build ToolBox
+ * @run main InlinedFinallyConfuseDebuggersTest
+ */
+
+import java.io.File;
+import java.nio.file.Paths;
+
+import com.sun.tools.classfile.ClassFile;
+import com.sun.tools.classfile.Code_attribute;
+import com.sun.tools.classfile.LineNumberTable_attribute;
+import com.sun.tools.classfile.Method;
+import com.sun.tools.javac.util.Assert;
+
+public class InlinedFinallyConfuseDebuggersTest {
+
+    static final String testSource =
+    /* 01 */        "public class InlinedFinallyTest {\n" +
+    /* 02 */        "    void lookForThisMethod(int value) {\n" +
+    /* 03 */        "        try {\n" +
+    /* 04 */        "            if (value > 0) {\n" +
+    /* 05 */        "                System.out.println(\"if\");\n" +
+    /* 06 */        "                return;\n" +
+    /* 07 */        "            }\n" +
+    /* 08 */        "        } finally {\n" +
+    /* 09 */        "            System.out.println(\"finally\");\n" +
+    /* 10 */        "        }\n" +
+    /* 11 */        "    }\n" +
+    /* 12 */        "}";
+
+    static final int[][] expectedLNT = {
+    //  {line-number, start-pc},
+        {4,           0},       //if (value > 0) {
+        {5,           4},       //    System.out.println("if");
+        {9,           12},      //System.out.println("finally");
+        {6,           20},      //    return;
+        {9,           21},      //System.out.println("finally");
+        {10,          29},
+        {9,           32},      //System.out.println("finally");
+        {11,          43},
+    };
+
+    static final String methodToLookFor = "lookForThisMethod";
+
+    public static void main(String[] args) throws Exception {
+        new InlinedFinallyConfuseDebuggersTest().run();
+    }
+
+    void run() throws Exception {
+        compileTestClass();
+        checkClassFile(new File(Paths.get(System.getProperty("user.dir"),
+                "InlinedFinallyTest.class").toUri()), methodToLookFor);
+    }
+
+    void compileTestClass() throws Exception {
+        ToolBox.JavaToolArgs javacSuccessArgs =
+                new ToolBox.JavaToolArgs().setSources(testSource);
+        ToolBox.javac(javacSuccessArgs);
+    }
+
+    void checkClassFile(final File cfile, String methodToFind) throws Exception {
+        ClassFile classFile = ClassFile.read(cfile);
+        boolean methodFound = false;
+        for (Method method : classFile.methods) {
+            if (method.getName(classFile.constant_pool).equals(methodToFind)) {
+                methodFound = true;
+                Code_attribute code = (Code_attribute) method.attributes.get("Code");
+                LineNumberTable_attribute lnt =
+                        (LineNumberTable_attribute) code.attributes.get("LineNumberTable");
+                Assert.check(lnt.line_number_table_length == expectedLNT.length,
+                        "The LineNumberTable found has a length different to the expected one");
+                int i = 0;
+                for (LineNumberTable_attribute.Entry entry: lnt.line_number_table) {
+                    Assert.check(entry.line_number == expectedLNT[i][0] &&
+                            entry.start_pc == expectedLNT[i][1],
+                            "LNT entry at pos " + i + " differ from expected." +
+                            "Found " + entry.line_number + ":" + entry.start_pc +
+                            ". Expected " + expectedLNT[i][0] + ":" + expectedLNT[i][1]);
+                    i++;
+                }
+            }
+        }
+        Assert.check(methodFound, "The seek method was not found");
+    }
+
+    void error(String msg) {
+        throw new AssertionError(msg);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/T8016099/UncheckedWarningRegressionTest.java	Thu Aug 22 15:37:58 2013 +0100
@@ -0,0 +1,32 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug     8016099
+ * @summary Some SuppressWarnings annotations ignored ( unchecked, rawtypes )
+ * @compile UncheckedWarningRegressionTest.java
+ * @compile/fail/ref=UncheckedWarningRegressionTest.out -XDrawDiagnostics -Werror -Xlint:unchecked UncheckedWarningRegressionTest.java
+ */
+
+public class UncheckedWarningRegressionTest {
+    <T> void suppressedWarningsFinalInitializer() {
+        @SuppressWarnings("unchecked")
+        T[] tt = (T[]) FINAL_EMPTY_ARRAY;
+    }
+
+    final Object[] FINAL_EMPTY_ARRAY = {};
+
+    <T> void finalInitializer() {
+        T[] tt = (T[]) FINAL_EMPTY_ARRAY;
+    }
+
+    <T> void suppressedWarningsNonFinalInitializer() {
+        @SuppressWarnings("unchecked")
+        T[] tt = (T[]) NON_FINAL_EMPTY_ARRAY;
+    }
+
+    Object[] NON_FINAL_EMPTY_ARRAY = {};
+
+    <T> void nonFinalInitializer() {
+        T[] tt = (T[]) NON_FINAL_EMPTY_ARRAY;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/T8016099/UncheckedWarningRegressionTest.out	Thu Aug 22 15:37:58 2013 +0100
@@ -0,0 +1,5 @@
+UncheckedWarningRegressionTest.java:18:24: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), java.lang.Object[], T[]
+UncheckedWarningRegressionTest.java:29:24: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), java.lang.Object[], T[]
+- compiler.err.warnings.and.werror
+1 error
+2 warnings
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/T8020997/CannotCompileRepeatedAnnoTest.java	Thu Aug 22 15:37:58 2013 +0100
@@ -0,0 +1,46 @@
+
+/*
+ * 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 8020997
+ * @summary Cannot compile class with repeating annotation
+ * @compile CannotCompileRepeatedAnnoTest.java
+ */
+
+import java.lang.annotation.*;
+
+@Anno(req = true)
+@Anno()
+public class CannotCompileRepeatedAnnoTest {
+}
+
+@Repeatable(Container.class)
+@interface Anno {
+    boolean req() default false;
+}
+
+@interface Container{
+    Anno[] value();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/T8022186/DeadCodeGeneratedForEmptyTryTest.java	Thu Aug 22 15:37:58 2013 +0100
@@ -0,0 +1,166 @@
+/*
+ * 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 8022186
+ * @summary javac generates dead code if a try with an empty body has a finalizer
+ */
+
+import com.sun.tools.classfile.Attribute;
+import com.sun.tools.classfile.ClassFile;
+import com.sun.tools.classfile.Code_attribute;
+import com.sun.tools.classfile.ConstantPool;
+import com.sun.tools.classfile.ConstantPool.CONSTANT_String_info;
+import com.sun.tools.classfile.ConstantPool.CPInfo;
+import com.sun.tools.classfile.ConstantPool.InvalidIndex;
+import com.sun.tools.classfile.Instruction;
+import com.sun.tools.classfile.Instruction.KindVisitor;
+import com.sun.tools.classfile.Instruction.TypeKind;
+import com.sun.tools.classfile.Method;
+import com.sun.tools.javac.util.Assert;
+import java.io.BufferedInputStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+public class DeadCodeGeneratedForEmptyTryTest {
+
+    public static void main(String[] args) throws Exception {
+        new DeadCodeGeneratedForEmptyTryTest().run();
+    }
+
+    void run() throws Exception {
+        checkClassFile(Paths.get(System.getProperty("test.classes"),
+                this.getClass().getName() + "$Test.class"));
+    }
+
+    int utf8Index;
+    int numberOfRefToStr = 0;
+    ConstantPool constantPool;
+
+    void checkClassFile(final Path path) throws Exception {
+        ClassFile classFile = ClassFile.read(
+                new BufferedInputStream(Files.newInputStream(path)));
+        constantPool = classFile.constant_pool;
+        utf8Index = constantPool.getUTF8Index("STR_TO_LOOK_FOR");
+        for (Method method: classFile.methods) {
+            if (method.getName(constantPool).equals("methodToLookFor")) {
+                Code_attribute codeAtt = (Code_attribute)method.attributes.get(Attribute.Code);
+                for (Instruction inst: codeAtt.getInstructions()) {
+                    inst.accept(codeVisitor, null);
+                }
+            }
+        }
+        Assert.check(numberOfRefToStr == 1,
+                "There should only be one reference to a CONSTANT_String_info structure in the generated code");
+    }
+
+    CodeVisitor codeVisitor = new CodeVisitor();
+
+    class CodeVisitor implements KindVisitor<Void, Void> {
+
+        void checkIndirectRefToString(int cp_index) {
+            try {
+                CPInfo cInfo = constantPool.get(cp_index);
+                if (cInfo instanceof CONSTANT_String_info) {
+                    CONSTANT_String_info strInfo = (CONSTANT_String_info)cInfo;
+                    if (strInfo.string_index == utf8Index) {
+                        numberOfRefToStr++;
+                    }
+                }
+            } catch (InvalidIndex ex) {
+                throw new AssertionError("invalid constant pool index at " + cp_index);
+            }
+        }
+
+        @Override
+        public Void visitNoOperands(Instruction instr, Void p) {
+            return null;
+        }
+
+        @Override
+        public Void visitArrayType(Instruction instr, TypeKind kind, Void p) {
+            return null;
+        }
+
+        @Override
+        public Void visitBranch(Instruction instr, int offset, Void p) {
+            return null;
+        }
+
+        @Override
+        public Void visitConstantPoolRef(Instruction instr, int index, Void p) {
+            checkIndirectRefToString(index);
+            return null;
+        }
+
+        @Override
+        public Void visitConstantPoolRefAndValue(Instruction instr, int index, int value, Void p) {
+            checkIndirectRefToString(index);
+            return null;
+        }
+
+        @Override
+        public Void visitLocal(Instruction instr, int index, Void p) {
+            return null;
+        }
+
+        @Override
+        public Void visitLocalAndValue(Instruction instr, int index, int value, Void p) {
+            return null;
+        }
+
+        @Override
+        public Void visitLookupSwitch(Instruction instr, int default_, int npairs, int[] matches, int[] offsets, Void p) {
+            return null;
+        }
+
+        @Override
+        public Void visitTableSwitch(Instruction instr, int default_, int low, int high, int[] offsets, Void p) {
+            return null;
+        }
+
+        @Override
+        public Void visitValue(Instruction instr, int value, Void p) {
+            return null;
+        }
+
+        @Override
+        public Void visitUnknown(Instruction instr, Void p) {
+            return null;
+        }
+
+    }
+
+    public class Test {
+        void methodToLookFor() {
+            try {
+            } finally {
+                System.out.println("STR_TO_LOOK_FOR");
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/annotations/typeAnnotations/ErasureTest.java	Thu Aug 22 15:37:58 2013 +0100
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8016013
+ * @summary Compiler incorrectly treats annotated and unannotated type variable bounds as different types
+ * @compile -doe ErasureTest.java
+ */
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER })
+@interface Advanced {}
+
+class U {}
+interface I {}
+
+class ErasureTest {
+     <T extends U & @Advanced I> void TestMethod(T arg1) { }
+    public static void main(String argv[]) {
+        ErasureTest t1 = new ErasureTest(){
+            public <T extends @Advanced U & I> void TestMethod(T arg1) { }
+        };
+
+        ErasureTest t2 = new ErasureTest(){
+            public <T extends U & @Advanced I> void TestMethod(T arg1) { }
+        };
+    }
+}
--- a/test/tools/javac/api/6437999/Utf8.java	Thu Aug 22 13:51:34 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-/*
- * 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
- * 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.
- */
-
-/**
- * @author Peter von der Ah\u00e9
- */
-class Utf8 {}
--- a/test/tools/javac/conditional/T8016702.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/tools/javac/conditional/T8016702.java	Thu Aug 22 15:37:58 2013 +0100
@@ -30,16 +30,16 @@
 import java.util.List;
 
 public class T8016702 {
-    
+
     static int assertionCount;
-    
+
     static void assertTrue(boolean b, String msg) {
         assertionCount++;
         if (!b) {
             throw new AssertionError(msg);
         }
     }
-    
+
     interface IntFunction<Y> {
         Y m(int x);
     }
@@ -48,7 +48,7 @@
         map(i -> (i % 2 == 0) ? "" : "i="+i, li);
     }
 
-    
+
     @SuppressWarnings("unchecked")
     <R> void map(IntFunction<R> mapper, List<Integer> li) {
         for (int i : li) {
@@ -57,10 +57,10 @@
                     "i = " + i + " res = " + res);
         }
     }
-    
+
     public static void main(String[] args) {
         T8016702 tester = new T8016702();
         tester.test(Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9));
         assertTrue(assertionCount == 10, "wrong assertion count: " + assertionCount);
     }
-}
\ No newline at end of file
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/MethodInvokedWithWrongNumberOfArgs.java	Thu Aug 22 15:37:58 2013 +0100
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+// key: compiler.err.method.invoked.with.incorrect.number.arguments
+// options: -Xlint:-options -source 6 -target 6
+
+class MethodInvokedWithWrongNumberOfArgs {
+    static java.lang.invoke.MethodHandle getNamedMember;
+    public static Object getMember(String name, Object rec) throws Throwable {
+        return getNamedMember.invoke(rec, name);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/VarNotIntializedInDefaultConstructor.java	Thu Aug 22 15:37:58 2013 +0100
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+// key: compiler.err.var.not.initialized.in.default.constructor
+
+class X {
+    final int j;
+}
--- a/test/tools/javac/generics/7034511/T7034511a.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/tools/javac/generics/7034511/T7034511a.java	Thu Aug 22 15:37:58 2013 +0100
@@ -1,13 +1,10 @@
 /*
  * @test /nodynamiccopyright/
- * @ignore 7041019 Bogus type-variable substitution with array types with dependencies on accessibility check
- * @bug     7034511 7040883
+ * @bug     7034511 7040883 7041019
  * @summary Loophole in typesafety
  * @compile/fail/ref=T7034511a.out -XDrawDiagnostics T7034511a.java
  */
 
-// backing out 7034511, see 7040883
-
 class T7034511a {
 
     interface A<T> {
--- a/test/tools/javac/generics/7034511/T7034511a.out	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/tools/javac/generics/7034511/T7034511a.out	Thu Aug 22 15:37:58 2013 +0100
@@ -1,2 +1,2 @@
-T7034511a.java:18:14: compiler.err.cant.apply.symbol: kindname.method, foo, compiler.misc.type.captureof: 1, ?[], java.lang.String[], kindname.interface, T7034511a.A<T>, (compiler.misc.no.conforming.assignment.exists: java.lang.String[], compiler.misc.type.captureof: 1, ?[])
+T7034511a.java:18:14: compiler.err.cant.apply.symbol: kindname.method, foo, compiler.misc.type.captureof: 1, ?[], java.lang.String[], kindname.interface, T7034511a.A<T>, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inconvertible.types: java.lang.String[], compiler.misc.type.captureof: 1, ?[]))
 1 error
--- a/test/tools/javac/generics/7034511/T7034511b.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/tools/javac/generics/7034511/T7034511b.java	Thu Aug 22 15:37:58 2013 +0100
@@ -1,13 +1,10 @@
 /*
  * @test /nodynamiccopyright/
- * @ignore 7041019 Bogus type-variable substitution with array types with dependencies on accessibility check
- * @bug     7034511 7040883
+ * @bug     7034511 7040883 7041019
  * @summary Loophole in typesafety
  * @compile/fail/ref=T7034511b.out -XDrawDiagnostics T7034511b.java
  */
 
-// backing out 7034511, see 7040883
-
 class T7034511b {
     static class MyList<E> {
         E toArray(E[] e) { return null; }
--- a/test/tools/javac/generics/7034511/T7034511b.out	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/tools/javac/generics/7034511/T7034511b.out	Thu Aug 22 15:37:58 2013 +0100
@@ -1,2 +1,2 @@
-T7034511b.java:14:11: compiler.err.cant.apply.symbol: kindname.method, toArray, compiler.misc.type.captureof: 1, ?[], java.lang.Object[], kindname.class, T7034511b.MyList<E>, (compiler.misc.no.conforming.assignment.exists: java.lang.Object[], compiler.misc.type.captureof: 1, ?[])
+T7034511b.java:14:11: compiler.err.cant.apply.symbol: kindname.method, toArray, compiler.misc.type.captureof: 1, ?[], java.lang.Object[], kindname.class, T7034511b.MyList<E>, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inconvertible.types: java.lang.Object[], compiler.misc.type.captureof: 1, ?[]))
 1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/generics/7034511/T7041019.java	Thu Aug 22 15:37:58 2013 +0100
@@ -0,0 +1,39 @@
+/*
+ * 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 7034511 7040883 7041019
+ * @summary Bogus type-variable substitution with array types with dependencies on accessibility check
+ *
+ * @compile T7041019.java
+ */
+import java.util.List;
+
+class T7041019 {
+   <E> List<E>[] m(List<E> l) { return null; }
+
+   void test(List<? extends String> ls) {
+      int i = m(ls).length;
+   }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/generics/8016640/T8016640.java	Thu Aug 22 15:37:58 2013 +0100
@@ -0,0 +1,10 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug     8016640
+ * @summary compiler hangs if the generics arity of a base class is wrong
+ * @compile/fail/ref=T8016640.out -XDrawDiagnostics T8016640.java
+ */
+class T8016640 {
+    static class Foo<X,Y> { }
+    static class BadFoo<T> extends Foo<T> { }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/generics/8016640/T8016640.out	Thu Aug 22 15:37:58 2013 +0100
@@ -0,0 +1,2 @@
+T8016640.java:9:39: compiler.err.wrong.number.type.args: 2
+1 error
--- a/test/tools/javac/generics/bridges/BridgeHarness.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/tools/javac/generics/bridges/BridgeHarness.java	Thu Aug 22 15:37:58 2013 +0100
@@ -65,7 +65,7 @@
 
     /** the (shared) Java compiler used for compiling the tests */
     static final JavaCompiler comp = ToolProvider.getSystemJavaCompiler();
-    
+
     /** the (shared) file manager used by the compiler */
     static final StandardJavaFileManager fm = comp.getStandardFileManager(null, null, null);
 
@@ -85,9 +85,9 @@
             throw new AssertionError("Errors were found");
         }
     }
-    
+
     /* utility methods */
-    
+
     /**
      * Remove an element from a list
      */
@@ -100,19 +100,19 @@
             return drop(lz.tail, z).prepend(lz.head);
         }
     }
-    
+
     /**
      * return a string representation of a bytecode method
      */
     static String descriptor(Method m, ConstantPool cp) throws ConstantPoolException {
         return m.getName(cp) + m.descriptor.getValue(cp);
     }
-    
+
     /* test harness */
 
     /** Test file to be compiled */
     JavaFileObject jfo;
-    
+
     /** Mapping between class name and list of bridges in class with that name */
     Map<String, List<Bridge>> bridgesMap = new HashMap<String, List<Bridge>>();
 
@@ -127,22 +127,22 @@
     protected void compileAndCheck() throws Exception {
         JavacTask ct = (JavacTask)comp.getTask(null, fm, null, null, null, Arrays.asList(jfo));
         ct.setProcessors(Collections.singleton(new BridgeFinder()));
-        
+
         for (JavaFileObject jfo : ct.generate()) {
             checkBridges(jfo);
         }
     }
-    
+
     /**
      * Check that every bridge in the generated classfile has a matching bridge
      * annotation in the bridge map
      */
     protected void checkBridges(JavaFileObject jfo) {
-        try (InputStream is = jfo.openInputStream()) {            
+        try (InputStream is = jfo.openInputStream()) {
             ClassFile cf = ClassFile.read(is);
             System.err.println("checking: " + cf.getName());
-            
-            List<Bridge> bridgeList = bridgesMap.get(cf.getName());            
+
+            List<Bridge> bridgeList = bridgesMap.get(cf.getName());
             if (bridgeList == null) {
                 //no bridges - nothing to check;
                 bridgeList = List.nil();
@@ -192,7 +192,7 @@
         public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
             if (roundEnv.processingOver())
                 return true;
-            
+
             TypeElement bridgeAnno = elements.getTypeElement("Bridge");
             TypeElement bridgesAnno = elements.getTypeElement("Bridges");
 
@@ -205,14 +205,14 @@
                 }
                 bridgesMap.put(((ClassSymbol)elem).flatname.toString(), bridgeList);
             }
-            
+
             //see if there are non-repeated annos
             for (Element elem: roundEnv.getElementsAnnotatedWith(bridgeAnno)) {
                 Bridge bridge = elem.getAnnotation(Bridge.class);
                 bridgesMap.put(((ClassSymbol)elem).flatname.toString(),
                         List.of(bridge));
             }
-            
+
             return true;
         }
     }
--- a/test/tools/javac/generics/bridges/tests/TestNoBridgeInSiblingsSuper.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/tools/javac/generics/bridges/tests/TestNoBridgeInSiblingsSuper.java	Thu Aug 22 15:37:58 2013 +0100
@@ -21,13 +21,14 @@
  * questions.
  */
 class TestNoBridgeInSiblingSuper {
-    interface A { Object m(); }    
+    interface A { Object m(); }
     interface B { String m(); }
     //no bridge here!
     interface C extends A, B { }
-    
+
     @Bridge("m()Ljava/lang/Object;")
     interface D extends C {
         String m();
     }
-}
\ No newline at end of file
+}
+
--- a/test/tools/javac/generics/bridges/tests/TestNoDuplicateBridges01.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/tools/javac/generics/bridges/tests/TestNoDuplicateBridges01.java	Thu Aug 22 15:37:58 2013 +0100
@@ -23,7 +23,7 @@
 class TestNoDuplicateBridges01 {
     interface A1 { Object m(); }
     interface A2 { Object m(); }
-    
+
     @Bridge("m()Ljava/lang/Object;")
     interface B extends A1, A2 { B m(); }
 }
--- a/test/tools/javac/generics/diamond/6939780/T6939780.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/tools/javac/generics/diamond/6939780/T6939780.java	Thu Aug 22 15:37:58 2013 +0100
@@ -1,6 +1,6 @@
 /*
  * @test /nodynamiccopyright/
- * @bug 6939780 7020044 8009459
+ * @bug 6939780 7020044 8009459 8021338
  *
  * @summary  add a warning to detect diamond sites
  * @author mcimadamore
@@ -36,4 +36,15 @@
 
     void gw(Foo<?> fw) { }
     void gn(Foo<Number> fn) { }
+
+    static class Foo2<X> {
+        X copy(X t) {
+            return t;
+        }
+    }
+
+    void testReciever() {
+        Number s = new Foo2<Number>().copy(0);
+    }
+
 }
--- a/test/tools/javac/generics/inference/8020149/T8020149.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/tools/javac/generics/inference/8020149/T8020149.java	Thu Aug 22 15:37:58 2013 +0100
@@ -24,7 +24,7 @@
 /**
  * @test
  * @bug 8020149
- * @summary Graph inference: wrong logic for picking best variable to solve 
+ * @summary Graph inference: wrong logic for picking best variable to solve
  * @compile T8020149.java
  */
 class T8020149 {
@@ -41,7 +41,7 @@
     void test(TestData<Integer, IntFoo> data) {
        m1(data, s->s);
        m2(data, s->s);
-    } 
+    }
 
     <E, E_OUT extends Foo<E, E_OUT>, W, W_IN extends Foo<W, W_IN>> void m1(TestData<W, W_IN> data, Function<W_IN, E_OUT> m) {  }
     <W, W_IN extends Foo<W, W_IN>, E, E_OUT extends Foo<E, E_OUT>> void m2(TestData<W, W_IN> data, Function<W_IN, E_OUT> m) {  }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/jvm/T8020689.java	Thu Aug 22 15:37:58 2013 +0100
@@ -0,0 +1,36 @@
+/*
+ * @test  /nodynamiccopyright/
+ * @bug 8020689
+ * @summary Making sure the LineNumberTable entry is correctly generated for the leading method invocation in the else section
+ * @compile T8020689.java
+ * @run main T8020689
+ */
+
+public class T8020689 {
+
+    public static void main(String... args) {
+        if (args.length > 0) {
+            a();
+        } else {
+            b();
+        }
+    }
+
+    static void a() {
+    }
+
+    static void b() {
+        assertLine(15);
+    }
+
+    public static void assertLine(int expectedline) {
+        Exception e = new Exception("expected line#: " + expectedline);
+        int myline = e.getStackTrace()[2].getLineNumber();
+        if( myline != expectedline) {
+            throw new RuntimeException("Incorrect line number " +
+                    "expected: " + expectedline +
+                    ", got: " + myline, e);
+        }
+        System.out.format("Got expected line number %d correct %n", myline);
+    }
+}
--- a/test/tools/javac/lambda/8016081/T8016081.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/tools/javac/lambda/8016081/T8016081.java	Thu Aug 22 15:37:58 2013 +0100
@@ -29,11 +29,11 @@
  */
 
 class T8016081 {
-    interface fint { int get(); } 
+    interface fint { int get(); }
 
-    @interface atype { 
-        fint fld = ()->( fld == null ?0 : 1); 
-    } 
+    @interface atype {
+        fint fld = ()->( fld == null ?0 : 1);
+    }
 
-    @atype class T {} 
+    @atype class T {}
 }
--- a/test/tools/javac/lambda/8019480/T8019480.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/tools/javac/lambda/8019480/T8019480.java	Thu Aug 22 15:37:58 2013 +0100
@@ -15,7 +15,7 @@
     interface Stream<T> {
        void forEach(Predicate<T> pt);
     }
-    
+
     void test(U current, Stream<U> stream) {
         List<U> list3 = new ArrayList<>();
         stream.forEach(i -> list3.add(current.clone()));
--- a/test/tools/javac/lambda/8020147/T8020147.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/tools/javac/lambda/8020147/T8020147.java	Thu Aug 22 15:37:58 2013 +0100
@@ -5,15 +5,15 @@
  * @compile/fail/ref=T8020147.out -Werror -Xlint:cast -XDrawDiagnostics T8020147.java
  */
 class T8020147 {
-    interface Function<X, Y> { 
-        Y apply(X x); 
+    interface Function<X, Y> {
+        Y apply(X x);
     }
 
-    <T> void g(Function<String, T> f) { } 
-    <U> String m(U u, Function<U, U> fuu) { return null; } 
+    <T> void g(Function<String, T> f) { }
+    <U> String m(U u, Function<U, U> fuu) { return null; }
 
-    void test() { 
-        g(x->m("", i->(String)i)); 
-        g(x->m("", i->(String)x)); 
-    } 
+    void test() {
+        g(x->m("", i->(String)i));
+        g(x->m("", i->(String)x));
+    }
 }
--- a/test/tools/javac/lambda/8020804/T8020804.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/tools/javac/lambda/8020804/T8020804.java	Thu Aug 22 15:37:58 2013 +0100
@@ -39,7 +39,7 @@
     void m(char[] c) { }
 
     <C extends Collection<?>> C g(Supplier<C> sc) { return null; }
-    
+
     void test() {
         m(g(LinkedList<Double>::new));
     }
--- a/test/tools/javac/lambda/8020843/T8020843a.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/tools/javac/lambda/8020843/T8020843a.java	Thu Aug 22 15:37:58 2013 +0100
@@ -1,7 +1,7 @@
 /*
  * @test /nodynamiccopyright/
  * @bug 8020843
- * @summary javac crashes on accessibility check with method reference with typevar receiver 
+ * @summary javac crashes on accessibility check with method reference with typevar receiver
  * @compile/fail/ref=T8020843a.out -XDrawDiagnostics T8020843a.java
  */
 
@@ -9,7 +9,7 @@
     interface Function<X, Y> {
         Y m(X x);
     }
-    
+
     <T> void test(T t) {
         Function<T, Object> ss = T::clone;
     }
--- a/test/tools/javac/lambda/8020843/T8020843b.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/tools/javac/lambda/8020843/T8020843b.java	Thu Aug 22 15:37:58 2013 +0100
@@ -1,7 +1,7 @@
 /*
  * @test /nodynamiccopyright/
  * @bug 8020843
- * @summary javac crashes on accessibility check with method reference with typevar receiver 
+ * @summary javac crashes on accessibility check with method reference with typevar receiver
  * @compile/fail/ref=T8020843b.out -XDrawDiagnostics T8020843b.java
  */
 
@@ -9,17 +9,17 @@
     interface Function<X, Y> {
         Y m(X x);
     }
-    
+
     interface BiFunction<X, Y, Z> {
         Z m(X x, Y y);
     }
-    
+
     Object m(int i) { return null; }
     static Object m(String t) { return null; }
-    
+
     Object m2(int i) { return null; }
     static Object m2(long t) { return null; }
-    
+
     static void test() {
         Function<T8020843b, Object> f1 = T8020843b::m; //show bound case diag
         BiFunction<T8020843b, String, Object> f2 = T8020843b::m2; //show unbound case diag
--- a/test/tools/javac/lambda/LambdaConv01.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/tools/javac/lambda/LambdaConv01.java	Thu Aug 22 15:37:58 2013 +0100
@@ -67,7 +67,7 @@
         assertTrue(3 == f1.foo());
         //Covariant returns:
         TU<Number, Integer> f2 = (Integer x) -> x;
-        assertTrue(3 == f2.foo(3));
+        assertTrue(3 == f2.foo(3).intValue());
         //Method resolution with boxing:
         int res = LambdaConv01.<Integer,Integer>exec((Integer x) -> x, 3);
         assertTrue(3 == res);
@@ -86,7 +86,7 @@
         assertTrue(3 == f1.foo());
         //Covariant returns:
         TU<Number, Integer> f2 = (Integer x) -> x;
-        assertTrue(3 == f2.foo(3));
+        assertTrue(3 == f2.foo(3).intValue());
         //Method resolution with boxing:
         int res = LambdaConv01.<Integer,Integer>exec((Integer x) -> x, 3);
         assertTrue(3 == res);
@@ -105,7 +105,7 @@
         assertTrue(3 == f1.foo());
         //Covariant returns:
         TU<Number, Integer> f2 = (Integer x) -> x;
-        assertTrue(3 == f2.foo(3));
+        assertTrue(3 == f2.foo(3).intValue());
         //Method resolution with boxing:
         int res = LambdaConv01.<Integer,Integer>exec((Integer x) -> x, 3);
         assertTrue(3 == res);
@@ -124,7 +124,7 @@
         assertTrue(3 == f1.foo());
         //Covariant returns:
         TU<Number, Integer> f2 = (Integer x) -> x;
-        assertTrue(3 == f2.foo(3));
+        assertTrue(3 == f2.foo(3).intValue());
         //Method resolution with boxing:
         int res = LambdaConv01.<Integer,Integer>exec((Integer x) -> x, 3);
         assertTrue(3 == res);
--- a/test/tools/javac/lambda/LambdaExpr15.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/tools/javac/lambda/LambdaExpr15.java	Thu Aug 22 15:37:58 2013 +0100
@@ -48,7 +48,7 @@
             new Object() {
                 String get() { return ""; }
             };
-            assertTrue(t == 1);
+            assertTrue((Integer)t == 1);
         };
         ba1.apply(1);
 
@@ -58,7 +58,7 @@
                 String get() { return ""; }
             };
             new A();
-            assertTrue(t == 2);
+            assertTrue((Integer)t == 2);
         };
         ba2.apply(2);
         assertTrue(assertionCount == 2);
--- a/test/tools/javac/lambda/MethodReference70.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/tools/javac/lambda/MethodReference70.java	Thu Aug 22 15:37:58 2013 +0100
@@ -8,13 +8,13 @@
     interface F<X> {
         void m(X x);
     }
-    
+
     interface G<X> {
         Integer m(X x);
     }
-    
+
     void m1(Integer i) { }
-    
+
     void m2(Integer i) { }
     void m2(String i) { }
 
--- a/test/tools/javac/lambda/MethodReference71.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/tools/javac/lambda/MethodReference71.java	Thu Aug 22 15:37:58 2013 +0100
@@ -8,11 +8,11 @@
     interface F<X> {
         void m(X x);
     }
-    
+
     interface G<X> {
         Integer m(X x);
     }
-    
+
     void m1(Integer i) { }
     void m2(Integer... i) { }
 
--- a/test/tools/javac/lambda/MethodReference72.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/tools/javac/lambda/MethodReference72.java	Thu Aug 22 15:37:58 2013 +0100
@@ -9,7 +9,7 @@
         @SuppressWarnings("unchecked")
         void m(X... x);
     }
-    
+
     void m1(Integer i) { }
 
     <Z> void g(F<Z> f) { }
--- a/test/tools/javac/lambda/MethodReference72.out	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/tools/javac/lambda/MethodReference72.out	Thu Aug 22 15:37:58 2013 +0100
@@ -1,2 +1,2 @@
-MethodReference72.java:18:9: compiler.err.cant.apply.symbol: kindname.method, g, MethodReference72.F<Z>, @424, kindname.class, MethodReference72, (compiler.misc.infer.no.conforming.assignment.exists: Z, (compiler.misc.invalid.mref: kindname.method, (compiler.misc.cant.apply.symbol: kindname.method, m1, java.lang.Integer, Z[], kindname.class, MethodReference72, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inconvertible.types: Z[], java.lang.Integer)))))
+MethodReference72.java:18:9: compiler.err.cant.apply.symbol: kindname.method, g, MethodReference72.F<Z>, @420, kindname.class, MethodReference72, (compiler.misc.infer.no.conforming.assignment.exists: Z, (compiler.misc.invalid.mref: kindname.method, (compiler.misc.cant.apply.symbol: kindname.method, m1, java.lang.Integer, Z[], kindname.class, MethodReference72, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inconvertible.types: Z[], java.lang.Integer)))))
 1 error
--- a/test/tools/javac/lambda/NestedCapture01.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/tools/javac/lambda/NestedCapture01.java	Thu Aug 22 15:37:58 2013 +0100
@@ -32,7 +32,7 @@
     void test(String s) {
        g(m(s.getClass()));
     }
-    
+
     <F extends String> F m(Class<F> cf) {
        return null;
     }
--- a/test/tools/javac/lambda/NestedCapture02.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/tools/javac/lambda/NestedCapture02.java	Thu Aug 22 15:37:58 2013 +0100
@@ -35,7 +35,7 @@
      }
 
      <U> NestedCapture02<S, ? extends U> cast(Class<U> target) { return null; }
-     
+
      <U> NestedCapture02<S, ? extends U> test(Class<U> target,
              NestedCapture02<? super S, ?> first, NestedCapture02<? super S, T> second) {
         return create(first, second.cast(target));
--- a/test/tools/javac/lambda/TargetType36.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/tools/javac/lambda/TargetType36.java	Thu Aug 22 15:37:58 2013 +0100
@@ -23,11 +23,10 @@
 
 /*
  * @test
- * @ignore 8013404: Test awaits spec clarification
- * @bug 8003280
+ * @bug 8003280 8013404
  * @summary Add lambda tests
- *  check that target type of cast is propagated to conditional subexpressions
- * @compile TargetType36.java
+ *  check that target type of cast is not propagated to conditional subexpressions
+ * @compile/fail/ref=TargetType36.out -XDrawDiagnostics TargetType36.java
  */
 class TargetType36 { //awaits spec wording on cast vs. poly
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/lambda/TargetType36.out	Thu Aug 22 15:37:58 2013 +0100
@@ -0,0 +1,3 @@
+TargetType36.java:40:30: compiler.err.unexpected.lambda
+TargetType36.java:40:43: compiler.err.unexpected.lambda
+2 errors
--- a/test/tools/javac/lambda/TargetType63.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/tools/javac/lambda/TargetType63.java	Thu Aug 22 15:37:58 2013 +0100
@@ -8,31 +8,31 @@
     interface F<T extends Throwable> {
         void m() throws T;
     }
-    
+
     void g1() { }
     void g2() throws ClassNotFoundException { }
     void g3() throws Exception { }
-    
+
     <Z extends Throwable> void m1(F<Z> fz) throws Z { }
     <Z extends ClassNotFoundException> void m2(F<Z> fz) throws Z { }
-    
+
     void test1() {
         m1(()->{ }); //ok (Z = RuntimeException)
         m1(this::g1); //ok (Z = RuntimeException)
     }
-    
+
     void test2() {
         m2(()->{ }); //fail (Z = ClassNotFoundException)
         m2(this::g1); //fail (Z = ClassNotFoundException)
     }
-    
+
     void test3() {
         m1(()->{ throw new ClassNotFoundException(); }); //fail (Z = ClassNotFoundException)
         m1(this::g2); //fail (Z = ClassNotFoundException)
         m2(()->{ throw new ClassNotFoundException(); }); //fail (Z = ClassNotFoundException)
         m2(this::g2); //fail (Z = ClassNotFoundException)
     }
-    
+
     void test4() {
         m1(()->{ throw new Exception(); }); //fail (Z = Exception)
         m1(this::g3); //fail (Z = Exception)
--- a/test/tools/javac/lambda/TargetType76.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/tools/javac/lambda/TargetType76.java	Thu Aug 22 15:37:58 2013 +0100
@@ -49,7 +49,7 @@
         Spliterator<X> spliterator();
     }
 
-    class RefTestData<T, I> implements OfRef<T> { 
+    class RefTestData<T, I> implements OfRef<T> {
         RefTestData(I state,
                     Function<I, Stream<T>> streamFn,
                     Function<I, Spliterator<T>> splitrFn) { }
--- a/test/tools/javac/lambda/bridge/TestMetafactoryBridges.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/tools/javac/lambda/bridge/TestMetafactoryBridges.java	Thu Aug 22 15:37:58 2013 +0100
@@ -58,7 +58,7 @@
         A7(7, ClassKind.A),
         B8(8, ClassKind.B),
         A8(8, ClassKind.A);
-        
+
         int version;
         ClassKind ck;
 
@@ -71,18 +71,18 @@
             this.ck = ck;
         }
     }
-    
+
     enum PreferPolicy {
         SOURCE("-Xprefer:source"),
         NEWER("-Xprefer:newer");
-        
+
         String preferOpt;
 
         PreferPolicy(String preferOpt) {
             this.preferOpt = preferOpt;
         }
     }
-    
+
     enum SourcepathKind {
         NONE,
         A(ClassKind.A),
@@ -92,7 +92,7 @@
         BC(ClassKind.B, ClassKind.C),
         AC(ClassKind.A, ClassKind.C),
         ABC(ClassKind.A, ClassKind.B, ClassKind.C);
-        
+
         List<ClassKind> sources;
 
         SourcepathKind(ClassKind... sources) {
@@ -129,15 +129,15 @@
                 return Arrays.asList(Arrays.asList(ClassKind.C));
             }
         };
-        
+
         abstract List<List<ClassKind>> permutations();
     }
-    
+
     enum ClassKind {
         A("A", "interface A { Object m(); }"),
         B("B", "interface B extends A { Integer m(); }", A),
         C("C", "class C { B b = ()->42; }", A, B);
-        
+
         String name;
         String source;
         ClassKind[] deps;
@@ -200,7 +200,7 @@
     }
 
     class JavaSource extends SimpleJavaFileObject {
-        
+
         final String source;
 
         public JavaSource(ClassKind ck) {
@@ -221,13 +221,13 @@
         classesDir.mkdir();
         outDir.mkdir();
         srcDir.mkdir();
-        
+
         debugWriter.append(testDir.getName() + "\n");
         debugWriter.append("sources = " + sources + "\n");
         debugWriter.append("spKind = " + spKind  + "\n");
         debugWriter.append("cpKind = " + cpKind + "\n");
         debugWriter.append("preferPolicy = " + pp.preferOpt + "\n");
-        
+
         //step 1 - prepare sources (older!!)
         debugWriter.append("Preparing sources\n");
         for (ClassKind ck : spKind.sources) {
@@ -240,7 +240,7 @@
                 pw.close();
             }
         }
-        
+
         //step 2 - prepare classes
         debugWriter.append("Preparing classes\n");
         if (cpKind != ClasspathKind.NONE) {
@@ -251,7 +251,7 @@
                 //at most only one dependency
                 toRemove = cpKind.ck.deps[0];
                 sources.add(new JavaSource(toRemove));
-            }       
+            }
             JavacTask ct = (JavacTask)tool.getTask(debugWriter, null, null,
                     Arrays.asList("-d", classesDir.getAbsolutePath(), "-source", String.valueOf(cpKind.version)), null, sources);
             try {
@@ -265,7 +265,7 @@
                 throw new AssertionError("Error thrown when generating side-classes");
             }
         }
-        
+
         //step 3 - compile
         debugWriter.append("Compiling test\n");
         List<JavaSource> sourcefiles = new ArrayList<>();
@@ -290,12 +290,12 @@
         if (diagChecker.errorFound) {
             throw new AssertionError("Unexpected compilation failure");
         }
-        
+
         boolean altMetafactory =
                 cpKind == ClasspathKind.B7 &&
                 !sources.contains(ClassKind.B) &&
                 (pp == PreferPolicy.NEWER || !spKind.sources.contains(ClassKind.B));
-        
+
         if (altMetafactory != diagChecker.altMetafactory) {
             throw new AssertionError("Bad metafactory detected - expected altMetafactory: " + altMetafactory +
                     "\ntest: " + testDir);
@@ -314,7 +314,7 @@
                 statProcessor.process(diagnostic);
             }
         }
-        
+
         abstract class DiagnosticProcessor {
 
             List<String> codes;
@@ -342,7 +342,7 @@
                 }
             }
         }
-        
+
         DiagnosticProcessor statProcessor = new DiagnosticProcessor(Kind.NOTE,
                 "compiler.note.lambda.stat",
                 "compiler.note.mref.stat",
--- a/test/tools/javac/lambda/typeInference/InferenceTest2b.java	Thu Aug 22 13:51:34 2013 +0100
+++ b/test/tools/javac/lambda/typeInference/InferenceTest2b.java	Thu Aug 22 15:37:58 2013 +0100
@@ -64,7 +64,7 @@
 
     void m2(SAM6<? super Integer> s) {
         System.out.println("m2()");
-        assertTrue(s.m6(1, 2) == 1);
+        assertTrue(s.m6(1, 2).equals(Integer.valueOf(1)));
     }
 
     void m3(SAM6<? super Calendar> s) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/limits/NestedClassConstructorArgs.java	Thu Aug 22 15:37:58 2013 +0100
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8014230
+ * @summary Compiler silently generates bytecode that exceeds VM limits
+ * @compile NumArgsTest.java
+ * @run main NestedClassConstructorArgs
+ */
+
+public class NestedClassConstructorArgs extends NumArgsTest {
+    private static final NumArgsTest.NestingDef[] nesting = {
+        classNesting("Inner")
+    };
+
+    private NestedClassConstructorArgs() {
+        super(253, "NestedClassConstructorArgs", "Inner", nesting);
+    }
+
+    public static void main(String... args) throws Exception {
+        new NestedClassConstructorArgs().runTest();
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/limits/NestedClassMethodArgs.java	Thu Aug 22 15:37:58 2013 +0100
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8014230
+ * @summary Compiler silently generates bytecode that exceeds VM limits
+ * @compile NumArgsTest.java
+ * @run main NestedClassMethodArgs
+ */
+
+public class NestedClassMethodArgs extends NumArgsTest {
+    private static final NumArgsTest.NestingDef[] nesting = {
+        classNesting("Inner")
+    };
+
+    private NestedClassMethodArgs() {
+        super(254, "void", "test", "NestedClassMethodArgs", nesting);
+    }
+
+    public static void main(String... args) throws Exception {
+        new NestedClassMethodArgs().runTest();
+    }
+}
+
--- a/test/tools/javac/limits/NumArgs1.java	Thu Aug 22 13:51:34 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,552 +0,0 @@
-/*
- * Copyright (c) 2002, 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 4309152
- * @summary Compiler silently generates bytecode that exceeds VM limits
- * @author gafter
- *
- * @compile/fail NumArgs1.java
- */
-
-class NumArgs1 {
-    void f(
-           // T1 this,
-           int x2,
-           int x3,
-           int x4,
-           int x5,
-           int x6,
-           int x7,
-           int x8,
-           int x9,
-           int x10,
-           int x11,
-           int x12,
-           int x13,
-           int x14,
-           int x15,
-           int x16,
-           int x17,
-           int x18,
-           int x19,
-           int x20,
-           int x21,
-           int x22,
-           int x23,
-           int x24,
-           int x25,
-           int x26,
-           int x27,
-           int x28,
-           int x29,
-           int x30,
-           int x31,
-           int x32,
-           int x33,
-           int x34,
-           int x35,
-           int x36,
-           int x37,
-           int x38,
-           int x39,
-           int x40,
-           int x41,
-           int x42,
-           int x43,
-           int x44,
-           int x45,
-           int x46,
-           int x47,
-           int x48,
-           int x49,
-           int x50,
-           int x51,
-           int x52,
-           int x53,
-           int x54,
-           int x55,
-           int x56,
-           int x57,
-           int x58,
-           int x59,
-           int x60,
-           int x61,
-           int x62,
-           int x63,
-           int x64,
-           int x65,
-           int x66,
-           int x67,
-           int x68,
-           int x69,
-           int x70,
-           int x71,
-           int x72,
-           int x73,
-           int x74,
-           int x75,
-           int x76,
-           int x77,
-           int x78,
-           int x79,
-           int x80,
-           int x81,
-           int x82,
-           int x83,
-           int x84,
-           int x85,
-           int x86,
-           int x87,
-           int x88,
-           int x89,
-           int x90,
-           int x91,
-           int x92,
-           int x93,
-           int x94,
-           int x95,
-           int x96,
-           int x97,
-           int x98,
-           int x99,
-           int x100,
-           int x101,
-           int x102,
-           int x103,
-           int x104,
-           int x105,
-           int x106,
-           int x107,
-           int x108,
-           int x109,
-           int x110,
-           int x111,
-           int x112,
-           int x113,
-           int x114,
-           int x115,
-           int x116,
-           int x117,
-           int x118,
-           int x119,
-           int x120,
-           int x121,
-           int x122,
-           int x123,
-           int x124,
-           int x125,
-           int x126,
-           int x127,
-           int x128,
-           int x129,
-           int x130,
-           int x131,
-           int x132,
-           int x133,
-           int x134,
-           int x135,
-           int x136,
-           int x137,
-           int x138,
-           int x139,
-           int x140,
-           int x141,
-           int x142,
-           int x143,
-           int x144,
-           int x145,
-           int x146,
-           int x147,
-           int x148,
-           int x149,
-           int x150,
-           int x151,
-           int x152,
-           int x153,
-           int x154,
-           int x155,
-           int x156,
-           int x157,
-           int x158,
-           int x159,
-           int x160,
-           int x161,
-           int x162,
-           int x163,
-           int x164,
-           int x165,
-           int x166,
-           int x167,
-           int x168,
-           int x169,
-           int x170,
-           int x171,
-           int x172,
-           int x173,
-           int x174,
-           int x175,
-           int x176,
-           int x177,
-           int x178,
-           int x179,
-           int x180,
-           int x181,
-           int x182,
-           int x183,
-           int x184,
-           int x185,
-           int x186,
-           int x187,
-           int x188,
-           int x189,
-           int x190,
-           int x191,
-           int x192,
-           int x193,
-           int x194,
-           int x195,
-           int x196,
-           int x197,
-           int x198,
-           int x199,
-           int x200,
-           int x201,
-           int x202,
-           int x203,
-           int x204,
-           int x205,
-           int x206,
-           int x207,
-           int x208,
-           int x209,
-           int x210,
-           int x211,
-           int x212,
-           int x213,
-           int x214,
-           int x215,
-           int x216,
-           int x217,
-           int x218,
-           int x219,
-           int x220,
-           int x221,
-           int x222,
-           int x223,
-           int x224,
-           int x225,
-           int x226,
-           int x227,
-           int x228,
-           int x229,
-           int x230,
-           int x231,
-           int x232,
-           int x233,
-           int x234,
-           int x235,
-           int x236,
-           int x237,
-           int x238,
-           int x239,
-           int x240,
-           int x241,
-           int x242,
-           int x243,
-           int x244,
-           int x245,
-           int x246,
-           int x247,
-           int x248,
-           int x249,
-           int x250,
-           int x251,
-           int x252,
-           int x253,
-           int x254,
-           int x255,
-           int x256
-    ) {}
-
-    static
-    void g(
-           int x1,
-           int x2,
-           int x3,
-           int x4,
-           int x5,
-           int x6,
-           int x7,
-           int x8,
-           int x9,
-           int x10,
-           int x11,
-           int x12,
-           int x13,
-           int x14,
-           int x15,
-           int x16,
-           int x17,
-           int x18,
-           int x19,
-           int x20,
-           int x21,
-           int x22,
-           int x23,
-           int x24,
-           int x25,
-           int x26,
-           int x27,
-           int x28,
-           int x29,
-           int x30,
-           int x31,
-           int x32,
-           int x33,
-           int x34,
-           int x35,
-           int x36,
-           int x37,
-           int x38,
-           int x39,
-           int x40,
-           int x41,
-           int x42,
-           int x43,
-           int x44,
-           int x45,
-           int x46,
-           int x47,
-           int x48,
-           int x49,
-           int x50,
-           int x51,
-           int x52,
-           int x53,
-           int x54,
-           int x55,
-           int x56,
-           int x57,
-           int x58,
-           int x59,
-           int x60,
-           int x61,
-           int x62,
-           int x63,
-           int x64,
-           int x65,
-           int x66,
-           int x67,
-           int x68,
-           int x69,
-           int x70,
-           int x71,
-           int x72,
-           int x73,
-           int x74,
-           int x75,
-           int x76,
-           int x77,
-           int x78,
-           int x79,
-           int x80,
-           int x81,
-           int x82,
-           int x83,
-           int x84,
-           int x85,
-           int x86,
-           int x87,
-           int x88,
-           int x89,
-           int x90,
-           int x91,
-           int x92,
-           int x93,
-           int x94,
-           int x95,
-           int x96,
-           int x97,
-           int x98,
-           int x99,
-           int x100,
-           int x101,
-           int x102,
-           int x103,
-           int x104,
-           int x105,
-           int x106,
-           int x107,
-           int x108,
-           int x109,
-           int x110,
-           int x111,
-           int x112,
-           int x113,
-           int x114,
-           int x115,
-           int x116,
-           int x117,
-           int x118,
-           int x119,
-           int x120,
-           int x121,
-           int x122,
-           int x123,
-           int x124,
-           int x125,
-           int x126,
-           int x127,
-           int x128,
-           int x129,
-           int x130,
-           int x131,
-           int x132,
-           int x133,
-           int x134,
-           int x135,
-           int x136,
-           int x137,
-           int x138,
-           int x139,
-           int x140,
-           int x141,
-           int x142,