test/compiler/7141637/SpreadNullArg.java

changeset 6175
62084ffe573b
parent 3501
392a3f07d567
child 6876
710a3c8b516e
     1.1 --- a/test/compiler/7141637/SpreadNullArg.java	Wed Dec 11 01:04:34 2013 +0400
     1.2 +++ b/test/compiler/7141637/SpreadNullArg.java	Wed Dec 11 01:09:04 2013 +0400
     1.3 @@ -46,13 +46,17 @@
     1.4        mh_spread_target =
     1.5          MethodHandles.lookup().findStatic(SpreadNullArg.class, "target_spread_arg", mt_ref_arg);
     1.6        result = (int) mh_spreadInvoker.invokeExact(mh_spread_target, (Object[]) null);
     1.7 -    } catch(NullPointerException e) {
     1.8 -      // Expected exception - do nothing!
     1.9 -    } catch(Throwable e) {
    1.10 +      throw new Error("Expected IllegalArgumentException was not thrown");
    1.11 +    } catch (IllegalArgumentException e) {
    1.12 +      System.out.println("Expected exception : " + e);
    1.13 +    } catch (Throwable e) {
    1.14        throw new Error(e);
    1.15      }
    1.16  
    1.17 -    if (result != 42) throw new Error("Expected NullPointerException was not thrown");
    1.18 +    if (result != 42) {
    1.19 +      throw new Error("result [" + result
    1.20 +        + "] != 42 : Expected IllegalArgumentException was not thrown?");
    1.21 +    }
    1.22    }
    1.23  
    1.24    public static int target_spread_arg(Integer i1) {

mercurial