Community
Participate
Working Groups
We have a project that we compile with Java 1.6, but which supports Java 1.5 as well as 1.6, and so we compile with JDK 1.5 compliance. We also optionally do some code generation. We have a field that has a @see reference to javax.annotation.Generated in the javadocs (the comment describes why we use dates of a particular format when generating code). This field is correctly marked as valid, since I have "Process Javadoc comments" turned off. However, when I add annotation processing to the project, this field now receives an access restriction error, with no apparent way to turn it off. I'm not sure why my javadoc is now being processed in this way, but it probably has something to do with the fact that it's referring to the @Generated annotation.
Paul, can you please specify what build you're using? Satyam, please follow up. Thanks!
I *believe* it's RC3, but the build id is I20100429-1549
I am able to reproduce this even in the older releases -- should have been there since 3.3. Javadocs are being processed whenever an annotation processor is added. This is probably done because the annotation processor needs the javadocs. However, the errors should not be coming.
Olivier, We are forcing javadoc to be processed when annotation processor is added. Instead of doing that, can't we just add one more option to the AST that is getting created to include javadoc. Is this not good enough? I understand that we cannot do this for the older releases, but should this not be the right approach for 3.7?
I always said we should have a way to get the javadoc without resolving it. In apt, we don't actually need to resolve the javadoc, but we need the javadoc to be available. There is an existing bug report for this. See bug 212207. We should indeed fix this for 3.7 and make sure that existing users are not impacted.
(In reply to comment #5) I understand what you are telling. I will see what can be done.
This is actually a duplicate of bug 189459. The Javadoc support is getting activated while processing annotations. *** This bug has been marked as a duplicate of bug 189459 ***
Verified for 3.7M6 using build I20110301-1537.