< prev index next >
test/hotspot/jtreg/runtime/cds/appcds/test-classes/RewriteBytecodes.java
Print this page
*** 21,38 ****
* questions.
*
*/
import java.io.File;
import sun.hotspot.WhiteBox;
public class RewriteBytecodes {
public static void main(String args[]) throws Throwable {
String from = "___xxx___";
String to = "___yyy___";
File clsFile = new File(args[0]);
! Class superClass = Util.defineModifiedClass(RewriteBytecodes.class.getClassLoader(), clsFile, from, to);
Child child = new Child();
if (child.getClass().getSuperclass() != superClass) {
throw new RuntimeException("Mismatched super class");
--- 21,39 ----
* questions.
*
*/
import java.io.File;
+ import java.lang.invoke.MethodHandles;
import sun.hotspot.WhiteBox;
public class RewriteBytecodes {
public static void main(String args[]) throws Throwable {
String from = "___xxx___";
String to = "___yyy___";
File clsFile = new File(args[0]);
! Class superClass = Util.defineModifiedClass(MethodHandles.lookup(), clsFile, from, to);
Child child = new Child();
if (child.getClass().getSuperclass() != superClass) {
throw new RuntimeException("Mismatched super class");
< prev index next >