Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 122981 - [convert local] Comments Eaten When Field Created
Summary: [convert local] Comments Eaten When Field Created
Status: CLOSED DUPLICATE of bug 66457
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-06 16:58 EST by Shaun Skelton CLA
Modified: 2011-02-09 09:11 EST (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 Shaun Skelton CLA 2006-01-06 16:58:25 EST
Eclipse 3.2 M4

When refactoring a local variable to a field, comments above seem to be eaten.

Procedure:
-Create Local variable with a block comment above

i.e 
/**
* Comment
*/

ResourceManager resource = ...

-Select and right-click
-Refactor -> Convert Local Variable to Field
-Block Comment should dissapear
Comment 1 Martin Aeschlimann CLA 2006-01-10 12:39:10 EST
In the example you give, the comment is not associated with the local (empty line in between) and will not be touched. So no problem there.
But without empty line you're right. The created field should get the comment that was associated with the VariableDeclarationFragment before.

This could be solved with a trick to simply move the VariableDeclarationFragment (instead of creating a FielDeclaration)
Comment 2 Deepak Azad CLA 2011-02-09 09:11:44 EST

*** This bug has been marked as a duplicate of bug 66457 ***