Community
Participate
Working Groups
Build 20020205 - new class: class Test implements Runnable() { } - select Test in the Outline and generate the run method using Override Methods - select run() in the Outline and delete it - the non-Javadoc comment generated for run() remains Either delete should delete any preceding non-Javadoc comment, or Override Methods should use a template which generates a Javadoc comment.
There is a preference in Java>Code Generation that allows you to set whether an overridden method should be an ordinary comment or a javadoc comment. We should change the default so that a javadoc comment is generated.
i'd vote for generating javadoc
Non-javadoc comments are never part of the method declaration. This is why they are not deleted when deleting the method. We should always set the comments to be javadoc comments for overriden methods. Do you know if there are some conventions for this?
In Eclipse UI we've generally been using non-Javadoc comments for overridden methods, flagging it as intentionally non-Javadoc and indicating where the method was originally declared. e.g. /* (non-Javadoc) * Method declared on ISelectionListener */ public void selectionChanged(SelectionEvent event) { // handle selection changed } If you don't have a Javadoc comment on the implementation method, Javadoc copies down the spec from the interface or superclass method.
I would vote for having JavaCore extending the source range of the method to include preceding non-javadoc comments. btw, you can already configure in the codegeneration preference page if you want non-javadoc comments or real javadoc comments.
moving to jcore to extend the element ranges to also include non javadoc comments
Including the non-javadoc comments as part of the method definition has a lot of side-effects. I would say the fix is to generate overriden methods with javadoc comments. So changing the default to have javadoc comment on overriden methods seems to be a good idea. If you want to keep non-javadoc comment, then you will leave with residual comments left behind after method deletion.
*** This bug has been marked as a duplicate of 11056 ***
*** Bug 12225 has been marked as a duplicate of this bug. ***