test/hotspot/jtreg/runtime/Nestmates/classFileParsing/TwoNestHost.jcod
changeset 50735 2f2af62dfac7
equal deleted inserted replaced
50734:0828a0f6676b 50735:2f2af62dfac7
       
     1 /*
       
     2  * Copyright (c) 2017, 2018, 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 /* Source: NestmateAttributeHolder.java
       
    25 
       
    26 public class NestmateAttributeHolder {
       
    27     public static class TwoNestHost {
       
    28     }
       
    29 }
       
    30 */
       
    31 
       
    32 // Add second NestHost attribute - should fail parsing
       
    33 class NestmateAttributeHolder$TwoNestHost {
       
    34   0xCAFEBABE;
       
    35   0; // minor version
       
    36   55; // version
       
    37   [] { // Constant Pool
       
    38     ; // first element is empty
       
    39     Method #3 #12; // #1    
       
    40     class #13; // #2    
       
    41     class #16; // #3    
       
    42     Utf8 "<init>"; // #4    
       
    43     Utf8 "()V"; // #5    
       
    44     Utf8 "Code"; // #6    
       
    45     Utf8 "LineNumberTable"; // #7    
       
    46     Utf8 "SourceFile"; // #8    
       
    47     Utf8 "NestmateAttributeHolder.java"; // #9    
       
    48     Utf8 "NestHost"; // #10    
       
    49     class #17; // #11    
       
    50     NameAndType #4 #5; // #12    
       
    51     Utf8 "NestmateAttributeHolder$TwoNestHost"; // #13    
       
    52     Utf8 "TwoNestHost"; // #14    
       
    53     Utf8 "InnerClasses"; // #15    
       
    54     Utf8 "java/lang/Object"; // #16    
       
    55     Utf8 "NestmateAttributeHolder"; // #17    
       
    56   } // Constant Pool
       
    57 
       
    58   0x0021; // access
       
    59   #2;// this_cpx
       
    60   #3;// super_cpx
       
    61 
       
    62   [] { // Interfaces
       
    63   } // Interfaces
       
    64 
       
    65   [] { // fields
       
    66   } // fields
       
    67 
       
    68   [] { // methods
       
    69     { // Member
       
    70       0x0001; // access
       
    71       #4; // name_cpx
       
    72       #5; // sig_cpx
       
    73       [] { // Attributes
       
    74         Attr(#6) { // Code
       
    75           1; // max_stack
       
    76           1; // max_locals
       
    77           Bytes[]{
       
    78             0x2AB70001B1;
       
    79           };
       
    80           [] { // Traps
       
    81           } // end Traps
       
    82           [] { // Attributes
       
    83             Attr(#7) { // LineNumberTable
       
    84               [] { // LineNumberTable
       
    85                 0  2;
       
    86               }
       
    87             } // end LineNumberTable
       
    88           } // Attributes
       
    89         } // end Code
       
    90       } // Attributes
       
    91     } // Member
       
    92   } // methods
       
    93 
       
    94   [] { // Attributes
       
    95     Attr(#8) { // SourceFile
       
    96       #9;
       
    97     } // end SourceFile
       
    98     ;
       
    99     Attr(#10) { // NestHost
       
   100       0x000B;
       
   101     } // end NestHost
       
   102     ;
       
   103     Attr(#10) { // NestHost
       
   104       0x000B;
       
   105     } // end NestHost
       
   106     ;
       
   107     Attr(#15) { // InnerClasses
       
   108       [] { // InnerClasses
       
   109         #2 #11 #14 9;
       
   110       }
       
   111     } // end InnerClasses
       
   112   } // Attributes
       
   113 } // end class NestmateAttributeHolder$TwoNestHost