Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 318413 - Javadoc view doesnt show comment when it is below an annotation
Summary: Javadoc view doesnt show comment when it is below an annotation
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-30 02:38 EDT by Prashant Deva CLA
Modified: 2010-07-01 06:56 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Prashant Deva CLA 2010-06-30 02:38:26 EDT
If I have a class declaration such as -


@SupressWarnings("mywarning")
/**
 * My Javadoc
 */
class MyClass{
}


when I place the caret over MyClass the JavaDoc view wont show the comment.

However, if I remove the annotation at the top (and place it after the comment), the javadoc for the class will show properly.
Comment 1 Deepak Azad CLA 2010-06-30 03:36:59 EDT
Annotations are part of the class/method declaration, and the Javadoc *must* appear immediately before the declaration.

For example, consider the following valid declaration for an abstract class

@SupressWarnings("mywarning") abstract
/**
 * Not a javadoc
 */
class MyClass{
}
Comment 2 Prashant Deva CLA 2010-07-01 06:35:15 EDT
Maybe you didnt get me, as you can see in my example, the comment does show 'exactly before' the class declaration.


What I am saying is that if I do this -



/**
 * My Javadoc
 */
@SupressWarnings("mywarning")
class MyClass{
}


then the Javadoc view shows the comment, however if I do this -


@SupressWarnings("mywarning")
/**
 * My Javadoc
 */
class MyClass{
}


then the Javadoc view doesnt show the comment.
Comment 3 Deepak Azad CLA 2010-07-01 06:56:12 EDT
(In reply to comment #2)
> @SupressWarnings("mywarning")  
> /**
>  * My Javadoc
>  */
> class MyClass{
> }
> 
> 
> then the Javadoc view doesnt show the comment.

@SupressWarnings("mywarning") is part of the declaration, hence your comment is also part of the declaration and hence not a javadoc.

/** Only this is a javadoc*/
@SupressWarnings("mywarning")
/** not javadoc*/
class /** not javadoc*/ MyClass /** not javadoc*/{

}