Merge
authorduke
Wed, 05 Jul 2017 21:25:29 +0200
changeset 36279 a090823529e7
parent 36278 f74f056dc069 (diff)
parent 36265 41c718ab0725 (current diff)
child 36280 c870cb782aca
Merge
jdk/src/java.base/share/classes/sun/misc/Version.java.template
jdk/src/java.base/share/native/libjava/Version.c
jdk/test/java/lang/invoke/T8139885.java
jdk/test/sun/misc/Version/Version.java
--- a/langtools/.hgtags	Wed Jul 05 21:25:20 2017 +0200
+++ b/langtools/.hgtags	Wed Jul 05 21:25:29 2017 +0200
@@ -350,3 +350,4 @@
 81bd82222f8a1f2b291a44a49e063973caa4e73b jdk-9+105
 dd05d3761a341143ef4a6b1a245e0960cc125b76 jdk-9+106
 7a0c343551497bd0e38ad69a77cc57d9f396615a jdk-9+107
+fd18a155ad22f62e06a9b74850ab8609d415c752 jdk-9+108
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java	Wed Jul 05 21:25:20 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java	Wed Jul 05 21:25:29 2017 +0200
@@ -2001,10 +2001,11 @@
             }
         }
 
+        final boolean explicitOverride = m.attribute(syms.overrideType.tsym) != null;
         // Check if this method must override a super method due to being annotated with @Override
         // or by virtue of being a member of a diamond inferred anonymous class. Latter case is to
         // be treated "as if as they were annotated" with @Override.
-        boolean mustOverride = m.attribute(syms.overrideType.tsym) != null ||
+        boolean mustOverride = explicitOverride ||
                 (env.info.isAnonymousDiamond && !m.isConstructor() && !m.isPrivate());
         if (mustOverride && !isOverrider(m)) {
             DiagnosticPosition pos = tree.pos();
@@ -2014,7 +2015,9 @@
                     break;
                 }
             }
-            log.error(pos, "method.does.not.override.superclass");
+            log.error(pos,
+                      explicitOverride ? Errors.MethodDoesNotOverrideSuperclass :
+                                Errors.AnonymousDiamondMethodDoesNotOverrideSuperclass(Fragments.DiamondAnonymousMethodsImplicitlyOverride));
         }
     }
 
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java	Wed Jul 05 21:25:20 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java	Wed Jul 05 21:25:29 2017 +0200
@@ -4043,7 +4043,12 @@
                         found = false;
                         break;
                     }
-                    allThrown = chk.intersect(allThrown, mt2.getThrownTypes());
+                    List<Type> thrownTypes2 = mt2.getThrownTypes();
+                    if (mt.hasTag(FORALL) && mt2.hasTag(FORALL)) {
+                        // if both are generic methods, adjust thrown types ahead of intersection computation
+                        thrownTypes2 = types.subst(thrownTypes2, mt2.getTypeArguments(), mt.getTypeArguments());
+                    }
+                    allThrown = chk.intersect(allThrown, thrownTypes2);
                 }
                 if (found) {
                     //all ambiguous methods were abstract and one method had
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java	Wed Jul 05 21:25:20 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java	Wed Jul 05 21:25:29 2017 +0200
@@ -80,6 +80,11 @@
      */
     private final Type methodType;
 
+    /**
+     * Are we presently traversing a let expression ? Yes if depth != 0
+     */
+    private int letExprDepth;
+
     public static Gen instance(Context context) {
         Gen instance = context.get(genKey);
         if (instance == null)
@@ -1006,8 +1011,10 @@
         if (tree.init != null) {
             checkStringConstant(tree.init.pos(), v.getConstValue());
             if (v.getConstValue() == null || varDebugInfo) {
+                Assert.check(letExprDepth != 0 || code.state.stacksize == 0);
                 genExpr(tree.init, v.erasure(types)).load();
                 items.makeLocalItem(v).store();
+                Assert.check(letExprDepth != 0 || code.state.stacksize == 0);
             }
         }
         checkDimension(tree.pos(), v.type);
@@ -1062,12 +1069,14 @@
                 CondItem c;
                 if (cond != null) {
                     code.statBegin(cond.pos);
+                    Assert.check(code.state.stacksize == 0);
                     c = genCond(TreeInfo.skipParens(cond), CRT_FLOW_CONTROLLER);
                 } else {
                     c = items.makeCondItem(goto_);
                 }
                 Chain loopDone = c.jumpFalse();
                 code.resolve(c.trueJumps);
+                Assert.check(code.state.stacksize == 0);
                 genStat(body, loopEnv, CRT_STATEMENT | CRT_FLOW_TARGET);
                 code.resolve(loopEnv.info.cont);
                 genStats(step, loopEnv);
@@ -1080,11 +1089,13 @@
                 CondItem c;
                 if (cond != null) {
                     code.statBegin(cond.pos);
+                    Assert.check(code.state.stacksize == 0);
                     c = genCond(TreeInfo.skipParens(cond), CRT_FLOW_CONTROLLER);
                 } else {
                     c = items.makeCondItem(goto_);
                 }
                 code.resolve(c.jumpTrue(), startpc);
+                Assert.check(code.state.stacksize == 0);
                 code.resolve(c.falseJumps);
             }
             Chain exit = loopEnv.info.exit;
@@ -1112,6 +1123,7 @@
         int limit = code.nextreg;
         Assert.check(!tree.selector.type.hasTag(CLASS));
         int startpcCrt = genCrt ? code.curCP() : 0;
+        Assert.check(code.state.stacksize == 0);
         Item sel = genExpr(tree.selector, syms.intType);
         List<JCCase> cases = tree.cases;
         if (cases.isEmpty()) {
@@ -1280,6 +1292,7 @@
         int limit = code.nextreg;
         // Generate code to evaluate lock and save in temporary variable.
         final LocalItem lockVar = makeTemp(syms.objectType);
+        Assert.check(code.state.stacksize == 0);
         genExpr(tree.lock, tree.lock.type).load().duplicate();
         lockVar.store();
 
@@ -1526,9 +1539,11 @@
     public void visitIf(JCIf tree) {
         int limit = code.nextreg;
         Chain thenExit = null;
+        Assert.check(code.state.stacksize == 0);
         CondItem c = genCond(TreeInfo.skipParens(tree.cond),
                              CRT_FLOW_CONTROLLER);
         Chain elseChain = c.jumpFalse();
+        Assert.check(code.state.stacksize == 0);
         if (!c.isFalse()) {
             code.resolve(c.trueJumps);
             genStat(tree.thenpart, env, CRT_STATEMENT | CRT_FLOW_TARGET);
@@ -1542,6 +1557,7 @@
         }
         code.resolve(thenExit);
         code.endScopes(limit);
+        Assert.check(code.state.stacksize == 0);
     }
 
     public void visitExec(JCExpressionStatement tree) {
@@ -1555,7 +1571,9 @@
                 ((JCUnary) e).setTag(PREDEC);
                 break;
         }
+        Assert.check(code.state.stacksize == 0);
         genExpr(tree.expr, tree.expr.type).drop();
+        Assert.check(code.state.stacksize == 0);
     }
 
     public void visitBreak(JCBreak tree) {
@@ -1581,6 +1599,7 @@
          */
         int tmpPos = code.pendingStatPos;
         if (tree.expr != null) {
+            Assert.check(code.state.stacksize == 0);
             Item r = genExpr(tree.expr, pt).load();
             if (hasFinally(env.enclMethod, env)) {
                 r = makeTemp(pt);
@@ -1600,8 +1619,10 @@
     }
 
     public void visitThrow(JCThrow tree) {
+        Assert.check(code.state.stacksize == 0);
         genExpr(tree.expr, tree.expr.type).load();
         code.emitop0(athrow);
+        Assert.check(code.state.stacksize == 0);
     }
 
 /* ************************************************************************
@@ -2101,10 +2122,12 @@
     }
 
     public void visitLetExpr(LetExpr tree) {
+        letExprDepth++;
         int limit = code.nextreg;
         genStats(tree.defs, env);
         result = genExpr(tree.expr, tree.expr.type).load();
         code.endScopes(limit);
+        letExprDepth--;
     }
 
     private void generateReferencesToPrunedTree(ClassSymbol classSymbol, Pool pool) {
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties	Wed Jul 05 21:25:20 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties	Wed Jul 05 21:25:29 2017 +0200
@@ -214,6 +214,11 @@
     Unexpected @FunctionalInterface annotation\n\
     {0}
 
+# 0: message segment
+compiler.err.anonymous.diamond.method.does.not.override.superclass=\
+    method does not override or implement a method from a supertype\n\
+    {0}
+
 # 0: symbol
 compiler.misc.not.a.functional.intf=\
     {0} is not a functional interface
@@ -1196,6 +1201,9 @@
 ## miscellaneous strings
 ##
 
+compiler.misc.diamond.anonymous.methods.implicitly.override=\
+    (due to <>, every non-private method declared in this anonymous class must override or implement a method from a supertype)
+
 compiler.misc.source.unavailable=\
     (source unavailable)
 
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DocTreeMaker.java	Wed Jul 05 21:25:20 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DocTreeMaker.java	Wed Jul 05 21:25:29 2017 +0200
@@ -50,6 +50,7 @@
 import com.sun.tools.javac.parser.ParserFactory;
 import com.sun.tools.javac.parser.ReferenceParser;
 import com.sun.tools.javac.parser.Tokens.Comment;
+import com.sun.tools.javac.parser.Tokens.Comment.CommentStyle;
 import com.sun.tools.javac.tree.DCTree.DCAttribute;
 import com.sun.tools.javac.tree.DCTree.DCAuthor;
 import com.sun.tools.javac.tree.DCTree.DCComment;
@@ -206,7 +207,31 @@
         lb.addAll(cast(firstSentence));
         lb.addAll(cast(body));
         List<DCTree> fullBody = lb.toList();
-        DCDocComment tree = new DCDocComment(null, fullBody, cast(firstSentence), cast(body), cast(tags));
+
+        // A dummy comment to keep the diagnostics logic happy.
+        Comment c = new Comment() {
+            @Override
+            public String getText() {
+                return null;
+            }
+
+            @Override
+            public int getSourcePos(int index) {
+                return Position.NOPOS;
+            }
+
+            @Override
+            public CommentStyle getStyle() {
+                return CommentStyle.JAVADOC;
+            }
+
+            @Override
+            public boolean isDeprecated() {
+                return false;
+            }
+        };
+
+        DCDocComment tree = new DCDocComment(c, fullBody, cast(firstSentence), cast(body), cast(tags));
         return tree;
     }
 
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/comp/SjavacImpl.java	Wed Jul 05 21:25:20 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/comp/SjavacImpl.java	Wed Jul 05 21:25:29 2017 +0200
@@ -28,7 +28,6 @@
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.io.StringWriter;
-import java.io.Writer;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.util.ArrayList;
@@ -81,6 +80,10 @@
         if (!validateOptions(options))
             return RC_FATAL;
 
+        if (srcDstOverlap(options.getSources(), options.getDestDir())) {
+            return RC_FATAL;
+        }
+
         if (!createIfMissing(options.getDestDir()))
             return RC_FATAL;
 
@@ -330,6 +333,22 @@
 
     }
 
+    private static boolean srcDstOverlap(List<SourceLocation> locs, Path dest) {
+        for (SourceLocation loc : locs) {
+            if (isOverlapping(loc.getPath(), dest)) {
+                Log.error("Source location " + loc.getPath() + " overlaps with destination " + dest);
+                return true;
+            }
+        }
+        return false;
+    }
+
+    private static boolean isOverlapping(Path p1, Path p2) {
+        p1 = p1.toAbsolutePath().normalize();
+        p2 = p2.toAbsolutePath().normalize();
+        return p1.startsWith(p2) || p2.startsWith(p1);
+    }
+
     private static boolean createIfMissing(Path dir) {
 
         if (Files.isDirectory(dir))
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/FrameOutputWriter.java	Wed Jul 05 21:25:20 2017 +0200
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/FrameOutputWriter.java	Wed Jul 05 21:25:29 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2016, 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
@@ -96,6 +96,7 @@
     protected void generateFrameFile() throws IOException {
         Content frame = getFrameDetails();
         HtmlTree body = new HtmlTree(HtmlTag.BODY);
+        body.addAttr(HtmlAttr.ONLOAD, "loadFrames()");
         if (configuration.allowTag(HtmlTag.MAIN)) {
             HtmlTree main = HtmlTree.MAIN(frame);
             body.addContent(main);
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java	Wed Jul 05 21:25:20 2017 +0200
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java	Wed Jul 05 21:25:29 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2016, 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
@@ -423,6 +423,10 @@
                 "            }" + DocletConstants.NL +
                 "        }" + DocletConstants.NL +
                 "        return true;" + DocletConstants.NL +
+                "    }" + DocletConstants.NL +
+                "    function loadFrames() {" + DocletConstants.NL +
+                "        if (targetPage != \"\" && targetPage != \"undefined\")" + DocletConstants.NL +
+                "             top.classFrame.location = top.targetPage;" + DocletConstants.NL +
                 "    }" + DocletConstants.NL;
         RawHtml scriptContent = new RawHtml(scriptCode);
         script.addContent(scriptContent);
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java	Wed Jul 05 21:25:20 2017 +0200
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java	Wed Jul 05 21:25:29 2017 +0200
@@ -196,8 +196,12 @@
         div.addStyle(HtmlStyle.header);
         PackageElement pkg = utils.containingPackage(typeElement);
         if (!pkg.isUnnamed()) {
-            Content pkgNameContent = new StringContent(utils.getPackageName(pkg));
-            Content pkgNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, pkgNameContent);
+            Content classPackageLabel = HtmlTree.SPAN(HtmlStyle.packageLabelInClass, packageLabel);
+            Content pkgNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, classPackageLabel);
+            pkgNameDiv.addContent(getSpace());
+            Content pkgNameContent = getPackageLink(pkg,
+                    new StringContent(pkg.getQualifiedName().toString()));
+            pkgNameDiv.addContent(pkgNameContent);
             div.addContent(pkgNameDiv);
         }
         LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FrameOutputWriter.java	Wed Jul 05 21:25:20 2017 +0200
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FrameOutputWriter.java	Wed Jul 05 21:25:29 2017 +0200
@@ -27,6 +27,7 @@
 
 import java.io.*;
 
+import jdk.javadoc.internal.doclets.formats.html.markup.HtmlAttr;
 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@@ -102,6 +103,7 @@
     protected void generateFrameFile() throws IOException {
         Content frame = getFrameDetails();
         HtmlTree body = new HtmlTree(HtmlTag.BODY);
+        body.addAttr(HtmlAttr.ONLOAD, "loadFrames()");
         if (configuration.allowTag(HtmlTag.MAIN)) {
             HtmlTree main = HtmlTree.MAIN(frame);
             body.addContent(main);
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java	Wed Jul 05 21:25:20 2017 +0200
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java	Wed Jul 05 21:25:29 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2016, 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
@@ -84,6 +84,7 @@
     overrideSpecifyLabel,
     overviewSummary,
     packageHierarchyLabel,
+    packageLabelInClass,
     paramLabel,
     returnLabel,
     rightContainer,
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlWriter.java	Wed Jul 05 21:25:20 2017 +0200
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlWriter.java	Wed Jul 05 21:25:29 2017 +0200
@@ -401,6 +401,10 @@
                 "            }" + DocletConstants.NL +
                 "        }" + DocletConstants.NL +
                 "        return true;" + DocletConstants.NL +
+                "    }" + DocletConstants.NL +
+                "    function loadFrames() {" + DocletConstants.NL +
+                "        if (targetPage != \"\" && targetPage != \"undefined\")" + DocletConstants.NL +
+                "             top.classFrame.location = top.targetPage;" + DocletConstants.NL +
                 "    }" + DocletConstants.NL;
         RawHtml scriptContent = new RawHtml(scriptCode);
         script.addContent(scriptContent);
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css	Wed Jul 05 21:25:20 2017 +0200
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css	Wed Jul 05 21:25:29 2017 +0200
@@ -610,8 +610,9 @@
     color:#474747;
 }
 .deprecatedLabel, .descfrmTypeLabel, .memberNameLabel, .memberNameLink,
-.overrideSpecifyLabel, .packageHierarchyLabel, .paramLabel, .returnLabel,
-.seeLabel, .simpleTagLabel, .throwsLabel, .typeNameLabel, .typeNameLink, .searchTagLink {
+.overrideSpecifyLabel, .packageLabelInClass, .packageHierarchyLabel,
+.paramLabel, .returnLabel, .seeLabel, .simpleTagLabel, .throwsLabel,
+.typeNameLabel, .typeNameLink, .searchTagLink {
     font-weight:bold;
 }
 .deprecationComment, .emphasizedPhrase, .interfaceName {
--- a/langtools/test/com/sun/javadoc/testHtmlVersion/TestHtmlVersion.java	Wed Jul 05 21:25:20 2017 +0200
+++ b/langtools/test/com/sun/javadoc/testHtmlVersion/TestHtmlVersion.java	Wed Jul 05 21:25:29 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, 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 8072945 8081854 8141492
+ * @bug 8072945 8081854 8141492 8148985
  * @summary Test the version of HTML generated by the javadoc tool.
  * @author bpatel
  * @library ../lib
@@ -688,7 +688,7 @@
         checkOutput("index.html", true,
                 "<!DOCTYPE HTML>",
                 "<link rel=\"stylesheet\" type=\"text/css\" href=\"stylesheet.css\" title=\"Style\">",
-                "<body>\n"
+                "<body onload=\"loadFrames()\">\n"
                 + "<main role=\"main\">\n"
                 + "<div class=\"mainContainer\">\n"
                 + "<div class=\"leftContainer\">\n"
@@ -1599,7 +1599,7 @@
         checkOutput("index.html", true,
                 "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
                 "<link rel=\"stylesheet\" type=\"text/css\" href=\"stylesheet.css\" title=\"Style\">",
-                "<body>\n"
+                "<body onload=\"loadFrames()\">\n"
                 + "<div class=\"mainContainer\">\n"
                 + "<div class=\"leftContainer\">\n"
                 + "<div class=\"leftTop\">\n"
--- a/langtools/test/com/sun/javadoc/testJavascript/TestJavascript.java	Wed Jul 05 21:25:20 2017 +0200
+++ b/langtools/test/com/sun/javadoc/testJavascript/TestJavascript.java	Wed Jul 05 21:25:29 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2016, 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
@@ -100,8 +100,15 @@
                 + "        }\n"
                 + "        return true;\n"
                 + "    }\n"
+                + "    function loadFrames() {\n"
+                + "        if (targetPage != \"\" && targetPage != \"undefined\")\n"
+                + "             top.classFrame.location = top.targetPage;\n"
+                + "    }\n"
                 + "</script>");
 
+        checkOutput("index.html", true,
+                "<body onload=\"loadFrames()\"");
+
         //Make sure title javascript only runs if is-external is not true
         checkOutput("pkg/C.html", true,
                 "    try {\n"
--- a/langtools/test/jdk/javadoc/doclet/testHtmlVersion/TestHtmlVersion.java	Wed Jul 05 21:25:20 2017 +0200
+++ b/langtools/test/jdk/javadoc/doclet/testHtmlVersion/TestHtmlVersion.java	Wed Jul 05 21:25:29 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, 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 8072945 8081854 8141492
+ * @bug 8072945 8081854 8141492 8148985
  * @summary Test the version of HTML generated by the javadoc tool.
  * @author bpatel
  * @library ../lib
@@ -599,7 +599,7 @@
         checkOutput("index.html", true,
                 "<!DOCTYPE HTML>",
                 "<link rel=\"stylesheet\" type=\"text/css\" href=\"stylesheet.css\" title=\"Style\">",
-                "<body>\n"
+                "<body onload=\"loadFrames()\">\n"
                 + "<main role=\"main\">\n"
                 + "<div class=\"mainContainer\">\n"
                 + "<div class=\"leftContainer\">\n"
@@ -1391,7 +1391,7 @@
         checkOutput("index.html", true,
                 "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
                 "<link rel=\"stylesheet\" type=\"text/css\" href=\"stylesheet.css\" title=\"Style\">",
-                "<body>\n"
+                "<body onload=\"loadFrames()\">\n"
                 + "<div class=\"mainContainer\">\n"
                 + "<div class=\"leftContainer\">\n"
                 + "<div class=\"leftTop\">\n"
--- a/langtools/test/jdk/javadoc/doclet/testIncluded/TestIncluded.java	Wed Jul 05 21:25:20 2017 +0200
+++ b/langtools/test/jdk/javadoc/doclet/testIncluded/TestIncluded.java	Wed Jul 05 21:25:29 2017 +0200
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      8149468
+ * @bug      8149842
  * @summary  Verify that non included classes are not inspected.
  * @library  ../lib
  * @modules  jdk.javadoc/jdk.javadoc.internal.tool
--- a/langtools/test/jdk/javadoc/doclet/testJavaFX/TestJavaFX.java	Wed Jul 05 21:25:20 2017 +0200
+++ b/langtools/test/jdk/javadoc/doclet/testJavaFX/TestJavaFX.java	Wed Jul 05 21:25:29 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2016, 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 7112427 8012295 8025633 8026567 8061305 8081854
+ * @bug 7112427 8012295 8025633 8026567 8061305 8081854 8150130
  * @summary Test of the JavaFX doclet features.
  * @author jvalenta
  * @library ../lib
@@ -137,6 +137,7 @@
                 + "</ul>\n"
                 + "</li>");
     }
+
     /*
      * Test without -javafx option, to ensure property getters and setters
      * are treated just like any other java method.
@@ -181,4 +182,22 @@
                 + "</span>()</code>&nbsp;</td>"
         );
     }
+
+    /*
+     * Force the doclet to emit a warning when processing a synthesized,
+     * DocComment, and ensure that the run succeeds.
+     */
+    @Test
+    void test4() {
+        javadoc("-d", "out4",
+                "-javafx",
+                "-Xdoclint:none",
+                "-sourcepath", testSrc,
+                "-package",
+                "pkg4");
+        checkExit(Exit.OK);
+
+        // make sure the doclet indeed emits the warning
+        checkOutput(Output.OUT, true, "C.java:0: warning - invalid usage of tag >");
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/jdk/javadoc/doclet/testJavaFX/pkg4/C.java	Wed Jul 05 21:25:29 2017 +0200
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2016, 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 pkg4;
+
+public class C {
+
+    /**
+     * Defines the number of cycles in this animation. The {@code cycleCount}
+     * may be {@code INDEFINITE} for animations that repeat indefinitely.
+     * Now we add a > to deliberately cause an Html error.
+     * @defaultValue 11
+     * @since JavaFX 8.0
+     */
+    public DoubleProperty rate;
+
+    public final void setRate(double value) {}
+
+    public final double getRate() {return 2.0d;}
+
+    public final DoubleProperty rateProperty() {return new DoubleProperty();}
+
+    class DoubleProperty {}
+
+}
--- a/langtools/test/jdk/javadoc/doclet/testJavascript/TestJavascript.java	Wed Jul 05 21:25:20 2017 +0200
+++ b/langtools/test/jdk/javadoc/doclet/testJavascript/TestJavascript.java	Wed Jul 05 21:25:29 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2016, 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      4665566 4855876 7025314 8012375 8015997 8016328 8024756
+ * @bug      4665566 4855876 7025314 8012375 8015997 8016328 8024756 8148985
  * @summary  Verify that the output has the right javascript.
  * @author   jamieh
  * @library  ../lib
@@ -100,8 +100,15 @@
                 + "        }\n"
                 + "        return true;\n"
                 + "    }\n"
+                + "    function loadFrames() {\n"
+                + "        if (targetPage != \"\" && targetPage != \"undefined\")\n"
+                + "             top.classFrame.location = top.targetPage;\n"
+                + "    }\n"
                 + "</script>");
 
+        checkOutput("index.html", true,
+                "<body onload=\"loadFrames()\"");
+
         //Make sure title javascript only runs if is-external is not true
         checkOutput("pkg/C.html", true,
                 "    try {\n"
--- a/langtools/test/jdk/javadoc/doclet/testSubTitle/TestSubTitle.java	Wed Jul 05 21:25:20 2017 +0200
+++ b/langtools/test/jdk/javadoc/doclet/testSubTitle/TestSubTitle.java	Wed Jul 05 21:25:29 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2016, 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 7010342
+ * @bug 7010342 8150000
  * @summary Test for correct sub title generation.
  * @author Bhavesh Patel
  * @library ../lib
@@ -50,7 +50,8 @@
             "<div class=\"block\">This is the description of package pkg.</div>");
 
         checkOutput("pkg/C.html", true,
-            "<div class=\"subTitle\">pkg</div>");
+                "<div class=\"subTitle\"><span class=\"packageLabelInClass\">" +
+                "Package</span>&nbsp;<a href=\"../pkg/package-summary.html\">pkg</a></div>");
 
         checkOutput("pkg/package-summary.html", false,
             "<p class=\"subTitle\">\n" +
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/diags/examples/DiamondMethodDoesNotOverride.java	Wed Jul 05 21:25:29 2017 +0200
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2016, 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.anonymous.diamond.method.does.not.override.superclass
+// key: compiler.misc.diamond.anonymous.methods.implicitly.override
+
+class X {
+    interface  Foo<T> {
+        void g(T t);
+    }
+    void m() {
+      Foo<String> fs = new Foo<>() {
+          public void g(String s) { }
+          void someMethod() { }
+      };
+   }
+}
--- a/langtools/test/tools/javac/generics/diamond/neg/Neg15.java	Wed Jul 05 21:25:20 2017 +0200
+++ b/langtools/test/tools/javac/generics/diamond/neg/Neg15.java	Wed Jul 05 21:25:29 2017 +0200
@@ -1,6 +1,6 @@
 /*
  * @test /nodynamiccopyright/
- * @bug 8062373
+ * @bug 8062373 8151018
  *
  * @summary  Test that javac complains when a <> inferred class contains a public method that does override a supertype method.
  * @author sadayapalam
--- a/langtools/test/tools/javac/generics/diamond/neg/Neg15.out	Wed Jul 05 21:25:20 2017 +0200
+++ b/langtools/test/tools/javac/generics/diamond/neg/Neg15.out	Wed Jul 05 21:25:29 2017 +0200
@@ -1,4 +1,4 @@
-Neg15.java:48:28: compiler.err.method.does.not.override.superclass
-Neg15.java:52:21: compiler.err.method.does.not.override.superclass
-Neg15.java:56:31: compiler.err.method.does.not.override.superclass
+Neg15.java:48:28: compiler.err.anonymous.diamond.method.does.not.override.superclass: (compiler.misc.diamond.anonymous.methods.implicitly.override)
+Neg15.java:52:21: compiler.err.anonymous.diamond.method.does.not.override.superclass: (compiler.misc.diamond.anonymous.methods.implicitly.override)
+Neg15.java:56:31: compiler.err.anonymous.diamond.method.does.not.override.superclass: (compiler.misc.diamond.anonymous.methods.implicitly.override)
 3 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/inference/CheckNoTimeoutException.java	Wed Jul 05 21:25:29 2017 +0200
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2016, 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 8148930
+ * @summary Verify that there is no spurious unreported exception error.
+ * @modules java.sql
+ * @compile CheckNoTimeoutException.java
+ */
+
+import java.util.Collection;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.concurrent.TimeoutException;
+import java.io.*;
+import java.sql.SQLException;
+import java.sql.SQLTransientException;
+
+class CheckNoTimeoutException {
+
+    interface V {List<?> foo(List<String> arg) throws EOFException, SQLException, TimeoutException;}
+    interface U {Collection foo(List<String> arg) throws IOException, SQLTransientException;}
+
+    //SAM type ([List<String>], List<String>/List, {EOFException, SQLTransientException})
+    interface UV extends U, V {}
+
+
+    private static List<String> strs = new ArrayList<String>();
+    void methodUV(UV uv) {
+        System.out.println("methodUV(): SAM type interface UV object instantiated: " + uv);
+        try{
+            System.out.println("result returned: " + uv.foo(strs));
+        }catch(EOFException e){
+            System.out.println(e.getMessage());
+        }catch(SQLTransientException ex){
+            System.out.println(ex.getMessage());
+        }
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/inference/IntersectThrownTypesTest.java	Wed Jul 05 21:25:29 2017 +0200
@@ -0,0 +1,28 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8148930
+ * @summary Incorrect erasure of exceptions in override-equivalent dual interface impl
+ * @compile/fail/ref=IntersectThrownTypesTest.out -XDrawDiagnostics IntersectThrownTypesTest.java
+ */
+
+public class IntersectThrownTypesTest {
+
+    interface S1 {
+        <K extends Exception> void run(Class<K> clazz) throws K;
+    }
+
+    interface S2 {
+        <K extends Exception> void run(Class<K> clazz) throws K;
+    }
+
+    interface S extends S1, S2 {}
+
+    public void foo(S1 s) {
+        s.run(java.io.IOException.class);
+    }
+
+    public void foo(S s) {
+        s.run(java.io.IOException.class);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/inference/IntersectThrownTypesTest.out	Wed Jul 05 21:25:29 2017 +0200
@@ -0,0 +1,3 @@
+IntersectThrownTypesTest.java:21:14: compiler.err.unreported.exception.need.to.catch.or.throw: java.io.IOException
+IntersectThrownTypesTest.java:25:14: compiler.err.unreported.exception.need.to.catch.or.throw: java.io.IOException
+2 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/sjavac/OverlappingSrcDst.java	Wed Jul 05 21:25:29 2017 +0200
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2016, 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
+ * @summary Make sure sjavac doesn't allow overlapping source and destination
+ *          directories.
+ * @bug 8061320
+ * @library /tools/lib
+ * @modules jdk.compiler/com.sun.tools.javac.api
+ *          jdk.compiler/com.sun.tools.javac.file
+ *          jdk.compiler/com.sun.tools.javac.main
+ *          jdk.compiler/com.sun.tools.sjavac
+ * @build Wrapper ToolBox
+ * @run main Wrapper OverlappingSrcDst
+ */
+
+import java.io.File;
+import java.nio.file.Paths;
+
+public class OverlappingSrcDst extends SJavacTester {
+    public static void main(String... args) {
+        new OverlappingSrcDst().run();
+    }
+
+    public void run() {
+        String abs = ToolBox.currDir.toAbsolutePath().toString();
+
+        // Relative vs relative
+        test("dir", "dir", false);
+        test("dir", "dir/dst", false);
+        test("dir/src", "dir", false);
+        test("src", "dst", true);
+
+        // Absolute vs absolute
+        test(abs + "/dir", abs + "/dir", false);
+        test(abs + "/dir", abs + "/dir/dst", false);
+        test(abs + "/dir/src", abs + "/dir", false);
+        test(abs + "/src", abs + "/dst", true);
+
+        // Absolute vs relative
+        test(abs + "/dir", "dir", false);
+        test(abs + "/dir", "dir/dst", false);
+        test(abs + "/dir/src", "dir", false);
+        test(abs + "/src", "dst", true);
+
+        // Relative vs absolute
+        test("dir", abs + "/dir", false);
+        test("dir", abs + "/dir/dst", false);
+        test("dir/src", abs + "/dir", false);
+        test("src", abs + "/dst", true);
+    }
+
+    private void test(String srcDir, String dstDir, boolean shouldSucceed) {
+        boolean succeeded = testCompilation(srcDir, dstDir);
+        if (shouldSucceed != succeeded) {
+            throw new AssertionError(
+                    String.format("Test failed for "
+                                          + "srcDir=\"%s\", "
+                                          + "dstDir=\"%s\". "
+                                          + "Compilation was expected to %s but %s.",
+                                  srcDir,
+                                  dstDir,
+                                  shouldSucceed ? "succeed" : "fail",
+                                  succeeded ? "succeeded" : "failed"));
+        }
+    }
+
+    private boolean testCompilation(String srcDir, String dstDir) {
+        try {
+            srcDir = srcDir.replace('/', File.separatorChar);
+            dstDir = dstDir.replace('/', File.separatorChar);
+            tb.writeFile(Paths.get(srcDir, "pkg", "A.java"), "package pkg; class A {}");
+            compile("--state-dir=state", "-src", srcDir, "-d", dstDir);
+            return true;
+        } catch (Exception e) {
+            return false;
+        }
+    }
+}