JDK-8037546 : javac -parameters does not emit parameter names for lambda expressions
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 8
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2014-03-17
  • Updated: 2015-10-02
  • Resolved: 2015-01-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u60Fixed 9 b47Fixed
Related Reports
Relates :  
Description
As reported at [1], the synthetic method emitted for a lambda expression does not have a MethodParameters attribute, even when javac -parameters is specified. This is an oversight, as other attributes are generated as expected for the synthetic method, e.g. Runtime[In]VisibleTypeAnnotations for annotations on types of lambda formal parameters.

[1] http://mail.openjdk.java.net/pipermail/type-annotations-spec-comments/2014-March/000071.html
Comments
com.sun.tools.javac.jvm.ClassWriter#writeMethodParametersAttr looks at MethodSymbol#params, but this is not initialized by com.sun.tools.javac.comp.LambdaToMethod.LambdaAnalyzerPreprocessor.LambdaTranslationContext#complete I have a preliminary fix for the problem.
19-12-2014