1 /*
   2  * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 // This class has PermittedSubtypes that do not exist.  Test that this does
  25 // not prevent JVM_GetPermittedSubtypes() from returning their names.
  26 //
  27 // sealed class noLoadSubtypes permits iDontExist, I/Dont/Exist/Either { }
  28 //
  29 class noLoadSubtypes {
  30   0xCAFEBABE;
  31   0; // minor version
  32   58; // version
  33   [18] { // Constant Pool
  34     ; // first element is empty
  35     Method #2 #3; // #1     at 0x0A
  36     class #4; // #2     at 0x0F
  37     NameAndType #5 #6; // #3     at 0x12
  38     Utf8 "java/lang/Object"; // #4     at 0x17
  39     Utf8 "<init>"; // #5     at 0x2A
  40     Utf8 "()V"; // #6     at 0x33
  41     class #8; // #7     at 0x39
  42     Utf8 "noLoadSubtypes"; // #8     at 0x3C
  43     Utf8 "Code"; // #9     at 0x4D
  44     Utf8 "LineNumberTable"; // #10     at 0x54
  45     Utf8 "SourceFile"; // #11     at 0x66
  46     Utf8 "noLoadSubtypes.java"; // #12     at 0x73
  47     Utf8 "PermittedSubtypes"; // #13     at 0x89
  48     class #15; // #14     at 0x9D
  49     Utf8 "iDontExist"; // #15     at 0xA0
  50     class #17; // #16     at 0xAA
  51     Utf8 "I/Dont/Exist/Either"; // #17     at 0xAD
  52   } // Constant Pool
  53 
  54   0x0030; // access [ ACC_SUPER ACC_FINAL ]
  55   #7;// this_cpx
  56   #2;// super_cpx
  57 
  58   [0] { // Interfaces
  59   } // Interfaces
  60 
  61   [0] { // fields
  62   } // fields
  63 
  64   [1] { // methods
  65     { // Member at 0xC1
  66       0x0000; // access
  67       #5; // name_cpx
  68       #6; // sig_cpx
  69       [1] { // Attributes
  70         Attr(#9, 29) { // Code at 0xC9
  71           1; // max_stack
  72           1; // max_locals
  73           Bytes[5]{
  74             0x2AB70001B1;
  75           }
  76           [0] { // Traps
  77           } // end Traps
  78           [1] { // Attributes
  79             Attr(#10, 6) { // LineNumberTable at 0xE0
  80               [1] { // LineNumberTable
  81                 0  1; //  at 0xEC
  82               }
  83             } // end LineNumberTable
  84           } // Attributes
  85         } // end Code
  86       } // Attributes
  87     } // Member
  88   } // methods
  89 
  90   [2] { // Attributes
  91     Attr(#11, 2) { // SourceFile at 0xEE
  92       #12;
  93     } // end SourceFile
  94     ;
  95     Attr(#13, 6) { // PermittedSubtypes at 0xF6
  96       0x0002000E0010;
  97     } // end PermittedSubtypes
  98   } // Attributes
  99 } // end class noLoadSubtypes