changeset 60073:9d08b2857f6f amber-demo-II

Automatic merge with sealed-types
author mcimadamore
date Fri, 14 Feb 2020 20:45:50 +0000
parents 0ef08b8bd812 575b12fbc09b
children 29385ffa3eb0
files test/hotspot/jtreg/runtime/modules/SealedModuleTest.java test/hotspot/jtreg/runtime/modules/sealedP1/c1.java test/hotspot/jtreg/runtime/modules/sealedP1/superClass.java test/hotspot/jtreg/runtime/modules/sealedP2/c2.java test/hotspot/jtreg/runtime/modules/sealedP3/c3.java test/hotspot/jtreg/runtime/sealedTypes/Pkg/Permitted.java test/hotspot/jtreg/runtime/sealedTypes/Pkg/sealedInterface.java test/hotspot/jtreg/runtime/sealedTypes/SealedUnnamedModuleIntfTest.java test/hotspot/jtreg/runtime/sealedTypes/SealedUnnamedModuleTest.java test/hotspot/jtreg/runtime/sealedTypes/abstractSealedTest.java test/hotspot/jtreg/runtime/sealedTypes/asteroids/Pluto.java test/hotspot/jtreg/runtime/sealedTypes/getPermittedSubtypesTest.java test/hotspot/jtreg/runtime/sealedTypes/otherPkg/wrongPackage.java test/hotspot/jtreg/runtime/sealedTypes/overrideSealedTest.java test/hotspot/jtreg/runtime/sealedTypes/planets/Neptune.java test/hotspot/jtreg/runtime/sealedTypes/planets/outerPlanets.java test/hotspot/jtreg/runtime/sealedTypes/sealedTest.java
diffstat 21 files changed, 301 insertions(+), 111 deletions(-) [+]
line wrap: on
line diff
--- a/test/hotspot/jtreg/runtime/modules/SealedModuleTest.java	Fri Feb 14 17:45:50 2020 +0000
+++ b/test/hotspot/jtreg/runtime/modules/SealedModuleTest.java	Fri Feb 14 20:45:50 2020 +0000
@@ -25,7 +25,8 @@
  * @test
  * @modules java.base/jdk.internal.misc
  * @library /test/lib ..
- * @compile --enable-preview --source ${jdk.version} sealedP1/superClass.java sealedP1/c1.java sealedP2/c2.java sealedP3/c3.java
+ * @compile sealedP1/superClass.jcod
+ * @compile --enable-preview --source ${jdk.version} sealedP1/c1.java sealedP2/c2.java sealedP3/c3.java
  * @build sun.hotspot.WhiteBox
  * @compile/module=java.base java/lang/ModuleHelper.java
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
--- a/test/hotspot/jtreg/runtime/modules/sealedP1/c1.java	Fri Feb 14 17:45:50 2020 +0000
+++ b/test/hotspot/jtreg/runtime/modules/sealedP1/c1.java	Fri Feb 14 20:45:50 2020 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -24,7 +24,7 @@
 // Small class used by SealedModuleTest
 package sealedP1;
 
-public sealed class c1 extends sealedP1.superClass {
+public final class c1 extends sealedP1.superClass {
 
     public c1 () { }
 }
--- a/test/hotspot/jtreg/runtime/modules/sealedP1/superClass.java	Fri Feb 14 17:45:50 2020 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-/*
- * Copyright (c) 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
- * 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.
- */
-
-// Sealed super class used by SealedModuleTest.
-
-package sealedP1;
-
-public sealed class superClass permits sealedP1.c1, sealedP2.c2, sealedP3.c3 { }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/runtime/modules/sealedP1/superClass.jcod	Fri Feb 14 20:45:50 2020 +0000
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+
+// Sealed super class used by SealedModuleTest.
+//
+// package sealedP1;
+//
+// public sealed class superClass permits sealedP1.c1, sealedP2.c2, sealedP3.c3 { }
+
+class sealedP1/superClass {
+  0xCAFEBABE;
+  65535; // minor version
+  59; // version
+  [20] { // Constant Pool
+    ; // first element is empty
+    Method #2 #3; // #1     at 0x0A
+    class #4; // #2     at 0x0F
+    NameAndType #5 #6; // #3     at 0x12
+    Utf8 "java/lang/Object"; // #4     at 0x17
+    Utf8 "<init>"; // #5     at 0x2A
+    Utf8 "()V"; // #6     at 0x33
+    class #8; // #7     at 0x39
+    Utf8 "sealedP1/superClass"; // #8     at 0x3C
+    Utf8 "Code"; // #9     at 0x52
+    Utf8 "LineNumberTable"; // #10     at 0x59
+    Utf8 "SourceFile"; // #11     at 0x6B
+    Utf8 "superClass.java"; // #12     at 0x78
+    Utf8 "PermittedSubtypes"; // #13     at 0x8A
+    class #15; // #14     at 0x9E
+    Utf8 "sealedP1/c1"; // #15     at 0xA1
+    class #17; // #16     at 0xAF
+    Utf8 "sealedP2/c2"; // #17     at 0xB2
+    class #19; // #18     at 0xC0
+    Utf8 "sealedP3/c3"; // #19     at 0xC3
+  } // Constant Pool
+
+  0x0021; // access [ ACC_PUBLIC ACC_SUPER ]
+  #7;// this_cpx
+  #2;// super_cpx
+
+  [0] { // Interfaces
+  } // Interfaces
+
+  [0] { // fields
+  } // fields
+
+  [1] { // methods
+    { // Member at 0xDD
+      0x0001; // access
+      #5; // name_cpx
+      #6; // sig_cpx
+      [1] { // Attributes
+        Attr(#9, 29) { // Code at 0xE5
+          1; // max_stack
+          1; // max_locals
+          Bytes[5]{
+            0x2AB70001B1;
+          }
+          [0] { // Traps
+          } // end Traps
+          [1] { // Attributes
+            Attr(#10, 6) { // LineNumberTable at 0xFC
+              [1] { // LineNumberTable
+                0  28; //  at 0x0108
+              }
+            } // end LineNumberTable
+          } // Attributes
+        } // end Code
+      } // Attributes
+    } // Member
+  } // methods
+
+  [2] { // Attributes
+    Attr(#11, 2) { // SourceFile at 0x010A
+      #12;
+    } // end SourceFile
+    ;
+    Attr(#13, 8) { // PermittedSubtypes at 0x0112
+      0x0003000E00100012;
+    } // end PermittedSubtypes
+  } // Attributes
+} // end class sealedP1/superClass
--- a/test/hotspot/jtreg/runtime/modules/sealedP2/c2.java	Fri Feb 14 17:45:50 2020 +0000
+++ b/test/hotspot/jtreg/runtime/modules/sealedP2/c2.java	Fri Feb 14 20:45:50 2020 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -24,6 +24,6 @@
 // Small class used by SealedModuleTest
 package sealedP2;
 
-public sealed class c2 extends sealedP1.superClass {
+public final class c2 extends sealedP1.superClass {
     public void method2() { }
 }
--- a/test/hotspot/jtreg/runtime/modules/sealedP3/c3.java	Fri Feb 14 17:45:50 2020 +0000
+++ b/test/hotspot/jtreg/runtime/modules/sealedP3/c3.java	Fri Feb 14 20:45:50 2020 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -24,6 +24,6 @@
 // Small class used by SealedModuleTest
 package sealedP3;
 
-public sealed class c3 extends sealedP1.superClass {
+public final class c3 extends sealedP1.superClass {
     public void method3() { }
 }
--- a/test/hotspot/jtreg/runtime/sealedTypes/Pkg/Permitted.java	Fri Feb 14 17:45:50 2020 +0000
+++ b/test/hotspot/jtreg/runtime/sealedTypes/Pkg/Permitted.java	Fri Feb 14 20:45:50 2020 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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,4 +23,4 @@
 
 package Pkg;
 
-public sealed class Permitted implements sealedInterface { }
+public final class Permitted implements sealedInterface { }
--- a/test/hotspot/jtreg/runtime/sealedTypes/Pkg/sealedInterface.java	Fri Feb 14 17:45:50 2020 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-/*
- * Copyright (c) 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
- * 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;
-
-sealed public interface sealedInterface permits Permitted, otherPkg.wrongPackage { }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/runtime/sealedTypes/Pkg/sealedInterface.jcod	Fri Feb 14 20:45:50 2020 +0000
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2020, 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;
+//
+// sealed public interface sealedInterface permits Permitted, otherPkg.wrongPackage { }
+
+class Pkg/sealedInterface {
+  0xCAFEBABE;
+  65535; // minor version
+  59; // version
+  [12] { // Constant Pool
+    ; // first element is empty
+    class #2; // #1     at 0x0A
+    Utf8 "Pkg/sealedInterface"; // #2     at 0x0D
+    class #4; // #3     at 0x23
+    Utf8 "java/lang/Object"; // #4     at 0x26
+    Utf8 "SourceFile"; // #5     at 0x39
+    Utf8 "sealedInterface.java"; // #6     at 0x46
+    Utf8 "PermittedSubtypes"; // #7     at 0x5D
+    class #9; // #8     at 0x71
+    Utf8 "Pkg/Permitted"; // #9     at 0x74
+    class #11; // #10     at 0x84
+    Utf8 "otherPkg/wrongPackage"; // #11     at 0x87
+  } // Constant Pool
+
+  0x0601; // access [ ACC_PUBLIC ACC_INTERFACE ]
+  #1;// this_cpx
+  #3;// super_cpx
+
+  [0] { // Interfaces
+  } // Interfaces
+
+  [0] { // fields
+  } // fields
+
+  [0] { // methods
+  } // methods
+
+  [2] { // Attributes
+    Attr(#5, 2) { // SourceFile at 0xAD
+      #6;
+    } // end SourceFile
+    ;
+    Attr(#7, 6) { // PermittedSubtypes at 0xB5
+      0x00020008000A;
+    } // end PermittedSubtypes
+  } // Attributes
+} // end class Pkg/sealedInterface
--- a/test/hotspot/jtreg/runtime/sealedTypes/RedefineSealedType.java	Fri Feb 14 17:45:50 2020 +0000
+++ b/test/hotspot/jtreg/runtime/sealedTypes/RedefineSealedType.java	Fri Feb 14 20:45:50 2020 +0000
@@ -45,7 +45,10 @@
 
 public class RedefineSealedType {
 
-    sealed static class Tester permits java.lang.Class, java.lang.String {};
+    final class A extends Tester { }
+    final class B extends Tester { }
+
+    sealed static class Tester permits A, B {}
 
     static class LoggingTransformer implements ClassFileTransformer {
 
--- a/test/hotspot/jtreg/runtime/sealedTypes/SealedUnnamedModuleIntfTest.java	Fri Feb 14 17:45:50 2020 +0000
+++ b/test/hotspot/jtreg/runtime/sealedTypes/SealedUnnamedModuleIntfTest.java	Fri Feb 14 20:45:50 2020 +0000
@@ -23,8 +23,8 @@
 
 /*
  * @test
- * @compile --enable-preview -source ${jdk.version} otherPkg/wrongPackage.java Pkg/Permitted.java Pkg/notPermitted.jcod Pkg/sealedInterface.java
- * @compile --enable-preview -source ${jdk.version} Pkg/sealedInterface.java
+ * @compile Pkg/sealedInterface.jcod Pkg/notPermitted.jcod
+ * @compile --enable-preview -source ${jdk.version} Pkg/Permitted.java otherPkg/wrongPackage.java
  * @run main/othervm --enable-preview SealedUnnamedModuleIntfTest
  */
 
--- a/test/hotspot/jtreg/runtime/sealedTypes/SealedUnnamedModuleTest.java	Fri Feb 14 17:45:50 2020 +0000
+++ b/test/hotspot/jtreg/runtime/sealedTypes/SealedUnnamedModuleTest.java	Fri Feb 14 20:45:50 2020 +0000
@@ -23,7 +23,8 @@
 
 /*
  * @test
- * @compile --enable-preview -source ${jdk.version} asteroids/Pluto.java planets/Neptune.java planets/Mars.jcod planets/outerPlanets.java
+ * @compile planets/outerPlanets.jcod planets/Mars.jcod
+ * @compile --enable-preview -source ${jdk.version} planets/Neptune.java asteroids/Pluto.java
  * @run main/othervm --enable-preview SealedUnnamedModuleTest
  */
 
--- a/test/hotspot/jtreg/runtime/sealedTypes/abstractSealedTest.java	Fri Feb 14 17:45:50 2020 +0000
+++ b/test/hotspot/jtreg/runtime/sealedTypes/abstractSealedTest.java	Fri Feb 14 20:45:50 2020 +0000
@@ -34,7 +34,7 @@
         abstract void draw();
     }
 
-    sealed class Circle extends abstractShape {
+    final class Circle extends abstractShape {
         void draw() {}
     }
 
--- a/test/hotspot/jtreg/runtime/sealedTypes/asteroids/Pluto.java	Fri Feb 14 17:45:50 2020 +0000
+++ b/test/hotspot/jtreg/runtime/sealedTypes/asteroids/Pluto.java	Fri Feb 14 20:45:50 2020 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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,5 +23,5 @@
 
 package asteroids;
 
-public sealed class Pluto extends planets.outerPlanets { }
+public final class Pluto extends planets.outerPlanets { }
 
--- a/test/hotspot/jtreg/runtime/sealedTypes/getPermittedSubtypesTest.java	Fri Feb 14 17:45:50 2020 +0000
+++ b/test/hotspot/jtreg/runtime/sealedTypes/getPermittedSubtypesTest.java	Fri Feb 14 20:45:50 2020 +0000
@@ -36,15 +36,15 @@
 
     sealed class Sealed1 permits Sub1 {}
 
-    sealed class Sub1 extends Sealed1 {}
+    final class Sub1 extends Sealed1 implements SealedI1 {}
 
     sealed interface SealedI1 permits notSealed, Sub1, Extender {}
 
     non-sealed interface Extender extends SealedI1 { }
 
-    non-sealed class notSealed implements SealedI1 {}
+    final class finalC implements Extender {}
 
-    sealed class noPermits {}
+    final class notSealed implements SealedI1 {}
 
     final class Final4 {}
 
@@ -105,7 +105,6 @@
                                                      "LgetPermittedSubtypesTest$Sub1;",
                                                      "LgetPermittedSubtypesTest$Extender;"});
         testSealedInfo(Sealed1.class, new String[] {"LgetPermittedSubtypesTest$Sub1;"});
-        testSealedInfo(noPermits.class, new String[] { });
         testSealedInfo(Final4.class, new String[] { });
         testSealedInfo(notSealed.class, new String[] { });
 
--- a/test/hotspot/jtreg/runtime/sealedTypes/otherPkg/wrongPackage.java	Fri Feb 14 17:45:50 2020 +0000
+++ b/test/hotspot/jtreg/runtime/sealedTypes/otherPkg/wrongPackage.java	Fri Feb 14 20:45:50 2020 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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,4 +23,4 @@
 
 package otherPkg;
 
-public sealed class wrongPackage implements Pkg.sealedInterface { }
+public final class wrongPackage implements Pkg.sealedInterface { }
--- a/test/hotspot/jtreg/runtime/sealedTypes/overrideSealedTest.java	Fri Feb 14 17:45:50 2020 +0000
+++ b/test/hotspot/jtreg/runtime/sealedTypes/overrideSealedTest.java	Fri Feb 14 20:45:50 2020 +0000
@@ -34,7 +34,7 @@
         public String draw() { return "rectangle"; }
     }
 
-    sealed class Square extends Rectangle {
+    final class Square extends Rectangle {
         public String draw() { return "square"; }
     }
 
--- a/test/hotspot/jtreg/runtime/sealedTypes/planets/Neptune.java	Fri Feb 14 17:45:50 2020 +0000
+++ b/test/hotspot/jtreg/runtime/sealedTypes/planets/Neptune.java	Fri Feb 14 20:45:50 2020 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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,4 +23,4 @@
 
 package planets;
 
-public sealed class Neptune extends outerPlanets { }
+public final class Neptune extends outerPlanets { }
--- a/test/hotspot/jtreg/runtime/sealedTypes/planets/outerPlanets.java	Fri Feb 14 17:45:50 2020 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-/*
- * Copyright (c) 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
- * 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 planets;
-
-sealed public class outerPlanets permits Neptune, asteroids.Pluto { }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/runtime/sealedTypes/planets/outerPlanets.jcod	Fri Feb 14 20:45:50 2020 +0000
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 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
+ * 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 planets;
+//
+// sealed public class outerPlanets permits Neptune, asteroids.Pluto { }
+
+class planets/outerPlanets {
+  0xCAFEBABE;
+  65535; // minor version
+  59; // version
+  [18] { // Constant Pool
+    ; // first element is empty
+    Method #2 #3; // #1     at 0x0A
+    class #4; // #2     at 0x0F
+    NameAndType #5 #6; // #3     at 0x12
+    Utf8 "java/lang/Object"; // #4     at 0x17
+    Utf8 "<init>"; // #5     at 0x2A
+    Utf8 "()V"; // #6     at 0x33
+    class #8; // #7     at 0x39
+    Utf8 "planets/outerPlanets"; // #8     at 0x3C
+    Utf8 "Code"; // #9     at 0x53
+    Utf8 "LineNumberTable"; // #10     at 0x5A
+    Utf8 "SourceFile"; // #11     at 0x6C
+    Utf8 "outerPlanets.java"; // #12     at 0x79
+    Utf8 "PermittedSubtypes"; // #13     at 0x8D
+    class #15; // #14     at 0xA1
+    Utf8 "planets/Neptune"; // #15     at 0xA4
+    class #17; // #16     at 0xB6
+    Utf8 "asteroids/Pluto"; // #17     at 0xB9
+  } // Constant Pool
+
+  0x0021; // access [ ACC_PUBLIC ACC_SUPER ]
+  #7;// this_cpx
+  #2;// super_cpx
+
+  [0] { // Interfaces
+  } // Interfaces
+
+  [0] { // fields
+  } // fields
+
+  [1] { // methods
+    { // Member at 0xD7
+      0x0001; // access
+      #5; // name_cpx
+      #6; // sig_cpx
+      [1] { // Attributes
+        Attr(#9, 29) { // Code at 0xDF
+          1; // max_stack
+          1; // max_locals
+          Bytes[5]{
+            0x2AB70001B1;
+          }
+          [0] { // Traps
+          } // end Traps
+          [1] { // Attributes
+            Attr(#10, 6) { // LineNumberTable at 0xF6
+              [1] { // LineNumberTable
+                0  26; //  at 0x0102
+              }
+            } // end LineNumberTable
+          } // Attributes
+        } // end Code
+      } // Attributes
+    } // Member
+  } // methods
+
+  [2] { // Attributes
+    Attr(#11, 2) { // SourceFile at 0x0104
+      #12;
+    } // end SourceFile
+    ;
+    Attr(#13, 6) { // PermittedSubtypes at 0x010C
+      0x0002000E0010;
+    } // end PermittedSubtypes
+  } // Attributes
+} // end class planets/outerPlanets
--- a/test/hotspot/jtreg/runtime/sealedTypes/sealedTest.java	Fri Feb 14 17:45:50 2020 +0000
+++ b/test/hotspot/jtreg/runtime/sealedTypes/sealedTest.java	Fri Feb 14 20:45:50 2020 +0000
@@ -31,19 +31,16 @@
 
     sealed class Sealed1 permits Sub1 {}
 
-    non-sealed class Sub1 extends Sealed1 {}
+    final class Sub1 extends Sealed1 {}
 
     sealed interface SealedI1 permits Sub2 {}
 
-    sealed class Sub2 implements SealedI1 {}
+    final class Sub2 extends Sealed2 implements SealedI1 {}
 
-    sealed class Sealed2 {}
-
-    sealed class Sub3 extends Sealed2 {}
+    sealed class Sealed2 permits Sub2 {}
 
     Sub1 sub1 = new Sub1();
     Sub2 sub2 = new Sub2();
-    Sub3 sub3 = new Sub3();
 
     public static void main(String... args) {
         System.out.println("Basic testing of sealed types");