test/hotspot/jtreg/runtime/AccModule/ConstModule.java
author ssahoo
Wed, 04 Jul 2018 03:44:32 -0700
changeset 50936 00b16d0457e4
parent 49913 61dbbdd6b857
permissions -rw-r--r--
8205653: test/jdk/sun/management/jmxremote/bootstrap/RmiRegistrySslTest.java and RmiSslBootstrapTest.sh fail with handshake_failure Summary: Test failure due to unsupported DSA keys Reviewed-by: dfuchs, xuelei
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
44239
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
     1
/*
49913
61dbbdd6b857 8202204: Rename hotspot runtime jtreg constantPool ConstantPool directories
hseigel
parents: 47488
diff changeset
     2
 * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
44239
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
     4
 *
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
     7
 * published by the Free Software Foundation.
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
     8
 *
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    13
 * accompanied this code).
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    14
 *
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    18
 *
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    21
 * questions.
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    22
 */
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    23
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    24
import jdk.internal.org.objectweb.asm.*;
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    25
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    26
/*
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    27
 * @test
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    28
 * @summary Test scenarios for constant pool CONSTANT_Module and CONSTANT_Package
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    29
 *          types, for class file versions 53 and 52, when ACC_MODULE is set and
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    30
 *          not set in the access_flags.
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    31
 * @bug 8175383
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    32
 * @library /test/lib
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    33
 * @modules java.base/jdk.internal.org.objectweb.asm
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    34
 * @compile -XDignore.symbol.file ConstModule.java
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    35
 * @run main ConstModule
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    36
 */
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    37
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    38
public class ConstModule {
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    39
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    40
    static final int ACC_MODULE = 0x8000;
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    41
    static final boolean MODULE_TEST = true;
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    42
    static final boolean PACKAGE_TEST = false;
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    43
    static final boolean CFE_EXCEPTION = true;
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    44
    static final boolean NCDFE_EXCEPTION = false;
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    45
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    46
    public static void main(String[] args) throws Exception {
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    47
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    48
        // Test that the JVM throws CFE for constant pool CONSTANT_Module type, for
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    49
        // class file version 53, when ACC_MODULE is not set in the access_flags.
47488
2af7932c2f6f 8190287: Update JDK's internal ASM to ASMv6
ksrini
parents: 47216
diff changeset
    50
        ConstModule.write_and_load(Opcodes.V9,
44239
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    51
            Opcodes.ACC_INTERFACE + Opcodes.ACC_ABSTRACT + Opcodes.ACC_SYNTHETIC,
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    52
            "jdk.fooMod", "FooMod", MODULE_TEST, CFE_EXCEPTION);
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    53
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    54
        // Test that the JVM throws NCDFE for constant pool CONSTANT_Module type,
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    55
        // for class file version 53, when ACC_MODULE is set in the access_flags.
47488
2af7932c2f6f 8190287: Update JDK's internal ASM to ASMv6
ksrini
parents: 47216
diff changeset
    56
        ConstModule.write_and_load(Opcodes.V9,
44239
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    57
            Opcodes.ACC_INTERFACE + Opcodes.ACC_ABSTRACT + Opcodes.ACC_SYNTHETIC + ACC_MODULE,
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    58
            "jdk.fooModACC", "FooModACC", MODULE_TEST, NCDFE_EXCEPTION);
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    59
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    60
        // Test that the JVM throws CFE for constant pool CONSTANT_Module type, for
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    61
        // class file version 52, even when ACC_MODULE is set in the access_flags.
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    62
        ConstModule.write_and_load(Opcodes.V1_8,
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    63
            Opcodes.ACC_INTERFACE + Opcodes.ACC_ABSTRACT + Opcodes.ACC_SYNTHETIC + ACC_MODULE,
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    64
            "jdk.fooModACC52", "FooModACC52", MODULE_TEST, CFE_EXCEPTION);
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    65
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    66
        // Test that the JVM throws CFE for constant pool CONSTANT_Package type, for
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    67
        // class file version 53, when ACC_MODULE is not set in the access_flags.
47488
2af7932c2f6f 8190287: Update JDK's internal ASM to ASMv6
ksrini
parents: 47216
diff changeset
    68
        ConstModule.write_and_load(Opcodes.V9,
44239
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    69
            Opcodes.ACC_INTERFACE + Opcodes.ACC_ABSTRACT + Opcodes.ACC_SYNTHETIC,
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    70
            "jdk.fooPkg", "FooPkg", PACKAGE_TEST, CFE_EXCEPTION);
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    71
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    72
        // Test that the JVM throws NCDFE for constant pool CONSTANT_Package type,
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    73
        // for class file version 53, when ACC_MODULE is set in the access_flags.
47488
2af7932c2f6f 8190287: Update JDK's internal ASM to ASMv6
ksrini
parents: 47216
diff changeset
    74
        ConstModule.write_and_load(Opcodes.V9,
44239
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    75
            Opcodes.ACC_INTERFACE + Opcodes.ACC_ABSTRACT + Opcodes.ACC_SYNTHETIC + ACC_MODULE,
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    76
            "jdk.fooModACC", "FooModACC", PACKAGE_TEST, NCDFE_EXCEPTION);
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    77
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    78
        // Test that the JVM throws CFE for constant pool CONSTANT_Package type, for
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    79
        // class file version 52, even when ACC_MODULE is set in the access_flags.
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    80
        ConstModule.write_and_load(Opcodes.V1_8,
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    81
            Opcodes.ACC_INTERFACE + Opcodes.ACC_ABSTRACT + Opcodes.ACC_SYNTHETIC + ACC_MODULE,
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    82
            "jdk.fooModACC52", "FooModACC52", PACKAGE_TEST, CFE_EXCEPTION);
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    83
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    84
    }
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    85
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    86
    public static void write_and_load(int version,
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    87
                                      int access_flags,
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    88
                                      String attr,
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    89
                                      String class_name,
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    90
                                      boolean module_test,
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    91
                                      boolean throwCFE) throws Exception {
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    92
        ClassWriter cw = new ClassWriter(0);
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    93
        cw.visit(version,
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    94
                 access_flags,
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    95
                 class_name,
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    96
                 null,
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    97
                 "java/lang/Object",
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    98
                 null);
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
    99
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   100
        if (module_test)
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   101
            cw.visitAttribute(new TestModuleAttribute(attr));
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   102
        else
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   103
            cw.visitAttribute(new TestPackageAttribute(attr));
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   104
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   105
        cw.visitEnd();
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   106
        byte[] bytes = cw.toByteArray();
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   107
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   108
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   109
        ClassLoader loader = new ClassLoader(ConstModule.class.getClassLoader()) {
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   110
            @Override
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   111
            protected Class<?> findClass(String cn)throws ClassNotFoundException {
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   112
                if (cn.equals(class_name)) {
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   113
                    try {
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   114
                        Class superClass = super.defineClass(cn, bytes, 0, bytes.length);
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   115
                        throw new RuntimeException("Expected ClassFormatError not thrown");
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   116
                    } catch (java.lang.ClassFormatError e) {
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   117
                       if (!throwCFE) {
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   118
                           throw new RuntimeException("Unexpected ClassFormatError exception: " + e.getMessage());
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   119
                       }
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   120
                       if (module_test && !e.getMessage().contains(
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   121
                           "Unknown constant tag 19 in class file")) {
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   122
                           throw new RuntimeException("Wrong ClassFormatError exception: " + e.getMessage());
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   123
                       } else if (!module_test && !e.getMessage().contains(
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   124
                           "Unknown constant tag 20 in class file")) {
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   125
                           throw new RuntimeException("Wrong ClassFormatError exception: " + e.getMessage());
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   126
                       }
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   127
                    } catch (java.lang.NoClassDefFoundError f) {
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   128
                       if (throwCFE) {
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   129
                           throw new RuntimeException("Unexpected NoClassDefFoundError exception: " + f.getMessage());
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   130
                       }
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   131
                       if (!f.getMessage().contains(
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   132
                           "is not a class because access_flag ACC_MODULE is set")) {
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   133
                           throw new RuntimeException("Wrong NoClassDefFoundError exception: " + f.getMessage());
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   134
                       }
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   135
                    }
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   136
                } else {
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   137
                    throw new ClassNotFoundException(cn);
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   138
                }
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   139
                return null;
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   140
            }
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   141
        };
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   142
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   143
        Class<?> clazz = loader.loadClass(class_name);
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   144
    }
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   145
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   146
    /**
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   147
     * ConstModuleAttr attribute.
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   148
     *
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   149
     * <pre> {@code
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   150
     *
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   151
     * MainClass_attribute {
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   152
     *   // index to CONSTANT_utf8_info structure in constant pool representing
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   153
     *   // the string "ConstModuleAttr"
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   154
     *   u2 attribute_name_index;
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   155
     *   u4 attribute_length;
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   156
     *
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   157
     *   // index to CONSTANT_Module_info structure
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   158
     *   u2 module_name_index
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   159
     * }
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   160
     *
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   161
     * } </pre>
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   162
     */
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   163
    public static class TestModuleAttribute extends Attribute {
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   164
        private final String moduleName;
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   165
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   166
        public TestModuleAttribute(String moduleName) {
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   167
            super("ConstModuleAttr");
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   168
            this.moduleName = moduleName;
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   169
        }
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   170
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   171
        public TestModuleAttribute() {
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   172
            this(null);
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   173
        }
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   174
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   175
        @Override
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   176
        protected Attribute read(ClassReader cr,
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   177
                                 int off,
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   178
                                 int len,
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   179
                                 char[] buf,
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   180
                                 int codeOff,
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   181
                                 Label[] labels)
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   182
        {
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   183
            String mn = cr.readModule(off, buf);
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   184
            off += 2;
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   185
            return new TestModuleAttribute(mn);
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   186
        }
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   187
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   188
        @Override
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   189
        protected ByteVector write(ClassWriter cw,
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   190
                                   byte[] code,
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   191
                                   int len,
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   192
                                   int maxStack,
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   193
                                   int maxLocals)
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   194
        {
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   195
            ByteVector attr = new ByteVector();
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   196
            attr.putShort(cw.newModule(moduleName));
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   197
            return attr;
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   198
        }
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   199
    }
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   200
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   201
    /**
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   202
     * ConstPackageAttr attribute.
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   203
     *
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   204
     * <pre> {@code
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   205
     *
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   206
     * MainClass_attribute {
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   207
     *   // index to CONSTANT_utf8_info structure in constant pool representing
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   208
     *   // the string "ConstPackageAttr"
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   209
     *   u2 attribute_name_index;
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   210
     *   u4 attribute_length;
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   211
     *
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   212
     *   // index to CONSTANT_Package_info structure
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   213
     *   u2 module_name_index
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   214
     * }
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   215
     *
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   216
     * } </pre>
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   217
     */
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   218
    public static class TestPackageAttribute extends Attribute {
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   219
        private final String packageName;
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   220
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   221
        public TestPackageAttribute(String packageName) {
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   222
            super("ConstPackageAttr");
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   223
            this.packageName = packageName;
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   224
        }
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   225
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   226
        public TestPackageAttribute() {
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   227
            this(null);
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   228
        }
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   229
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   230
        @Override
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   231
        protected Attribute read(ClassReader cr,
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   232
                                 int off,
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   233
                                 int len,
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   234
                                 char[] buf,
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   235
                                 int codeOff,
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   236
                                 Label[] labels)
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   237
        {
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   238
            String mn = cr.readPackage(off, buf);
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   239
            off += 2;
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   240
            return new TestPackageAttribute(mn);
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   241
        }
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   242
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   243
        @Override
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   244
        protected ByteVector write(ClassWriter cw,
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   245
                                   byte[] code,
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   246
                                   int len,
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   247
                                   int maxStack,
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   248
                                   int maxLocals)
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   249
        {
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   250
            ByteVector attr = new ByteVector();
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   251
            attr.putShort(cw.newPackage(packageName));
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   252
            return attr;
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   253
        }
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   254
    }
fdd97dc2367b 8175383: JVM should throw NCDFE if ACC_MODULE and CONSTANT_Module/Package are set
hseigel
parents:
diff changeset
   255
}