changeset 3929:b55815589fee

Merge
author andrew
date Fri, 23 Apr 2021 01:47:35 +0100
parents 3e1dd745bcb1 (diff) b57498c29611 (current diff)
children 55148c63b3e8
files
diffstat 6 files changed, 25 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/tools/javac/comp/Check.java	Tue Apr 20 19:19:05 2021 +0100
+++ b/src/share/classes/com/sun/tools/javac/comp/Check.java	Fri Apr 23 01:47:35 2021 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2019, 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
@@ -2617,6 +2617,8 @@
             if (type.isErroneous()) return;
             for (List<Type> l = types.interfaces(type); l.nonEmpty(); l = l.tail) {
                 Type it = l.head;
+                if (type.hasTag(CLASS) && !it.hasTag(CLASS)) continue; // JLS 8.1.5
+
                 Type oldit = seensofar.put(it.tsym, it);
                 if (oldit != null) {
                     List<Type> oldparams = oldit.allparams();
@@ -2629,6 +2631,7 @@
                 checkClassBounds(pos, seensofar, it);
             }
             Type st = types.supertype(type);
+            if (type.hasTag(CLASS) && !st.hasTag(CLASS)) return; // JLS 8.1.4
             if (st != Type.noType) checkClassBounds(pos, seensofar, st);
         }
 
--- a/test/Makefile	Tue Apr 20 19:19:05 2021 +0100
+++ b/test/Makefile	Fri Apr 23 01:47:35 2021 +0100
@@ -139,21 +139,19 @@
 
 # Default JDK for JTREG and JCK
 #
-# JT_JAVA is the version of java used to run jtreg/JCK. Since it is now
-# standard to execute tests in sameVM mode, it should normally be set the
-# same as TESTJAVA (although not necessarily so.)
+# JT_JAVA is the version of java used to run jtreg/JCK. 
 #
 ifdef JPRT_JAVA_HOME
   JT_JAVA = $(JPRT_JAVA_HOME)
 else
-  JT_JAVA = $(SLASH_JAVA)/re/jdk/1.7.0/archive/fcs/binaries/$(PLATFORM)-$(ARCH)
+  JT_JAVA = $(SLASH_JAVA)/re/jdk/1.9.0/archive/fcs/binaries/$(PLATFORM)-$(ARCH)
 endif
 
 # Default JDK to test
 ifdef JPRT_IMPORT_PRODUCT_HOME
   TESTJAVA = $(JPRT_IMPORT_PRODUCT_HOME)
 else
-  TESTJAVA = $(SLASH_JAVA)/re/jdk/1.7.0/promoted/latest/binaries/$(PLATFORM)-$(ARCH)
+  TESTJAVA = $(SLASH_JAVA)/re/jdk/1.9.0/promoted/latest/binaries/$(PLATFORM)-$(ARCH)
 endif
 
 # PRODUCT_HOME is a JPRT variable pointing to a directory containing the output from
@@ -186,7 +184,7 @@
 ifdef CONCURRENCY
   JTREG_OPTIONS += -agentvm -concurrency:$(CONCURRENCY)
 else
-  JTREG_OPTIONS += -samevm
+  JTREG_OPTIONS += -agentvm
 endif
 
 ifdef JCK_CONCURRENCY
--- a/test/tools/javac/diags/examples/NoJavaLang.java	Tue Apr 20 19:19:05 2021 +0100
+++ b/test/tools/javac/diags/examples/NoJavaLang.java	Fri Apr 23 01:47:35 2021 +0100
@@ -22,7 +22,7 @@
  */
 
 // key: compiler.misc.fatal.err.no.java.lang
-// options: -Xbootclasspath:
+// options: -Xbootclasspath: -classpath .
 // run: backdoor
 
 class NoJavaLang { }
--- a/test/tools/javac/fatalErrors/NoJavaLangTest.java	Tue Apr 20 19:19:05 2021 +0100
+++ b/test/tools/javac/fatalErrors/NoJavaLangTest.java	Fri Apr 23 01:47:35 2021 +0100
@@ -58,7 +58,7 @@
         List<String> output = new ArrayList<>();
         ToolBox.JavaToolArgs javacFailArgs =
                 new ToolBox.JavaToolArgs(ToolBox.Expect.FAIL)
-                .setOptions("-bootclasspath", ".")
+                .setOptions("-bootclasspath", ".", "-classpath", ".")
                 .setSources(noJavaLangSrc)
                 .setErrOutput(output);
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/generics/ClassBoundCheckingOverflow.java	Fri Apr 23 01:47:35 2021 +0100
@@ -0,0 +1,12 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8214345
+ * @summary infinite recursion while checking super class
+ *
+ * @compile/fail/ref=ClassBoundCheckingOverflow.out -XDrawDiagnostics ClassBoundCheckingOverflow.java
+ */
+
+public class ClassBoundCheckingOverflow {
+    abstract class InfiniteLoop1<E extends InfiniteLoop1<E>> extends E {}
+    abstract class InfiniteLoop2<E extends InfiniteLoop2<E>> implements E {}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/generics/ClassBoundCheckingOverflow.out	Fri Apr 23 01:47:35 2021 +0100
@@ -0,0 +1,3 @@
+ClassBoundCheckingOverflow.java:10:70: compiler.err.type.found.req: (compiler.misc.type.parameter: E), (compiler.misc.type.req.class)
+ClassBoundCheckingOverflow.java:11:73: compiler.err.type.found.req: (compiler.misc.type.parameter: E), (compiler.misc.type.req.class)
+2 errors