RFR(S): 8160717: MethodHandles.loop() does not check for excessive signature

Andrej Golovnin andrej.golovnin at gmail.com
Wed Jul 6 08:25:29 UTC 2016


Hi Michael,

src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java

The class BytecodeGenerationException should be final.

767         static final long serialVersionUID = -1L; // no serialisation

Just because you set serialVersionUID to -1L, it does not mean that it
is not serializable. Either remove the comment "// no serialisation"
or remove the serialVersionUID at all because you never serialize this
exception. And btw. serialVersionUID should be private if you decide
to keep it.

You use the BytecodeGenerationException only as a wrapper. Therefore I
would override the fillInStackTrace()-method and make it empty. And
later in the class LambdaForm I would just print the cause of
BytecodeGenerationException.

src/java.base/share/classes/java/lang/invoke/LambdaForm.java

In the line 739 the field LF_FAILED should be final.


Best regards,
Andrej Golovnin


More information about the core-libs-dev mailing list