blob: 5f7e54ca7a3ff1e374500713df5b20a0a474b0dc [file] [log] [blame]
jrose25aef892010-10-30 21:02:30 -07001/*
jmelvin75479992012-04-16 18:09:53 -04002 * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
jrose25aef892010-10-30 21:02:30 -07003 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26/* @test
jrose79e0a6c2011-05-12 19:27:33 -070027 * @summary unit tests for java.lang.invoke.MethodHandle.invoke
alanb499341f2011-09-10 14:55:14 +010028 * @compile InvokeGenericTest.java
jrose9633f5f2011-04-07 22:07:06 -070029 * @run junit/othervm test.java.lang.invoke.InvokeGenericTest
jrose25aef892010-10-30 21:02:30 -070030 */
31
jroseada69fa2011-03-23 23:02:31 -070032package test.java.lang.invoke;
jrose25aef892010-10-30 21:02:30 -070033
jroseada69fa2011-03-23 23:02:31 -070034import java.lang.invoke.*;
35import static java.lang.invoke.MethodHandles.*;
36import static java.lang.invoke.MethodType.*;
jrose25aef892010-10-30 21:02:30 -070037import java.lang.reflect.*;
38import java.util.*;
39import org.junit.*;
40import static org.junit.Assert.*;
41import static org.junit.Assume.*;
42
43
44/**
45 *
46 * @author jrose
47 */
jrose49494522012-01-18 17:34:29 -080048@SuppressWarnings("cast") // various casts help emphasize arguments to invokeExact
jrose25aef892010-10-30 21:02:30 -070049public class InvokeGenericTest {
50 // How much output?
51 static int verbosity = 0;
52 static {
jroseada69fa2011-03-23 23:02:31 -070053 String vstr = System.getProperty("test.java.lang.invoke.InvokeGenericTest.verbosity");
jrose25aef892010-10-30 21:02:30 -070054 if (vstr != null) verbosity = Integer.parseInt(vstr);
55 }
56
jrosebb3eb372011-05-17 19:48:14 -070057// public static void main(String... av) throws Throwable {
58// new InvokeGenericTest().testFirst();
59// }
jrose320b7692011-05-12 19:27:49 -070060
jrose25aef892010-10-30 21:02:30 -070061 @Test
62 public void testFirst() throws Throwable {
63 verbosity += 9; try {
64 // left blank for debugging
65 } finally { printCounts(); verbosity -= 9; }
66 }
67
68 public InvokeGenericTest() {
69 }
70
jrose25aef892010-10-30 21:02:30 -070071 String testName;
72 static int allPosTests, allNegTests;
73 int posTests, negTests;
74 @After
75 public void printCounts() {
76 if (verbosity >= 2 && (posTests | negTests) != 0) {
77 System.out.println();
78 if (posTests != 0) System.out.println("=== "+testName+": "+posTests+" positive test cases run");
79 if (negTests != 0) System.out.println("=== "+testName+": "+negTests+" negative test cases run");
80 allPosTests += posTests;
81 allNegTests += negTests;
82 posTests = negTests = 0;
83 }
84 }
85 void countTest(boolean positive) {
86 if (positive) ++posTests;
87 else ++negTests;
88 }
89 void countTest() { countTest(true); }
90 void startTest(String name) {
91 if (testName != null) printCounts();
92 if (verbosity >= 1)
jrose320b7692011-05-12 19:27:49 -070093 System.out.println("["+name+"]");
jrose25aef892010-10-30 21:02:30 -070094 posTests = negTests = 0;
95 testName = name;
96 }
97
98 @BeforeClass
99 public static void setUpClass() throws Exception {
100 calledLog.clear();
101 calledLog.add(null);
102 nextArgVal = INITIAL_ARG_VAL;
103 }
104
105 @AfterClass
106 public static void tearDownClass() throws Exception {
107 int posTests = allPosTests, negTests = allNegTests;
108 if (verbosity >= 2 && (posTests | negTests) != 0) {
109 System.out.println();
110 if (posTests != 0) System.out.println("=== "+posTests+" total positive test cases");
111 if (negTests != 0) System.out.println("=== "+negTests+" total negative test cases");
112 }
113 }
114
jrose49494522012-01-18 17:34:29 -0800115 static List<Object> calledLog = new ArrayList<>();
jrose25aef892010-10-30 21:02:30 -0700116 static Object logEntry(String name, Object... args) {
117 return Arrays.asList(name, Arrays.asList(args));
118 }
119 static Object called(String name, Object... args) {
120 Object entry = logEntry(name, args);
121 calledLog.add(entry);
122 return entry;
123 }
124 static void assertCalled(String name, Object... args) {
125 Object expected = logEntry(name, args);
126 Object actual = calledLog.get(calledLog.size() - 1);
127 if (expected.equals(actual) && verbosity < 9) return;
128 System.out.println("assertCalled "+name+":");
129 System.out.println("expected: "+expected);
130 System.out.println("actual: "+actual);
131 System.out.println("ex. types: "+getClasses(expected));
132 System.out.println("act. types: "+getClasses(actual));
133 assertEquals("previous method call", expected, actual);
134 }
135 static void printCalled(MethodHandle target, String name, Object... args) {
136 if (verbosity >= 3)
137 System.out.println("calling MH="+target+" to "+name+Arrays.toString(args));
138 }
139
140 static Object castToWrapper(Object value, Class<?> dst) {
141 Object wrap = null;
142 if (value instanceof Number)
143 wrap = castToWrapperOrNull(((Number)value).longValue(), dst);
144 if (value instanceof Character)
145 wrap = castToWrapperOrNull((char)(Character)value, dst);
146 if (wrap != null) return wrap;
147 return dst.cast(value);
148 }
149
150 static Object castToWrapperOrNull(long value, Class<?> dst) {
151 if (dst == int.class || dst == Integer.class)
152 return (int)(value);
153 if (dst == long.class || dst == Long.class)
154 return (long)(value);
155 if (dst == char.class || dst == Character.class)
156 return (char)(value);
157 if (dst == short.class || dst == Short.class)
158 return (short)(value);
159 if (dst == float.class || dst == Float.class)
160 return (float)(value);
161 if (dst == double.class || dst == Double.class)
162 return (double)(value);
163 if (dst == byte.class || dst == Byte.class)
164 return (byte)(value);
165 if (dst == boolean.class || dst == boolean.class)
166 return ((value % 29) & 1) == 0;
167 return null;
168 }
169
170 static final int ONE_MILLION = (1000*1000), // first int value
171 TEN_BILLION = (10*1000*1000*1000), // scale factor to reach upper 32 bits
172 INITIAL_ARG_VAL = ONE_MILLION << 1; // <<1 makes space for sign bit;
173 static long nextArgVal;
174 static long nextArg(boolean moreBits) {
175 long val = nextArgVal++;
176 long sign = -(val & 1); // alternate signs
177 val >>= 1;
178 if (moreBits)
179 // Guarantee some bits in the high word.
180 // In any case keep the decimal representation simple-looking,
181 // with lots of zeroes, so as not to make the printed decimal
182 // strings unnecessarily noisy.
183 val += (val % ONE_MILLION) * TEN_BILLION;
184 return val ^ sign;
185 }
186 static int nextArg() {
187 // Produce a 32-bit result something like ONE_MILLION+(smallint).
188 // Example: 1_000_042.
189 return (int) nextArg(false);
190 }
191 static long nextArg(Class<?> kind) {
192 if (kind == long.class || kind == Long.class ||
193 kind == double.class || kind == Double.class)
194 // produce a 64-bit result something like
195 // ((TEN_BILLION+1) * (ONE_MILLION+(smallint)))
196 // Example: 10_000_420_001_000_042.
197 return nextArg(true);
198 return (long) nextArg();
199 }
200
201 static Object randomArg(Class<?> param) {
202 Object wrap = castToWrapperOrNull(nextArg(param), param);
203 if (wrap != null) {
204 return wrap;
205 }
jroseada69fa2011-03-23 23:02:31 -0700206// import sun.invoke.util.Wrapper;
jrose25aef892010-10-30 21:02:30 -0700207// Wrapper wrap = Wrapper.forBasicType(dst);
208// if (wrap == Wrapper.OBJECT && Wrapper.isWrapperType(dst))
209// wrap = Wrapper.forWrapperType(dst);
210// if (wrap != Wrapper.OBJECT)
211// return wrap.wrap(nextArg++);
212 if (param.isInterface()) {
213 for (Class<?> c : param.getClasses()) {
214 if (param.isAssignableFrom(c) && !c.isInterface())
215 { param = c; break; }
216 }
217 }
218 if (param.isInterface() || param.isAssignableFrom(String.class))
219 return "#"+nextArg();
220 else
221 try {
222 return param.newInstance();
jrose49494522012-01-18 17:34:29 -0800223 } catch (InstantiationException | IllegalAccessException ex) {
jrose25aef892010-10-30 21:02:30 -0700224 }
225 return null; // random class not Object, String, Integer, etc.
226 }
227 static Object[] randomArgs(Class<?>... params) {
228 Object[] args = new Object[params.length];
229 for (int i = 0; i < args.length; i++)
230 args[i] = randomArg(params[i]);
231 return args;
232 }
233 static Object[] randomArgs(int nargs, Class<?> param) {
234 Object[] args = new Object[nargs];
235 for (int i = 0; i < args.length; i++)
236 args[i] = randomArg(param);
237 return args;
238 }
239
240 static final Object ANON_OBJ = new Object();
241 static Object zeroArg(Class<?> param) {
242 Object x = castToWrapperOrNull(0L, param);
243 if (x != null) return x;
244 if (param.isInterface() || param.isAssignableFrom(String.class)) return "\"\"";
245 if (param == Object.class) return ANON_OBJ;
246 if (param.getComponentType() != null) return Array.newInstance(param.getComponentType(), 0);
247 return null;
248 }
249 static Object[] zeroArgs(Class<?>... params) {
250 Object[] args = new Object[params.length];
251 for (int i = 0; i < args.length; i++)
252 args[i] = zeroArg(params[i]);
253 return args;
254 }
255 static Object[] zeroArgs(List<Class<?>> params) {
256 return zeroArgs(params.toArray(new Class<?>[0]));
257 }
258
jrose49494522012-01-18 17:34:29 -0800259 @SafeVarargs @SuppressWarnings("varargs")
jrose25aef892010-10-30 21:02:30 -0700260 static <T, E extends T> T[] array(Class<T[]> atype, E... a) {
261 return Arrays.copyOf(a, a.length, atype);
262 }
jrose49494522012-01-18 17:34:29 -0800263 @SafeVarargs @SuppressWarnings("varargs")
jrose25aef892010-10-30 21:02:30 -0700264 static <T> T[] cat(T[] a, T... b) {
265 int alen = a.length, blen = b.length;
266 if (blen == 0) return a;
267 T[] c = Arrays.copyOf(a, alen + blen);
268 System.arraycopy(b, 0, c, alen, blen);
269 return c;
270 }
271 static Integer[] boxAll(int... vx) {
272 Integer[] res = new Integer[vx.length];
273 for (int i = 0; i < res.length; i++) {
274 res[i] = vx[i];
275 }
276 return res;
277 }
278 static Object getClasses(Object x) {
279 if (x == null) return x;
280 if (x instanceof String) return x; // keep the name
281 if (x instanceof List) {
282 // recursively report classes of the list elements
283 Object[] xa = ((List)x).toArray();
284 for (int i = 0; i < xa.length; i++)
285 xa[i] = getClasses(xa[i]);
286 return Arrays.asList(xa);
287 }
288 return x.getClass().getSimpleName();
289 }
290
291 static MethodHandle changeArgTypes(MethodHandle target, Class<?> argType) {
292 return changeArgTypes(target, 0, 999, argType);
293 }
294 static MethodHandle changeArgTypes(MethodHandle target,
295 int beg, int end, Class<?> argType) {
296 MethodType targetType = target.type();
297 end = Math.min(end, targetType.parameterCount());
jrose49494522012-01-18 17:34:29 -0800298 ArrayList<Class<?>> argTypes = new ArrayList<>(targetType.parameterList());
jrose25aef892010-10-30 21:02:30 -0700299 Collections.fill(argTypes.subList(beg, end), argType);
300 MethodType ttype2 = MethodType.methodType(targetType.returnType(), argTypes);
jrose9b82ad62011-05-26 17:37:36 -0700301 return target.asType(ttype2);
jrose25aef892010-10-30 21:02:30 -0700302 }
303
304 // This lookup is good for all members in and under InvokeGenericTest.
305 static final Lookup LOOKUP = MethodHandles.lookup();
306
jrose49494522012-01-18 17:34:29 -0800307 Map<List<Class<?>>, MethodHandle> CALLABLES = new HashMap<>();
jrose25aef892010-10-30 21:02:30 -0700308 MethodHandle callable(List<Class<?>> params) {
309 MethodHandle mh = CALLABLES.get(params);
310 if (mh == null) {
jroseadc650a2011-02-11 01:26:28 -0800311 mh = collector_MH.asType(methodType(Object.class, params));
jrose25aef892010-10-30 21:02:30 -0700312 CALLABLES.put(params, mh);
313 }
314 return mh;
315 }
316 MethodHandle callable(Class<?>... params) {
317 return callable(Arrays.asList(params));
318 }
319 private static Object collector(Object... args) {
320 return Arrays.asList(args);
321 }
322 private static final MethodHandle collector_MH;
323 static {
324 try {
325 collector_MH
326 = LOOKUP.findStatic(LOOKUP.lookupClass(),
327 "collector",
328 methodType(Object.class, Object[].class));
jrosef15905c2011-02-11 01:26:32 -0800329 } catch (ReflectiveOperationException ex) {
jrose25aef892010-10-30 21:02:30 -0700330 throw new RuntimeException(ex);
331 }
332 }
333
334 @Test
335 public void testSimple() throws Throwable {
336 startTest("testSimple");
337 countTest();
338 String[] args = { "one", "two" };
339 MethodHandle mh = callable(Object.class, String.class);
jrose49494522012-01-18 17:34:29 -0800340 Object res; List<?> resl;
341 res = resl = (List<?>) mh.invoke((String)args[0], (Object)args[1]);
jrose79e0a6c2011-05-12 19:27:33 -0700342 //System.out.println(res);
343 assertEquals(Arrays.asList(args), res);
344 }
345
346 @Test
jrose320b7692011-05-12 19:27:49 -0700347 public void testSimplePrims() throws Throwable {
348 startTest("testSimplePrims");
349 countTest();
350 int[] args = { 1, 2 };
351 MethodHandle mh = callable(Object.class, Object.class);
jrose49494522012-01-18 17:34:29 -0800352 Object res; List<?> resl;
353 res = resl = (List<?>) mh.invoke(args[0], args[1]);
jrose320b7692011-05-12 19:27:49 -0700354 //System.out.println(res);
355 assertEquals(Arrays.toString(args), res.toString());
356 }
357
358 @Test
jrose79e0a6c2011-05-12 19:27:33 -0700359 public void testAlternateName() throws Throwable {
360 startTest("testAlternateName");
361 countTest();
362 String[] args = { "one", "two" };
363 MethodHandle mh = callable(Object.class, String.class);
jrose49494522012-01-18 17:34:29 -0800364 Object res; List<?> resl;
365 res = resl = (List<?>) mh.invoke((String)args[0], (Object)args[1]);
jrose25aef892010-10-30 21:02:30 -0700366 //System.out.println(res);
367 assertEquals(Arrays.asList(args), res);
368 }
369
370 @Test
371 public void testWrongArgumentCount() throws Throwable {
372 startTest("testWrongArgumentCount");
373 for (int i = 0; i <= 10; i++) {
374 testWrongArgumentCount(Collections.<Class<?>>nCopies(i, Integer.class));
375 if (i <= 4) {
376 testWrongArgumentCount(Collections.<Class<?>>nCopies(i, int.class));
377 testWrongArgumentCount(Collections.<Class<?>>nCopies(i, long.class));
378 }
379 }
380 }
381 public void testWrongArgumentCount(List<Class<?>> params) throws Throwable {
382 int max = params.size();
383 for (int i = 0; i < max; i++) {
384 List<Class<?>> params2 = params.subList(0, i);
385 for (int k = 0; k <= 2; k++) {
386 if (k == 1) params = methodType(Object.class, params).generic().parameterList();
387 if (k == 2) params2 = methodType(Object.class, params2).generic().parameterList();
388 testWrongArgumentCount(params, params2);
389 testWrongArgumentCount(params2, params);
390 }
391 }
392 }
393 public void testWrongArgumentCount(List<Class<?>> expect, List<Class<?>> observe) throws Throwable {
394 countTest(false);
395 if (expect.equals(observe))
396 assert(false);
397 MethodHandle target = callable(expect);
398 Object[] args = zeroArgs(observe);
399 Object junk;
400 try {
401 switch (args.length) {
402 case 0:
jrose79e0a6c2011-05-12 19:27:33 -0700403 junk = target.invoke(); break;
jrose25aef892010-10-30 21:02:30 -0700404 case 1:
jrose79e0a6c2011-05-12 19:27:33 -0700405 junk = target.invoke(args[0]); break;
jrose25aef892010-10-30 21:02:30 -0700406 case 2:
jrose79e0a6c2011-05-12 19:27:33 -0700407 junk = target.invoke(args[0], args[1]); break;
jrose25aef892010-10-30 21:02:30 -0700408 case 3:
jrose79e0a6c2011-05-12 19:27:33 -0700409 junk = target.invoke(args[0], args[1], args[2]); break;
jrose25aef892010-10-30 21:02:30 -0700410 case 4:
jrose79e0a6c2011-05-12 19:27:33 -0700411 junk = target.invoke(args[0], args[1], args[2], args[3]); break;
jrose25aef892010-10-30 21:02:30 -0700412 default:
jrose900bafd2010-10-30 21:08:23 -0700413 junk = target.invokeWithArguments(args); break;
jrose25aef892010-10-30 21:02:30 -0700414 }
415 } catch (WrongMethodTypeException ex) {
416 return;
417 } catch (Exception ex) {
jrose320b7692011-05-12 19:27:49 -0700418 throw new RuntimeException("wrong exception calling "+target+" on "+Arrays.asList(args), ex);
jrose25aef892010-10-30 21:02:30 -0700419 }
jrose320b7692011-05-12 19:27:49 -0700420 throw new RuntimeException("bad success calling "+target+" on "+Arrays.asList(args));
jrose25aef892010-10-30 21:02:30 -0700421 }
422
423 /** Make a list of all combinations of the given types, with the given arities.
424 * A void return type is possible iff the first type is void.class.
425 */
426 static List<MethodType> allMethodTypes(int minargc, int maxargc, Class<?>... types) {
jrose49494522012-01-18 17:34:29 -0800427 ArrayList<MethodType> result = new ArrayList<>();
jrose25aef892010-10-30 21:02:30 -0700428 if (types.length > 0) {
jrose49494522012-01-18 17:34:29 -0800429 ArrayList<MethodType> argcTypes = new ArrayList<>();
jrose25aef892010-10-30 21:02:30 -0700430 // build arity-zero types first
431 for (Class<?> rtype : types) {
432 argcTypes.add(MethodType.methodType(rtype));
433 }
434 if (types[0] == void.class)
435 // void is not an argument type
436 types = Arrays.copyOfRange(types, 1, types.length);
437 for (int argc = 0; argc <= maxargc; argc++) {
438 if (argc >= minargc)
439 result.addAll(argcTypes);
440 if (argc >= maxargc)
441 break;
442 ArrayList<MethodType> prevTypes = argcTypes;
jrose49494522012-01-18 17:34:29 -0800443 argcTypes = new ArrayList<>();
jrose25aef892010-10-30 21:02:30 -0700444 for (MethodType prevType : prevTypes) {
445 for (Class<?> ptype : types) {
446 argcTypes.add(prevType.insertParameterTypes(argc, ptype));
447 }
448 }
449 }
450 }
451 return Collections.unmodifiableList(result);
452 }
453 static List<MethodType> allMethodTypes(int argc, Class<?>... types) {
454 return allMethodTypes(argc, argc, types);
455 }
456
jrose25aef892010-10-30 21:02:30 -0700457 MethodHandle toString_MH;
458
459 @Test
460 public void testReferenceConversions() throws Throwable {
461 startTest("testReferenceConversions");
462 toString_MH = LOOKUP.
463 findVirtual(Object.class, "toString", MethodType.methodType(String.class));
jrose79e0a6c2011-05-12 19:27:33 -0700464 Object[] args = { "one", "two" };
jrosebb3eb372011-05-17 19:48:14 -0700465 for (MethodType type : allMethodTypes(2, Object.class, String.class, CharSequence.class)) {
jrose25aef892010-10-30 21:02:30 -0700466 testReferenceConversions(type, args);
467 }
468 }
469 public void testReferenceConversions(MethodType type, Object... args) throws Throwable {
470 countTest();
jrosebb3eb372011-05-17 19:48:14 -0700471 int nargs = args.length;
472 List<Object> argList = Arrays.asList(args);
473 String expectString = argList.toString();
474 if (verbosity > 3) System.out.println("target type: "+type+expectString);
jrose25aef892010-10-30 21:02:30 -0700475 MethodHandle mh = callable(type.parameterList());
jrosebb3eb372011-05-17 19:48:14 -0700476 mh = MethodHandles.filterReturnValue(mh, toString_MH);
jrose25aef892010-10-30 21:02:30 -0700477 mh = mh.asType(type);
jrosebb3eb372011-05-17 19:48:14 -0700478 Object res = null;
479 if (nargs == 2) {
480 res = mh.invoke((Object)args[0], (Object)args[1]);
481 assertEquals(expectString, res);
482 res = mh.invoke((String)args[0], (Object)args[1]);
483 assertEquals(expectString, res);
484 res = mh.invoke((Object)args[0], (String)args[1]);
485 assertEquals(expectString, res);
486 res = mh.invoke((String)args[0], (String)args[1]);
487 assertEquals(expectString, res);
488 res = mh.invoke((String)args[0], (CharSequence)args[1]);
489 assertEquals(expectString, res);
490 res = mh.invoke((CharSequence)args[0], (Object)args[1]);
491 assertEquals(expectString, res);
492 res = (String) mh.invoke((Object)args[0], (Object)args[1]);
493 assertEquals(expectString, res);
494 res = (String) mh.invoke((String)args[0], (Object)args[1]);
495 assertEquals(expectString, res);
496 res = (CharSequence) mh.invoke((String)args[0], (Object)args[1]);
497 assertEquals(expectString, res);
498 } else {
499 assert(false); // write this code
500 }
jrose25aef892010-10-30 21:02:30 -0700501 //System.out.println(res);
jrose25aef892010-10-30 21:02:30 -0700502 }
503
504
jrosebb3eb372011-05-17 19:48:14 -0700505 @Test
jrose25aef892010-10-30 21:02:30 -0700506 public void testBoxConversions() throws Throwable {
507 startTest("testBoxConversions");
508 countTest();
jrose79e0a6c2011-05-12 19:27:33 -0700509 Object[] args = { 1, 2 };
jrose25aef892010-10-30 21:02:30 -0700510 MethodHandle mh = callable(Object.class, int.class);
jrose49494522012-01-18 17:34:29 -0800511 Object res; List<?> resl; int resi;
512 res = resl = (List<?>) mh.invoke((int)args[0], (Object)args[1]);
jrose25aef892010-10-30 21:02:30 -0700513 //System.out.println(res);
514 assertEquals(Arrays.asList(args), res);
jrosebb3eb372011-05-17 19:48:14 -0700515 mh = MethodHandles.identity(int.class);
516 mh = MethodHandles.dropArguments(mh, 1, int.class);
517 res = resi = (int) mh.invoke((Object) args[0], (Object) args[1]);
518 assertEquals(args[0], res);
519 res = resi = (int) mh.invoke((int) args[0], (Object) args[1]);
520 assertEquals(args[0], res);
jrose25aef892010-10-30 21:02:30 -0700521 }
522
523}