-
Bug
-
Resolution: Fixed
-
P2
-
None
-
Verified
Some low-level details of the class produced for lambdas and method references need to be made more precise in the spec when generics are involved.
1) The methods that are overridden by the generated class are any methods in the _instantiated_ functional interface type (for example, Predicate<String>) for which the target function type ((String)->boolean) is a subsignature. (Some of these may be default methods.)
2) The parameters are checked for ClassCastExceptions based on the erased target function type (similar to 15.12.4.5).
This is consistent with the current behavior of javac (I think) and the LambdaMetafactory (per its own specification).
1) The methods that are overridden by the generated class are any methods in the _instantiated_ functional interface type (for example, Predicate<String>) for which the target function type ((String)->boolean) is a subsignature. (Some of these may be default methods.)
2) The parameters are checked for ClassCastExceptions based on the erased target function type (similar to 15.12.4.5).
This is consistent with the current behavior of javac (I think) and the LambdaMetafactory (per its own specification).
- relates to
-
JDK-8030757 Lambda Spec: Clean up functional interface parameterization inference
-
- Closed
-