-
CSR
-
Resolution: Approved
-
P4
-
None
-
behavioral
-
minimal
-
Clients who provide invalid arguments may see new or different exceptions.
-
Java API
-
SE
Summary
Document and enforce the conditions under which invalid arguments will cause a RuntimeException to be thrown by the LambdaMetafactory methods.
Problem
The LambdaMetafactory methods fail to validate their inputs. When invoked directly (as opposed to standard usage by javac), invalid arguments lead to unspecified, ad hoc RuntimeExceptions or other surprising behavior.
Solution
Specify four exceptions that can be thrown: LambdaConversionException, NullPointerException, IllegalArgumentException, and SecurityException. Describe the conditions under which they will be thrown.
This is a behavioral change: certain nonstandard usages of LambdaMetafactory will result in new or different exceptions.
Also make some clarifying revisions to specification, such as more accurately naming parameters to reflect their behavior rather than the specific way javac uses them.
Specification
Diff of LambdaMetafactory.java is attached. See also the code review.
- csr of
-
JDK-8174222 LambdaMetafactory: validate inputs and improve documentation
-
- Resolved
-