Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 383884 - [1.8][compiler] Compiler tolerates illegal dimension annotation in class literal expressions.
Summary: [1.8][compiler] Compiler tolerates illegal dimension annotation in class lite...
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.8   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: BETA J8   Edit
Assignee: Srikanth Sankaran CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 287648
  Show dependency tree
 
Reported: 2012-06-29 07:33 EDT by Srikanth Sankaran CLA
Modified: 2012-06-29 10:18 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Srikanth Sankaran CLA 2012-06-29 07:33:49 EDT
BETA_JAVA8:

JSR308 forbids application of type annotations on class literals.
The draft spec cites the following examples as illegal ones:

@Even int.class // illegal!
int @NonEmpty [].class // illegal!

ECJ's grammar as of this date forbids the former, but allows the
latter. This needs to be fixed:

//--------------
public class X {
  public static void main(String[] args) {
    System.out.println(int @NonEmpty [].class); // illegal, but allowed now
  }
}
@interface NonEmpty {
}