From de53f6db4fe6c05bbc495cc59b5cf1c60bd73b70 Mon Sep 17 00:00:00 2001 From: iignatyev Date: Wed, 11 Dec 2013 01:09:04 +0400 Subject: [PATCH] 8029153: [TESTBUG] test/compiler/7141637/SpreadNullArg.java fails because it expects NullPointerException Reviewed-by: twisti --- test/compiler/7141637/SpreadNullArg.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/compiler/7141637/SpreadNullArg.java b/test/compiler/7141637/SpreadNullArg.java index 3f3524e19..195e106d5 100644 --- a/test/compiler/7141637/SpreadNullArg.java +++ b/test/compiler/7141637/SpreadNullArg.java @@ -46,13 +46,17 @@ public class SpreadNullArg { mh_spread_target = MethodHandles.lookup().findStatic(SpreadNullArg.class, "target_spread_arg", mt_ref_arg); result = (int) mh_spreadInvoker.invokeExact(mh_spread_target, (Object[]) null); - } catch(NullPointerException e) { - // Expected exception - do nothing! - } catch(Throwable e) { + throw new Error("Expected IllegalArgumentException was not thrown"); + } catch (IllegalArgumentException e) { + System.out.println("Expected exception : " + e); + } catch (Throwable e) { throw new Error(e); } - if (result != 42) throw new Error("Expected NullPointerException was not thrown"); + if (result != 42) { + throw new Error("result [" + result + + "] != 42 : Expected IllegalArgumentException was not thrown?"); + } } public static int target_spread_arg(Integer i1) { -- GitLab