jdk/test/java/beans/Statement/ClassForName/ClassForName.java
author serb
Mon, 06 Jun 2016 18:28:46 +0300
changeset 39029 e4c4b4fb2723
permissions -rw-r--r--
8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly Reviewed-by: prr, ahgross, alexsch
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
39029
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
     1
/*
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
     2
 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
     4
 *
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
     7
 * published by the Free Software Foundation.
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
     8
 *
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    13
 * accompanied this code).
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    14
 *
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    18
 *
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    21
 * questions.
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    22
 */
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    23
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    24
import java.beans.Expression;
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    25
import java.beans.Statement;
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    26
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    27
/**
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    28
 * @test
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    29
 * @bug 8146313
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    30
 * @run main/othervm ClassForName
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    31
 * @run main/othervm/policy=java.policy -Djava.security.manager ClassForName
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    32
 */
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    33
public final class ClassForName {
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    34
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    35
    static boolean initialized;
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    36
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    37
    static final String[] classes = {
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    38
            "A.A", "java.lang.String", "ClassForName$Bean", "sun.awt.SunToolkit"
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    39
    };
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    40
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    41
    static final ClassLoader appl = new Object() {}.getClass().getClassLoader();
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    42
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    43
    static final ClassLoader[] loaders = {
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    44
            String.class.getClassLoader(), null, appl
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    45
    };
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    46
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    47
    static boolean[] inits = {false, true};
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    48
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    49
    public static void main(final String[] args) throws Exception {
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    50
        // Check that the Class.forName(name, boolean, classloader) is executed
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    51
        // when requested via JavaBeans
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    52
        simpleTest();
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    53
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    54
        // Check that the Class.forName and Expression returns the same classes
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    55
        for (final String cls : classes) {
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    56
            complexTest1Args(cls);
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    57
            for (final ClassLoader loader : loaders) {
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    58
                for (final boolean init : inits) {
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    59
                    complexTest3Args(cls, loader, init);
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    60
                }
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    61
            }
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    62
        }
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    63
    }
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    64
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    65
    private static void simpleTest() throws Exception {
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    66
        // load the class without initialization
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    67
        new Statement(Class.class, "forName", new Object[]{
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    68
                "ClassForName$Bean", false, Bean.class.getClassLoader()
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    69
        }).execute();
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    70
        if (initialized) {
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    71
            throw new RuntimeException("Should not be initialized");
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    72
        }
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    73
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    74
        // load the class and initialize it
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    75
        new Statement(Class.class, "forName", new Object[]{
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    76
                "ClassForName$Bean", true, Bean.class.getClassLoader()
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    77
        }).execute();
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    78
        if (!initialized) {
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    79
            throw new RuntimeException("Should be initialized");
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    80
        }
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    81
    }
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    82
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    83
    private static void complexTest1Args(final String cls) {
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    84
        // load via standard Class.forName();
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    85
        Class<?> classForName = null;
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    86
        try {
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    87
            classForName = Class.forName(cls);
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    88
        } catch (final Exception ignored) {
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    89
        }
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    90
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    91
        // load via Expression.execute()
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    92
        Class<?> classStatement = null;
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    93
        try {
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    94
            final Expression exp = new Expression(Class.class, "forName",
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    95
                                                  new Object[]{
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    96
                                                          cls
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    97
                                                  });
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    98
            exp.execute();
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
    99
            classStatement = (Class<?>) exp.getValue();
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   100
        } catch (final Exception ignored) {
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   101
        }
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   102
        if (classForName != classStatement) {
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   103
            System.err.println(classForName);
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   104
            System.err.println(classStatement);
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   105
            throw new RuntimeException();
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   106
        }
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   107
    }
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   108
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   109
    private static void complexTest3Args(final String cls,
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   110
                                         final ClassLoader loader,
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   111
                                         final boolean init) {
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   112
        // load via standard Class.forName();
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   113
        Class<?> classForName = null;
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   114
        Class<?> excForName = null;
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   115
        try {
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   116
            classForName = Class.forName(cls, init, loader);
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   117
        } catch (final Exception e) {
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   118
            excForName = e.getClass();
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   119
        }
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   120
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   121
        // load via Expression.execute()
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   122
        Class<?> classStatement = null;
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   123
        Class<?> excStatement = null;
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   124
        try {
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   125
            final Expression exp = new Expression(Class.class, "forName",
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   126
                                                  new Object[]{
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   127
                                                          cls, init, loader
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   128
                                                  });
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   129
            exp.execute();
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   130
            classStatement = (Class<?>) exp.getValue();
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   131
        } catch (final Exception e) {
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   132
            excStatement = e.getClass();
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   133
        }
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   134
        if (classForName != classStatement) {
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   135
            System.err.println(classForName);
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   136
            System.err.println(classStatement);
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   137
            throw new RuntimeException();
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   138
        }
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   139
        if (excForName != excStatement) {
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   140
            System.err.println(excForName);
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   141
            System.err.println(excStatement);
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   142
            throw new RuntimeException();
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   143
        }
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   144
    }
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   145
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   146
    public static final class Bean {
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   147
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   148
        static {
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   149
            initialized = true;
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   150
        }
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   151
    }
e4c4b4fb2723 8146313: The java.beans.Statement.invoke() method handles 3-arg Class.forName incorrectly
serb
parents:
diff changeset
   152
}