Community
Participate
Working Groups
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.
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{ }
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.
(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*/{ }