The LambdaMetafactory.metafactory and LambdaMetafactory.altMetafactory methods throw various RuntimeExceptions when given bad inputs, often because assumptions about the inputs turn out not to hold. These error conditions need to be specified, and the set of possible exception types should be reduced.
Current behavior is to throw any of:
NullPointerException
IndexOutOfBoundsException
ClassCastException
NegativeArraySizeException
ArrayStoreException
IllegalArgumentException
SecurityException
LambdaConversionException
No error occurs if altMetafactory's 'args' has unexpected trailing components.