JDK-8150824 : Exceptions when omitting trailing arguments in cleanup
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang.invoke
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2016-02-29
  • Updated: 2016-04-25
  • Resolved: 2016-04-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b115Fixed
Related Reports
Blocks :  
Relates :  
Description
The {@code target} and {@code cleanup} must have the same corresponding argument and return types, except that {@code cleanup} may omit trailing arguments.

BUT

1. IllegalArgumentException: bad spread array length
WHEN
private static void target(int a1, long a2, Object a3, int b1, long b2, Object b3) {}
private static void cleanup(Throwable t) {}

2. WrongMethodTypeException: cannot convert MethodHandle(Throwable,int,long,Object[])void to (Throwable,Object[])void
WHEN
private static void target(int a1, long a2, Object a3, int b1, long b2, Object b3) {}
private static void cleanup(Throwable t, int a1, long a2, Object a3, int b1) {}



Comments
The push for JDK-8150829 will fix this; dedicated tests will be provided.
01-03-2016