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