Community
Participate
Working Groups
Build 20041207 Define 2 files: p/Use.java=================================== package p; @q.Ann public class Use { } q/Ann.java=================================== package q; public @interface Ann { } Build - all is fine Now incrementally change q/Ann.java to: package q; import java.lang.annotation.*; @Target(ElementType.METHOD) public @interface Ann { } Build - still fine though p/Use.java should have got a problem due to disallowed location for use of annotation @Ann.
Problem comes from classfile comparator which should consider some standard annotation changes as structural changes. Considering how the compiler works, it could minimally consider as structurally changed if: - target - deprecation have changed (@Override/@SuppressWarnings have only local impact, and others are ignored for now)
Should then add some builder test
Created attachment 16509 [details] Patch for ClassFileReader (rooted at project) Checked Target&Deprecated on types, Deprecated only for field&method
Released the patch, pls double check and annotate build notes if ok.
Added test Java50Tests#_testAnnotation(). Please enable when this bug is fixed.
Since patch was released, enabled the test.
Verified. Change looks good. Updated the build notes.
I also added the retention as part of the check, because it has an impact on the kind of attributes that are generated. They can become visible or invisible. So dependant classes should be recompiled if the retention is different.
Ok
Verified for 3.1 M4 using build I200412142000.