1 /*
   2  * Copyright (c) 2010, 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 
  25 // A simple class to extend an abstract class and get loaded with different
  26 // loaders.  This class is loaded via Loader2.  A similar named class will
  27 // be loaded via the bootstrap loader.
  28 //
  29 // The following code is implemented as java assembler to avoid checks
  30 // of javac.
  31 //
  32 // public class LE2_D_ambgs extends bug_21227 {
  33 //  
  34 //     LE2_D_ambgs() {
  35 //         _ref_to_be_p0wned = LE2_C._p0wnee;
  36 //         System.out.println("Gonna hack this thing");
  37 //     }
  38 //
  39 //     public LE2_D_ambgs[] make(LE2_A iface) { 
  40 //         throw new Error("do not call me");
  41 //     }
  42 // }
  43 
  44 class LE2_D_ambgs extends LE2_C {
  45 
  46     Method LE2_D_ambgs:"()V"
  47         stack 2 locals 1
  48     {
  49         aload_0;
  50         invokespecial Method LE2_C."<init>":"()V";
  51         getstatic     Field java/lang/System.out:"Ljava/io/PrintStream;";
  52         ldc           String "Gonna hack this thing";
  53         invokevirtual Method java/io/PrintStream.println:"(Ljava/lang/String;)V";
  54         return;
  55     }
  56 
  57     public Method make:"(LLE2_A;)[LLE2_D_ambgs;"
  58         stack 3 locals 2
  59     {
  60          new           class java/lang/Error;
  61          dup;
  62          ldc           String "do not call me";
  63          invokespecial Method java/lang/Error."<init>":"(Ljava/lang/String;)V";
  64          athrow;
  65     }
  66 }