< prev index next >
test/hotspot/jtreg/vmTestbase/nsk/jvmti/RedefineClasses/StressRedefine.java
Print this page
@@ -112,12 +112,12 @@
private static void runMethod(Random random, String name) {
while (stresser.continueExecution()) {
try {
// Just for fun we transfer parameters to method
Object res = myClass.getMethod(name, double.class, int.class, Object.class)
- .invoke(null, random.nextDouble(), random.nextInt(), new Object());
- } catch (IllegalArgumentException | InvocationTargetException
+ .invoke(myClass.newInstance(), random.nextDouble(), random.nextInt(), new Object());
+ } catch (IllegalArgumentException | InvocationTargetException | InstantiationException
| IllegalAccessException | NoSuchMethodException e) {
// It's okay to get exception here since we are corrupting bytecode and can't expect
// class to work properly.
System.out.println("Got expected exception: " + e.toString());
}
< prev index next >