3427N/A/*
3427N/A * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
3427N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3427N/A *
3427N/A * This code is free software; you can redistribute it and/or modify it
3427N/A * under the terms of the GNU General Public License version 2 only, as
3427N/A * published by the Free Software Foundation.
3427N/A *
3427N/A * This code is distributed in the hope that it will be useful, but WITHOUT
3427N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3427N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3427N/A * version 2 for more details (a copy is included in the LICENSE file that
3427N/A * accompanied this code).
3427N/A *
3427N/A * You should have received a copy of the GNU General Public License version
3427N/A * 2 along with this work; if not, write to the Free Software Foundation,
3427N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3427N/A *
3427N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
3427N/A * or visit www.oracle.com if you need additional information or have any
3427N/A * questions.
3427N/A */
3427N/A
3427N/A/*
3427N/A * @test Test7160757.java
3427N/A * @bug 7160757
3427N/A * @summary Tests that superclass initialization is not skipped
3427N/A */
3427N/A
3427N/Apublic class Test7160757 {
3427N/A
3427N/A public static void main(String args[]) throws Exception {
3427N/A
3427N/A ClassLoader loader = new SLoader();
3427N/A try {
3427N/A Class.forName("S", true, loader);
3427N/A System.out.println("FAILED");
3427N/A throw new Exception("Should have thrown a VerifyError.");
3427N/A } catch (VerifyError e) {
3427N/A System.out.println(e);
3427N/A System.out.println("PASSED");
3427N/A }
3427N/A }
3427N/A
3427N/A static class SLoader extends ClassLoader {
3427N/A
3427N/A /**
3427N/A * public class S extends Throwable {
3427N/A * public S() {
3427N/A * aload_0
3427N/A * invokespecial Object.<init>()
3427N/A * return
3427N/A * }
3427N/A * }
3427N/A */
3427N/A static byte b(int i) { return (byte)i; }
3427N/A static byte S_class[] = {
3427N/A b(0xca), b(0xfe), b(0xba), b(0xbe), 0x00, 0x00, 0x00, 0x32,
3427N/A 0x00, 0x0c, 0x0a, 0x00, 0x0b, 0x00, 0x07, 0x07,
3427N/A 0x00, 0x08, 0x07, 0x00, 0x09, 0x01, 0x00, 0x06,
3427N/A 0x3c, 0x69, 0x6e, 0x69, 0x74, 0x3e, 0x01, 0x00,
3427N/A 0x03, 0x28, 0x29, 0x56, 0x01, 0x00, 0x04, 0x43,
3427N/A 0x6f, 0x64, 0x65, 0x0c, 0x00, 0x04, 0x00, 0x05,
3427N/A 0x01, 0x00, 0x01, 0x53, 0x01, 0x00, 0x13, 0x6a,
3427N/A 0x61, 0x76, 0x61, 0x2f, 0x6c, 0x61, 0x6e, 0x67,
3427N/A 0x2f, 0x54, 0x68, 0x72, 0x6f, 0x77, 0x61, 0x62,
3427N/A 0x6c, 0x65, 0x01, 0x00, 0x10, 0x6a, 0x61, 0x76,
3427N/A 0x61, 0x2f, 0x6c, 0x61, 0x6e, 0x67, 0x2f, 0x4f,
3427N/A 0x62, 0x6a, 0x65, 0x63, 0x74, 0x07, 0x00, 0x0a,
3427N/A 0x00, 0x21, 0x00, 0x02, 0x00, 0x03, 0x00, 0x00,
3427N/A 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x04,
3427N/A 0x00, 0x05, 0x00, 0x01, 0x00, 0x06, 0x00, 0x00,
3427N/A 0x00, 0x11, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00,
3427N/A 0x00, 0x05, 0x2a, b(0xb7), 0x00, 0x01, b(0xb1), 0x00,
3427N/A 0x00, 0x00, 0x00, 0x00, 0x00
3427N/A };
3427N/A
3427N/A public Class findClass(String name) throws ClassNotFoundException {
3427N/A return defineClass(name, S_class, 0, S_class.length);
3427N/A }
3427N/A }
3427N/A}