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 was written using jcod because it implements sealed interface
  25 // sealedInterface but is not listed in its PermittedSubtypes attribute.
  26 // It consists of the following:
  27 //
  28 //    package Pkg;
  29 //    public class notPermitted implements sealedInterface { }
  30 //
  31 class Pkg/notPermitted {
  32   0xCAFEBABE;
  33   0; // minor version
  34   58; // version
  35   [15] { // Constant Pool
  36     ; // first element is empty
  37     Method #2 #3; // #1     at 0x0A
  38     class #4; // #2     at 0x0F
  39     NameAndType #5 #6; // #3     at 0x12
  40     Utf8 "java/lang/Object"; // #4     at 0x17
  41     Utf8 "<init>"; // #5     at 0x2A
  42     Utf8 "()V"; // #6     at 0x33
  43     class #8; // #7     at 0x39
  44     Utf8 "Pkg/notPermitted"; // #8     at 0x3C
  45     class #10; // #9     at 0x4C
  46     Utf8 "Pkg/sealedInterface"; // #10     at 0x4F
  47     Utf8 "Code"; // #11     at 0x65
  48     Utf8 "LineNumberTable"; // #12     at 0x6C
  49     Utf8 "SourceFile"; // #13     at 0x7E
  50     Utf8 "notPermitted.java"; // #14     at 0x8B
  51   } // Constant Pool
  52 
  53   0x0031; // access [ ACC_PUBLIC ACC_SUPER ACC_FINAL ]
  54   #7;// this_cpx
  55   #2;// super_cpx
  56 
  57   [1] { // Interfaces
  58     #9;
  59   } // Interfaces
  60 
  61   [0] { // fields
  62   } // fields
  63 
  64   [1] { // methods
  65     { // Member at 0xAA
  66       0x0001; // access
  67       #5; // name_cpx
  68       #6; // sig_cpx
  69       [1] { // Attributes
  70         Attr(#11, 29) { // Code at 0xB2
  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(#12, 6) { // LineNumberTable at 0xC9
  80               [1] { // LineNumberTable
  81                 0  26; //  at 0xD5
  82               }
  83             } // end LineNumberTable
  84           } // Attributes
  85         } // end Code
  86       } // Attributes
  87     } // Member
  88   } // methods
  89 
  90   [1] { // Attributes
  91     Attr(#13, 2) { // SourceFile at 0xD7
  92       #14;
  93     } // end SourceFile
  94   } // Attributes
  95 } // end class Pkg/notPermitted