test/hotspot/jtreg/vmTestbase/nsk/jvmti/RedefineClasses/StressRedefine.java
changeset 51269 b53d1f96b8c4
parent 51221 b65916c52e3c
equal deleted inserted replaced
51268:4ac20e5f96ce 51269:b53d1f96b8c4
   112     private static void runMethod(Random random, String name) {
   112     private static void runMethod(Random random, String name) {
   113         while (stresser.continueExecution()) {
   113         while (stresser.continueExecution()) {
   114             try {
   114             try {
   115                 // Just for fun we transfer parameters to method
   115                 // Just for fun we transfer parameters to method
   116                 Object res = myClass.getMethod(name, double.class, int.class, Object.class)
   116                 Object res = myClass.getMethod(name, double.class, int.class, Object.class)
   117                                          .invoke(null, random.nextDouble(), random.nextInt(), new Object());
   117                                          .invoke(myClass.newInstance(), random.nextDouble(), random.nextInt(), new Object());
   118              } catch (IllegalArgumentException | InvocationTargetException
   118              } catch (IllegalArgumentException | InvocationTargetException | InstantiationException
   119                      | IllegalAccessException | NoSuchMethodException e) {
   119                      | IllegalAccessException | NoSuchMethodException e) {
   120                  // It's okay to get exception here since we are corrupting bytecode and can't expect
   120                  // It's okay to get exception here since we are corrupting bytecode and can't expect
   121                  // class to work properly.
   121                  // class to work properly.
   122                  System.out.println("Got expected exception: " + e.toString());
   122                  System.out.println("Got expected exception: " + e.toString());
   123              }
   123              }