< prev index next >

test/compiler/jsr292/methodHandleExceptions/TestAMEnotNPE.java

Print this page
rev 11557 : 8132919: use package in compiler tests
Reviewed-by: duke


   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 import java.lang.reflect.InvocationTargetException;
  25 import java.lang.reflect.Method;
  26 import java.util.ArrayList;
  27 import java.util.List;
  28 import jdk.internal.org.objectweb.asm.ClassWriter;
  29 import jdk.internal.org.objectweb.asm.Handle;
  30 import jdk.internal.org.objectweb.asm.MethodVisitor;
  31 import jdk.internal.org.objectweb.asm.Opcodes;
  32 import p.Dok;
  33 
  34 /**
  35  * @test @bug 8025260 8016839

  36  * @summary Ensure that AbstractMethodError and IllegalAccessError are thrown appropriately, not NullPointerException
  37  *
  38  * @modules java.base/jdk.internal.org.objectweb.asm
  39  * @compile -XDignore.symbol.file TestAMEnotNPE.java ByteClassLoader.java p/C.java p/Dok.java p/E.java p/F.java p/I.java p/Tdirect.java p/Treflect.java
  40  *
  41  * @run main/othervm TestAMEnotNPE
  42  * @run main/othervm -Xint TestAMEnotNPE
  43  * @run main/othervm -Xcomp TestAMEnotNPE

  44  */
  45 public class TestAMEnotNPE implements Opcodes {
  46 




























  47     static boolean writeJarFiles = false;
  48     static boolean readJarFiles = false;
  49 
  50     /**
  51      * Optional command line parameter (any case-insensitive prefix of)
  52      * "writejarfiles" or "readjarfiles".
  53      *
  54      * "Writejarfiles" creates a jar file for each different set of tested classes.
  55      * "Readjarfiles" causes the classloader to use the copies of the classes
  56      * found in the corresponding jar files.
  57      *
  58      * Jarfilenames look something like pD_ext_pF (p.D extends p.F)
  59      * and qD_m_pp_imp_pI (q.D with package-private m implements p.I)
  60      *
  61      */
  62     public static void main(String args[]) throws Throwable {
  63         ArrayList<Throwable> lt = new ArrayList<Throwable>();
  64 
  65         if (args.length > 0) {
  66             String a0 = args[0].toLowerCase();




   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 /**
  26  * @test
  27  * @bug 8025260 8016839
  28  * @summary Ensure that AbstractMethodError and IllegalAccessError are thrown appropriately, not NullPointerException

  29  * @modules java.base/jdk.internal.org.objectweb.asm
  30  * @library / .
  31  *
  32  * @build p.*
  33  * @run main/othervm compiler.jsr292.methodHandleExceptions.TestAMEnotNPE
  34  * @run main/othervm -Xint compiler.jsr292.methodHandleExceptions.TestAMEnotNPE
  35  * @run main/othervm -Xcomp compiler.jsr292.methodHandleExceptions.TestAMEnotNPE
  36  */

  37 
  38 package compiler.jsr292.methodHandleExceptions;
  39 
  40 import p.Dok;
  41 import jdk.internal.org.objectweb.asm.ClassWriter;
  42 import jdk.internal.org.objectweb.asm.Handle;
  43 import jdk.internal.org.objectweb.asm.MethodVisitor;
  44 import jdk.internal.org.objectweb.asm.Opcodes;
  45 
  46 import java.lang.reflect.InvocationTargetException;
  47 import java.lang.reflect.Method;
  48 import java.util.ArrayList;
  49 import java.util.List;
  50 
  51 import static jdk.internal.org.objectweb.asm.Opcodes.ACC_PRIVATE;
  52 import static jdk.internal.org.objectweb.asm.Opcodes.ACC_PUBLIC;
  53 import static jdk.internal.org.objectweb.asm.Opcodes.ACC_STATIC;
  54 import static jdk.internal.org.objectweb.asm.Opcodes.ACC_SUPER;
  55 import static jdk.internal.org.objectweb.asm.Opcodes.ALOAD;
  56 import static jdk.internal.org.objectweb.asm.Opcodes.ILOAD;
  57 import static jdk.internal.org.objectweb.asm.Opcodes.INVOKESPECIAL;
  58 import static jdk.internal.org.objectweb.asm.Opcodes.INVOKEVIRTUAL;
  59 import static jdk.internal.org.objectweb.asm.Opcodes.IRETURN;
  60 import static jdk.internal.org.objectweb.asm.Opcodes.LLOAD;
  61 import static jdk.internal.org.objectweb.asm.Opcodes.RETURN;
  62 import static jdk.internal.org.objectweb.asm.Opcodes.V1_8;
  63 
  64 public class TestAMEnotNPE {
  65 
  66     static boolean writeJarFiles = false;
  67     static boolean readJarFiles = false;
  68 
  69     /**
  70      * Optional command line parameter (any case-insensitive prefix of)
  71      * "writejarfiles" or "readjarfiles".
  72      *
  73      * "Writejarfiles" creates a jar file for each different set of tested classes.
  74      * "Readjarfiles" causes the classloader to use the copies of the classes
  75      * found in the corresponding jar files.
  76      *
  77      * Jarfilenames look something like pD_ext_pF (p.D extends p.F)
  78      * and qD_m_pp_imp_pI (q.D with package-private m implements p.I)
  79      *
  80      */
  81     public static void main(String args[]) throws Throwable {
  82         ArrayList<Throwable> lt = new ArrayList<Throwable>();
  83 
  84         if (args.length > 0) {
  85             String a0 = args[0].toLowerCase();


< prev index next >