test/hotspot/jtreg/vmTestbase/nsk/jvmti/RedefineClasses/StressRedefine.java
changeset 51269 b53d1f96b8c4
parent 51221 b65916c52e3c
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/RedefineClasses/StressRedefine.java	Tue Jul 31 14:24:10 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/RedefineClasses/StressRedefine.java	Tue Jul 31 15:57:52 2018 -0400
@@ -114,8 +114,8 @@
             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.