Bug 434479 - API tags to annotation conversion looses tag comment
Summary: API tags to annotation conversion looses tag comment
Status: RESOLVED WORKSFORME
Alias: None
Product: PDE
Classification: Eclipse Project
Component: API Tools (show other bugs)
Version: 4.4   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: PDE API Tools Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: investigate
Depends on:
Blocks:
 
Reported: 2014-05-09 04:39 EDT by Dani Megert CLA
Modified: 2019-09-02 15:03 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 Dani Megert CLA 2014-05-09 04:39:59 EDT
4.4 M7.

API tags to annotation conversion looses comment.

Have this:

/**
 * @nooverride This is forbidden due to bug 12345!
 */
public String getId() {...
	
after converting:

@NoOverride
public String getId() {...
Comment 1 Michael Rennie CLA 2014-05-09 12:18:27 EDT
with the latest from git, if I run the conversion I go from:

/**
 * @nooverride This method is not intended to be re-implemented or extended by clients.
 */
@Override
public String getId() {

to:

/**
 */
@NoOverride
@Override
public String getId() {

and:

/**
 * @nooverride This method is not intended to be re-implemented or extended by clients.
 */
public String getId() {

to:

/**
 */
@NoOverride
public String getId() {

is it possible you have some kind of clean up rule that removes empty comments? There is no code in the wizard to remove comment blocks, only to remove tags. Here is the complete Javadoc rewrite code in the wizard:

lrewrite = rewrite.getListRewrite(docnode, Javadoc.TAGS_PROPERTY);
for (TagElement tag : tags) {
  if (JavadocTagManager.ALL_TAGS.contains(tag.getTagName())) {
    lrewrite.remove(tag, null);
  }
}
Comment 2 Dani Megert CLA 2014-05-12 05:47:02 EDT
(In reply to Michael Rennie from comment #1)
> with the latest from git, if I run the conversion I go from:

...

Yes, it also leaves the comments for me. Sorry for the incomplete example.
Comment 3 Michael Rennie CLA 2014-05-12 12:31:23 EDT
So can this be closed now, or are you requesting that the 'delete tag during conversion' leave the comment but remove the tag name, i.e.:

/**
 * @nooverride This method is not intended to be re-implemented or extended by clients.
 */
@Override
public String getId() {

to:

/**
 * This method is not intended to be re-implemented or extended by clients.
 */
@NoOverride
@Override
public String getId() {
Comment 4 Curtis Windatt CLA 2014-05-12 15:26:24 EDT
(In reply to Michael Rennie from comment #3)
> So can this be closed now, or are you requesting that the 'delete tag during
> conversion' leave the comment but remove the tag name, i.e.:
> 
> /**
>  * @nooverride This method is not intended to be re-implemented or extended
> by clients.
>  */
> @Override
> public String getId() {
> 
> to:
> 
> /**
>  * This method is not intended to be re-implemented or extended by clients.
>  */
> @NoOverride
> @Override
> public String getId() {

We could also only keep the existing comment if it differs from the default comment added to javadoc tags.
Comment 5 Dani Megert CLA 2014-05-13 05:03:45 EDT
(In reply to Curtis Windatt from comment #4)
> (In reply to Michael Rennie from comment #3)
> > So can this be closed now,

No :-)


> We could also only keep the existing comment if it differs from the default
> comment added to javadoc tags.

Exactly.
Comment 6 Eclipse Genie CLA 2018-12-08 13:31:31 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 7 Lars Vogel CLA 2019-09-02 15:03:22 EDT
This bug has been marked as stalebug a while ago without any further interaction.

If this report is still relevant for the current release, please reopen and remove the stalebug whiteboard flag.
Comment 8 Lars Vogel CLA 2019-09-02 15:03:24 EDT
This bug was marked as stalebug a while ago. Marking as worksforme.

If this report is still relevant for the current release, please reopen and remove the stalebug whiteboard tag.