JDK-8013485 : javac can't handle annotations with a <clinit> from a previous compilation unit
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 6-pool,7,8,8-repo-lambda
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2013-04-29
  • Updated: 2015-02-02
  • Resolved: 2013-05-08
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 7 JDK 8
7u80Fixed 8 b91Fixed
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


Comments
verified in jdk8 b92
2013-06-06

Marked as tck-red as this is making the following (and similar) JCK test to fail: tests/lang/INTF/intf018/intf01802m11/intf01802m11.java
2013-04-29