Late change to JEP 433
Alex Buckley
alex.buckley at oracle.com
Tue Nov 15 00:23:51 UTC 2022
On 11/14/2022 10:56 AM, Alex Buckley wrote:
> (I think JLS 11.1.2 "The Causes of Exceptions" ought to mention an
> `assert` statement -- filed https://bugs.openjdk.org/browse/JDK-8296951)
In the spirit of fixing omissions, a list member told me that JLS
15.27.4 omits to mention that a LambdaConversionException can occur.
This exception arises from the operation of LambdaMetaFactory, which is
a mechanism provided by the Java Platform for implementing 15.27.4 (see
the javadoc of j.l.i.LambdaMetafactory::metafactory).
However, per https://bugs.openjdk.org/browse/JDK-8059640, any
LambdaConversionException will surface as a LinkageError, and the
precise timing of a LinkageError is specified as unspecified by JLS
15.6: "Various linkage and virtual machine errors may also occur during
the evaluation of an expression. By their nature, such errors are
difficult to predict and difficult to handle."
Given that use of LambdaMetaFactory is optional (note "a mechanism", not
"the mechanism"), and given that LambdaConversionException is not
visible even when it is used, I don't see any need to change 15.27.4.
Alex
More information about the amber-spec-observers
mailing list