Mercurial > hg > truffle
comparison test/compiler/7141637/SpreadNullArg.java @ 14215:567455579fe4
8029153: [TESTBUG] test/compiler/7141637/SpreadNullArg.java fails because it expects NullPointerException
Reviewed-by: twisti
author | iignatyev |
---|---|
date | Wed, 11 Dec 2013 01:09:04 +0400 |
parents | 392a3f07d567 |
children |
comparison
equal
deleted
inserted
replaced
14214:7683a2f8d7d4 | 14215:567455579fe4 |
---|---|
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 } |