Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8138612

Do not retain declaration annotations on lambda formal parameters

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8u60
    • Fix Version/s: 9
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b93
    • Verification:
      Verified

      Description

      In JDK 8u40, javac dropped declaration annotations on lambda formals on the floor. Nothing in JLS8 suggested this treatment for such annotations, but it was a happy accident nonetheless -- according to Brian Goetz, there is no need to tie the synthetic method generated for a lambda expression back to the source lambda expression by carefully mapping the parameter annotations.

      in JDK 9 (and presumably in JDK 8u60), javac preserves declaration annotations on lambda formals as Runtime[In]VisibleParameterAnnotations in the synthetic method. Similar to the names of the lambda formals, this preservation should not happen. The covering JLS change is specified in JDK-8140279.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sadayapalam Srikanth Adayapalam
              Reporter:
              abuckley Alex Buckley
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: