changeset 55902:6bf534354b27 records-and-sealed

javac cannot read PermittedSubtypes attribute Reviewed-by: vromero Contributed-by: jlahoda
author vromero
date Mon, 29 Apr 2019 14:10:56 -0400
parents d96a597f272f
children eddf8682e1ee fbf54d7428f1
files src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java test/langtools/tools/javac/sealed/separate/TestSeparate01.java test/langtools/tools/javac/sealed/separate/TestSeparate_Neg.java test/langtools/tools/javac/sealed/separate/TestSeparate_Neg.out
diffstat 4 files changed, 10 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java	Tue Apr 23 16:14:32 2019 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java	Mon Apr 29 14:10:56 2019 -0400
@@ -1198,7 +1198,6 @@
                         ListBuffer<Type> subtypes = new ListBuffer<>();
                         int numberOfPermittedSubtypes = nextChar();
                         for (int i = 0; i < numberOfPermittedSubtypes; i++) {
-                            int subtype = nextChar();
                             Type ct = poolReader.getClass(nextChar()).erasure(types);
                             subtypes.add(ct);
                         }
--- a/test/langtools/tools/javac/sealed/separate/TestSeparate01.java	Tue Apr 23 16:14:32 2019 -0700
+++ b/test/langtools/tools/javac/sealed/separate/TestSeparate01.java	Mon Apr 29 14:10:56 2019 -0400
@@ -27,6 +27,9 @@
  * @test
  * @summary smoke test for sealed and separate compilation
  * @compile TestSeparate01.java SealedClasses.java
+ * @clean *
+ * @compile SealedClasses.java
+ * @compile TestSeparate01.java
  */
 
 public class TestSeparate01 {
--- a/test/langtools/tools/javac/sealed/separate/TestSeparate_Neg.java	Tue Apr 23 16:14:32 2019 -0700
+++ b/test/langtools/tools/javac/sealed/separate/TestSeparate_Neg.java	Mon Apr 29 14:10:56 2019 -0400
@@ -2,6 +2,9 @@
  * @test /nodynamiccopyright/
  * @summary smoke test for sealed and separate compilation
  * @compile/fail/ref=TestSeparate_Neg.out -XDrawDiagnostics TestSeparate_Neg.java SealedClasses.java
+ * @clean *
+ * @compile SealedClasses.java
+ * @compile/fail/ref=TestSeparate_Neg.out -XDrawDiagnostics TestSeparate_Neg.java
  */
 
 public class TestSeparate_Neg {
--- a/test/langtools/tools/javac/sealed/separate/TestSeparate_Neg.out	Tue Apr 23 16:14:32 2019 -0700
+++ b/test/langtools/tools/javac/sealed/separate/TestSeparate_Neg.out	Mon Apr 29 14:10:56 2019 -0400
@@ -1,5 +1,5 @@
-TestSeparate_Neg.java:8:45: compiler.err.cant.inherit.from.sealed: SealedClasses.SC
-TestSeparate_Neg.java:9:46: compiler.err.cant.inherit.from.sealed: SealedClasses.SAC
-TestSeparate_Neg.java:10:48: compiler.err.cant.inherit.from.sealed: SealedClasses.SI
-TestSeparate_Neg.java:11:49: compiler.err.cant.inherit.from.sealed: SealedClasses.SI
+TestSeparate_Neg.java:11:45: compiler.err.cant.inherit.from.sealed: SealedClasses.SC
+TestSeparate_Neg.java:12:46: compiler.err.cant.inherit.from.sealed: SealedClasses.SAC
+TestSeparate_Neg.java:13:48: compiler.err.cant.inherit.from.sealed: SealedClasses.SI
+TestSeparate_Neg.java:14:49: compiler.err.cant.inherit.from.sealed: SealedClasses.SI
 4 errors