| /* |
| * Copyright (c) 2020, 2021, 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. |
| */ |
| |
| // This sealed class cannot be a java file because its permits clause names |
| // a class in another package causing javac to issue a compilation error. |
| // |
| // Sealed super class used by SealedModuleTest. |
| // |
| // package sealedP1; |
| // |
| // public sealed class SuperClass permits sealedP1.C1, sealedP2.C2, sealedP3.C3 { } |
| |
| class sealedP1/SuperClass { |
| 0xCAFEBABE; |
| 0; // minor version |
| 61; // 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 "PermittedSubclasses"; // #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) { // PermittedSubclasses at 0x0112 |
| 0x0003000E00100012; |
| } // end PermittedSubclasses |
| } // Attributes |
| } // end class sealedP1/SuperClass |
| |
| |
| // This is an empty interface that is needed because the subtypes used by test |
| // SealedModuleTest are also used by test SealedInterfaceModuleTest, which |
| // tests a sealed interface with this same name. |
| // |
| // package sealedP1; |
| // public interface SuperInterface { } |
| // |
| class sealedP1/SuperInterface { |
| 0xCAFEBABE; |
| 0; // minor version |
| 60; // version |
| [7] { // Constant Pool |
| ; // first element is empty |
| class #2; // #1 at 0x0A |
| Utf8 "sealedP1/SuperInterface"; // #2 at 0x0D |
| class #4; // #3 at 0x27 |
| Utf8 "java/lang/Object"; // #4 at 0x2A |
| Utf8 "SourceFile"; // #5 at 0x3D |
| Utf8 "SuperInterface.java"; // #6 at 0x4A |
| } // Constant Pool |
| |
| 0x0601; // access [ ACC_PUBLIC ACC_INTERFACE ] |
| #1;// this_cpx |
| #3;// super_cpx |
| |
| [0] { // Interfaces |
| } // Interfaces |
| |
| [0] { // fields |
| } // fields |
| |
| [0] { // methods |
| } // methods |
| |
| [1] { // Attributes |
| Attr(#5, 2) { // SourceFile at 0x6E |
| #6; |
| } // end SourceFile |
| } // Attributes |
| } // end class sealedP1/SuperInterface |
| |