Community
Participate
Working Groups
When compiling such code: import java.lang.annotation.*; @Retention(RetentionPolicy.CLASS) @interface Annot {} @Annot public class X { } with -target jsr14, the annotation should be preserved inside the resulting .class file. Right now we have a test: org.eclipse.jdt.internal.compiler.ClassFile#addAttributes lin2 404 that removes them for a target < 1.5. We can safely preserve them regardless of the target since they ends up as attributes. An attribute is ignored if unknown for the VM.
Created attachment 147339 [details] Proposed fix + regression test
Released for 3.6M3. Regression test added in: org.eclipse.jdt.core.tests.compiler.regression.AnnotationTest#test272
Created attachment 147468 [details] Proposed fix Patch to apply after the first patch.
Verified for 3.6M3 with build I20091026-0800