Bug 9394 - Deleting method does not delete generated non-Javadoc comment
Summary: Deleting method does not delete generated non-Javadoc comment
Status: RESOLVED DUPLICATE of bug 11056
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 2.0 M5   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 12225 (view as bug list)
Depends on: 9790
Blocks:
  Show dependency tree
 
Reported: 2002-02-11 10:34 EST by Nick Edgar CLA
Modified: 2002-04-30 07:00 EDT (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 Nick Edgar CLA 2002-02-11 10:34:47 EST
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.
Comment 1 Erich Gamma CLA 2002-02-11 11:54:31 EST
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.
Comment 2 Adam Kiezun CLA 2002-02-11 11:55:59 EST
i'd vote for generating javadoc
Comment 3 Olivier Thomann CLA 2002-02-12 12:14:55 EST
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?
Comment 4 Nick Edgar CLA 2002-02-12 13:09:13 EST
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.
Comment 5 Martin Aeschlimann CLA 2002-02-12 13:34:18 EST
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.
Comment 6 Martin Aeschlimann CLA 2002-03-07 12:13:18 EST
moving to jcore to extend the element ranges to also include non javadoc 
comments
Comment 7 Olivier Thomann CLA 2002-03-07 12:17:56 EST
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. 
Comment 8 Philipe Mulet CLA 2002-03-21 13:42:55 EST

*** This bug has been marked as a duplicate of 11056 ***
Comment 9 Adam Kiezun CLA 2002-03-25 11:38:19 EST
*** Bug 12225 has been marked as a duplicate of this bug. ***