Bug 316782 - Error referring to @Generated annotation in javadocs with APT turned on
Summary: Error referring to @Generated annotation in javadocs with APT turned on
Status: VERIFIED DUPLICATE of bug 189459
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: 3.7 M6   Edit
Assignee: Satyam Kandula CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-14 12:02 EDT by Paul Fullbright CLA
Modified: 2011-03-08 05:37 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Fullbright CLA 2010-06-14 12:02:29 EDT
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.
Comment 1 Ayushman Jain CLA 2010-06-14 12:57:06 EDT
Paul, can you please specify what build you're using?

Satyam, please follow up. Thanks!
Comment 2 Paul Fullbright CLA 2010-06-14 13:42:14 EDT
I *believe* it's RC3, but the build id is I20100429-1549
Comment 3 Satyam Kandula CLA 2010-06-16 06:25:25 EDT
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.
Comment 4 Satyam Kandula CLA 2010-06-16 06:35:34 EDT
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?
Comment 5 Olivier Thomann CLA 2010-06-16 09:50:07 EDT
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.
Comment 6 Satyam Kandula CLA 2010-06-17 02:57:03 EDT
(In reply to comment #5)
I understand what you are telling. I will see what can be done.
Comment 7 Satyam Kandula CLA 2011-01-31 23:57:21 EST
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 ***
Comment 8 Jay Arthanareeswaran CLA 2011-03-08 05:37:11 EST
Verified for 3.7M6 using build I20110301-1537.