44 |
44 |
45 try { |
45 try { |
46 mh_spread_target = |
46 mh_spread_target = |
47 MethodHandles.lookup().findStatic(SpreadNullArg.class, "target_spread_arg", mt_ref_arg); |
47 MethodHandles.lookup().findStatic(SpreadNullArg.class, "target_spread_arg", mt_ref_arg); |
48 result = (int) mh_spreadInvoker.invokeExact(mh_spread_target, (Object[]) null); |
48 result = (int) mh_spreadInvoker.invokeExact(mh_spread_target, (Object[]) null); |
49 } catch(NullPointerException e) { |
49 throw new Error("Expected IllegalArgumentException was not thrown"); |
50 // Expected exception - do nothing! |
50 } catch (IllegalArgumentException e) { |
51 } catch(Throwable e) { |
51 System.out.println("Expected exception : " + e); |
|
52 } catch (Throwable e) { |
52 throw new Error(e); |
53 throw new Error(e); |
53 } |
54 } |
54 |
55 |
55 if (result != 42) throw new Error("Expected NullPointerException was not thrown"); |
56 if (result != 42) { |
|
57 throw new Error("result [" + result |
|
58 + "] != 42 : Expected IllegalArgumentException was not thrown?"); |
|
59 } |
56 } |
60 } |
57 |
61 |
58 public static int target_spread_arg(Integer i1) { |
62 public static int target_spread_arg(Integer i1) { |
59 return i1.intValue(); |
63 return i1.intValue(); |
60 } |
64 } |