| Summary: | [1.8][compiler] Type annotations on constructor results dropped by the code generator | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Srikanth Sankaran <srikanth_sankaran> | ||||
| Component: | Core | Assignee: | Andrew Clement <aclement> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | ||||||
| Version: | 4.4 | ||||||
| Target Milestone: | BETA J8 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Bug Depends on: | |||||||
| Bug Blocks: | 409235 | ||||||
| Attachments: |
|
||||||
Andy, please take a look. TIA. Regression test will be made available via org.eclipse.jdt.core.tests.compiler.regression.JSR308SpecSnippetTests.test013() (to be released shortly.) Created attachment 234649 [details] Test and fix Ensure the annotations on the constructor make it to the class file. Might want to apply after patch on bug 415397 Fix and tests released here: Thanks Andy. This contribution complies with http://www.eclipse.org/legal/CoO.php |
BETA_JAVA8: Given the following program: // --- import java.lang.annotation.*; import static java.lang.annotation.ElementType.*; @Target(TYPE_USE) @interface Immutable {} class Document {} class X { @Immutable X() { } } // --- The annotation @Immutable does not make it to the class file. 8b100 emits: X(); descriptor: ()V flags: Code: stack=1, locals=1, args_size=1 0: aload_0 1: invokespecial #1 // Method java/lang/Object."<init>":()V 4: return LineNumberTable: line 7: 0 line 8: 4 RuntimeInvisibleTypeAnnotations: 0: #9(): METHOD_RETURN