hotspot/test/runtime/finalStatic/FinalStatic.java
author hseigel
Fri, 24 Jan 2014 08:13:42 -0500
changeset 22534 520f7a937396
child 29678 dd2f3932c21e
permissions -rw-r--r--
8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass. Summary: Check if method is static before throwing exception. Reviewed-by: kamg, coleenp, lfoltan, fparain
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
22534
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
     1
/*
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
     2
 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
     4
 *
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
     7
 * published by the Free Software Foundation.
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
     8
 *
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    13
 * accompanied this code).
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    14
 *
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    18
 *
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    21
 * questions.
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    22
 */
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    23
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    24
/*
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    25
 * @test
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    26
 * @bug 8028553
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    27
 * @summary Test that VerifyError is not thrown when 'overriding' a static method.
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    28
 * @run main FinalStatic
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    29
 */
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    30
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    31
import java.lang.reflect.*;
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    32
import jdk.internal.org.objectweb.asm.ClassWriter;
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    33
import jdk.internal.org.objectweb.asm.MethodVisitor;
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    34
import jdk.internal.org.objectweb.asm.Opcodes;
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    35
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    36
/*
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    37
 *  class A { static final int m() {return FAIL; } }
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    38
 *  class B extends A { int m() { return PASS; } }
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    39
 *  class FinalStatic {
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    40
 *      public static void main () {
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    41
 *          Object b = new B();
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    42
 *          b.m();
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    43
 *      }
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    44
 *  }
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    45
 */
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    46
public class FinalStatic {
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    47
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    48
    static final String CLASS_NAME_A = "A";
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    49
    static final String CLASS_NAME_B = "B";
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    50
    static final int FAILED = 0;
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    51
    static final int EXPECTED = 1234;
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    52
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    53
    static class TestClassLoader extends ClassLoader implements Opcodes {
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    54
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    55
        @Override
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    56
        public Class findClass(String name) throws ClassNotFoundException {
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    57
            byte[] b;
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    58
            try {
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    59
                b = loadClassData(name);
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    60
            } catch (Throwable th) {
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    61
                // th.printStackTrace();
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    62
                throw new ClassNotFoundException("Loading error", th);
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    63
            }
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    64
            return defineClass(name, b, 0, b.length);
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    65
        }
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    66
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    67
        private byte[] loadClassData(String name) throws Exception {
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    68
            ClassWriter cw = new ClassWriter(0);
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    69
            MethodVisitor mv;
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    70
            switch (name) {
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    71
               case CLASS_NAME_A:
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    72
                    cw.visit(52, ACC_SUPER | ACC_PUBLIC, CLASS_NAME_A, null, "java/lang/Object", null);
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    73
                    {
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    74
                        mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    75
                        mv.visitCode();
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    76
                        mv.visitVarInsn(ALOAD, 0);
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    77
                        mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V");
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    78
                        mv.visitInsn(RETURN);
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    79
                        mv.visitMaxs(1, 1);
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    80
                        mv.visitEnd();
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    81
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    82
                        mv = cw.visitMethod(ACC_FINAL | ACC_STATIC, "m", "()I", null, null);
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    83
                        mv.visitCode();
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    84
                        mv.visitLdcInsn(FAILED);
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    85
                        mv.visitInsn(IRETURN);
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    86
                        mv.visitMaxs(1, 1);
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    87
                        mv.visitEnd();
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    88
                    }
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    89
                    break;
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    90
                case CLASS_NAME_B:
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    91
                    cw.visit(52, ACC_SUPER | ACC_PUBLIC, CLASS_NAME_B, null, CLASS_NAME_A, null);
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    92
                    {
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    93
                        mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    94
                        mv.visitCode();
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    95
                        mv.visitVarInsn(ALOAD, 0);
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    96
                        mv.visitMethodInsn(INVOKESPECIAL, CLASS_NAME_A, "<init>", "()V");
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    97
                        mv.visitInsn(RETURN);
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    98
                        mv.visitMaxs(1, 1);
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
    99
                        mv.visitEnd();
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   100
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   101
                        mv = cw.visitMethod(ACC_PUBLIC, "m", "()I", null, null);
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   102
                        mv.visitCode();
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   103
                        mv.visitLdcInsn(EXPECTED);
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   104
                        mv.visitInsn(IRETURN);
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   105
                        mv.visitMaxs(1, 1);
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   106
                        mv.visitEnd();
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   107
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   108
                    }
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   109
                    break;
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   110
                default:
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   111
                    break;
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   112
            }
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   113
            cw.visitEnd();
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   114
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   115
            return cw.toByteArray();
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   116
        }
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   117
    }
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   118
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   119
    public static void main(String[] args) throws Exception {
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   120
        TestClassLoader tcl = new TestClassLoader();
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   121
        Class<?> a = tcl.loadClass(CLASS_NAME_A);
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   122
        Class<?> b = tcl.loadClass(CLASS_NAME_B);
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   123
        Object inst = b.newInstance();
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   124
        Method[] meths = b.getDeclaredMethods();
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   125
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   126
        Method m = meths[0];
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   127
        int mod = m.getModifiers();
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   128
        if ((mod & Modifier.FINAL) != 0) {
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   129
            throw new Exception("FAILED: " + m + " is FINAL");
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   130
        }
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   131
        if ((mod & Modifier.STATIC) != 0) {
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   132
            throw new Exception("FAILED: " + m + " is STATIC");
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   133
        }
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   134
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   135
        m.setAccessible(true);
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   136
        if (!m.invoke(inst).equals(EXPECTED)) {
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   137
              throw new Exception("FAILED: " + EXPECTED + " from " + m);
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   138
        }
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   139
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   140
        System.out.println("Passed.");
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   141
    }
520f7a937396 8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass.
hseigel
parents:
diff changeset
   142
}