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

javac can't handle annotations with a <clinit> from a previous compilation unit

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2
    • 8
    • 6-pool, 7, 8, 8-repo-lambda
    • tools
    • b91
    • Verified

    Backports

      Description

        The following code does not compile:

        @interface A {
            Runnable r1 = ()->{}; //1
            Runnable r2 = new Runnable() { public void run() { }}; //2
        }

        @A
        class Test { }

        Following output is generated:

        Test.java:93: error: annotation A is missing values for attributes lambda$0,<clinit>
        @A
        ^
        1 error

        However, this is only partly lambda-related - if line (1) is commented, the following output is generated:

        Test.java:94: error: annotation A is missing value for the attribute <clinit>
        @A
        ^
        1 error

        Attachments

          Issue Links

            Activity

              People

                jfranck Joel Borggrén-Franck (Inactive)
                mcimadamore Maurizio Cimadamore
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: