diff -r ff9031a745d9 -r ee0850472ca1 langtools/test/tools/javac/meth/InvokeMH.java --- a/langtools/test/tools/javac/meth/InvokeMH.java Wed Jul 05 17:11:12 2017 +0200 +++ b/langtools/test/tools/javac/meth/InvokeMH.java Sat May 01 15:05:39 2010 -0700 @@ -48,28 +48,56 @@ void test(MethodHandle mh_SiO, MethodHandle mh_vS, MethodHandle mh_vi, - MethodHandle mh_vv) { + MethodHandle mh_vv) throws Throwable { Object o; String s; int i; // for return type testing // next five must have sig = (String,int)Object - mh_SiO.invoke("world", 123); - mh_SiO.invoke("mundus", 456); + mh_SiO.invokeExact("world", 123); + mh_SiO.invokeExact("mundus", 456); Object k = "kosmos"; - mh_SiO.invoke((String)k, 789); - o = mh_SiO.invoke((String)null, 000); - o = mh_SiO.invoke("arda", -123); + mh_SiO.invokeExact((String)k, 789); + o = mh_SiO.invokeExact((String)null, 000); + o = mh_SiO.invokeExact("arda", -123); // sig = ()String - s = mh_vS.invoke(); + s = mh_vS.invokeExact(); // sig = ()int - i = mh_vi.invoke(); - o = mh_vi.invoke(); - //s = mh_vi.invoke(); //BAD - mh_vi.invoke(); + i = mh_vi.invokeExact(); + o = mh_vi.invokeExact(); + //s = mh_vi.invokeExact(); //BAD + mh_vi.invokeExact(); // sig = ()void - //o = mh_vv.invoke(); //BAD - mh_vv.invoke(); + //o = mh_vv.invokeExact(); //BAD + mh_vv.invokeExact(); + } + + void testGen(MethodHandle mh_SiO, + MethodHandle mh_vS, + MethodHandle mh_vi, + MethodHandle mh_vv) throws Throwable { + Object o; String s; int i; // for return type testing + + // next five must have sig = (*,*)* + mh_SiO.invokeGeneric((Object)"world", (Object)123); + mh_SiO.invokeGeneric((Object)"mundus", (Object)456); + Object k = "kosmos"; + mh_SiO.invokeGeneric(k, 789); + o = mh_SiO.invokeGeneric(null, 000); + o = mh_SiO.invokeGeneric("arda", -123); + + // sig = ()String + o = mh_vS.invokeGeneric(); + + // sig = ()int + i = mh_vi.invokeGeneric(); + o = mh_vi.invokeGeneric(); + //s = mh_vi.invokeGeneric(); //BAD + mh_vi.invokeGeneric(); + + // sig = ()void + //o = mh_vv.invokeGeneric(); //BAD + o = mh_vv.invokeGeneric(); } }