Community
Participate
Working Groups
BETA_JAVA8: The following program when built as a 1.7- project but built against a 1.8 JRE compiles fine. It should not as it uses type annotations. // ----------- public class X< T> { @Marker int foo() { return 0; } } @java.lang.annotation.Target (java.lang.annotation.ElementType.TYPE_USE) @interface Marker { }
Created attachment 222027 [details] Proposed fix This patch contains fix for this bug and bug 391196, bug 391314 and bug 391315. New tests have been added and some existing tests have been rewritten for bug 391314. The new test AnnotationTest.testBug391201() fails in 1.8 compliance level. I still have to find an appropriate place that only runs below 1.8. Srikanth, please review.
Here are some comments: - Let us merge messages 649 and 652 into one: "Annotation types that don't specify explicit target element type cannot be applied here" and - merge the two methods explitAnnotationTargetRequired and explitAnnotationTargetRequired2 into the former itself. - These two changes allow us to get rid of IProblem and CompilerInvocationTests changes. - AnnotationTest#testBug391201 should be moved to ComplianceDiagnoseTest
Sorry for the truncated message: Here are some comments: - Let us merge messages 649 and 652 into one: "Annotation types that don't specify explicit target element type cannot be applied here" and - merge the two methods explitAnnotationTargetRequired and explitAnnotationTargetRequired2 into the former itself. - These two changes allow us to get rid of IProblem and CompilerInvocationTests changes. - AnnotationTest#testBug391201 should be moved to ComplianceDiagnoseTest This test should not be run on 1.8+ - Expected message for 1.7- is wrong, it should print a message saying type annotations are illegal at source below 1.8
Created attachment 222058 [details] Updated patch This patch incorporates changes suggested in the previous comment. All Java 8 tests pass will report after running all the tests.
Created attachment 222063 [details] Same patch with minor message rewording All Java8 tests pass. Jay, please release and remember to close all bugs. Checkin comment should mention all 4 bug and in each mention the cumulative fix has been released mentioning commit id - Thanks!
The fix has been released here: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?h=BETA_JAVA8&id=5aa22ef02c63418c06be6cd6a1ebf3ebbd649c6f