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

[local-methods] Annotations on local methods don't make it to the class file.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: repo-amber
    • Fix Version/s: repo-amber
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      Compiling this code and then viewing javap output:

      public class X {

          @interface Annot {}

          @Annot
          public static void main(String args []) {
              @Annot
              void goo(@Annot int x) {
              }
              void foo() {
                  @Annot
                  void zoo() {}
              }
          }
      }

      It appears that @Annot annotation makes it to the class file only (i) as applied to the main() method (ii) as parameter annotation on the parameter of goo()

      The other two instances are silently dropped.

        Attachments

          Activity

            People

            Assignee:
            sadayapalam Srikanth Adayapalam
            Reporter:
            sadayapalam Srikanth Adayapalam
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: