equal
deleted
inserted
replaced
413 MethodHandle eq2 = equals.asSpreader(Object[].class, 2); |
413 MethodHandle eq2 = equals.asSpreader(Object[].class, 2); |
414 assert( (boolean) eq2.invokeExact(new Object[]{ "me", "me" })); |
414 assert( (boolean) eq2.invokeExact(new Object[]{ "me", "me" })); |
415 assert(!(boolean) eq2.invokeExact(new Object[]{ "me", "thee" })); |
415 assert(!(boolean) eq2.invokeExact(new Object[]{ "me", "thee" })); |
416 // try to spread from anything but a 2-array: |
416 // try to spread from anything but a 2-array: |
417 for (int n = 0; n <= 10; n++) { |
417 for (int n = 0; n <= 10; n++) { |
418 Object[] badArityArgs = (n == 2 ? null : new Object[n]); |
418 Object[] badArityArgs = (n == 2 ? new Object[0] : new Object[n]); |
419 try { assert((boolean) eq2.invokeExact(badArityArgs) && false); } |
419 try { assert((boolean) eq2.invokeExact(badArityArgs) && false); } |
420 catch (IllegalArgumentException ex) { } // OK |
420 catch (IllegalArgumentException ex) { } // OK |
421 } |
421 } |
422 // spread both arguments from a String array: |
422 // spread both arguments from a String array: |
423 MethodHandle eq2s = equals.asSpreader(String[].class, 2); |
423 MethodHandle eq2s = equals.asSpreader(String[].class, 2); |