Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 326881 - [quick fix] Annotation quick fix should not be losing information
Summary: [quick fix] Annotation quick fix should not be losing information
Status: CLOSED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-04 01:34 EDT by Ankur Sharma CLA
Modified: 2019-10-15 08:28 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 Ankur Sharma CLA 2010-10-04 01:34:52 EDT
Steps to reproduce

1. Create a simple annotation with one or more attributes but no default value

public @interface MyAnnotation {
	String author();
}


2. Annotate a class using this

@MyAnnotation("ankur")
public class AnnotationTest {

}

3. The @MyAnnotation("ankur") will be correctly marked for error.
4. Choose the quick fix "Add missing attributes"
5. The result of running the quick fix is 

@MyAnnotation(author = "")

This loses the information and I will have to undo the the quick fix to copy the attribute value to clipboard before fixing it.

Ideal fix would be 
@MyAnnotation(author = "ankur")

In presence of multiple attributes, the existing value could be assigned to first (type) matching attribute.
Comment 1 Dani Megert CLA 2010-10-04 03:25:47 EDT
Fix to go into MissingAnnotationAttributesProposal.addMissingAtributes(ITypeBinding, ListRewrite).
Comment 2 Eclipse Genie CLA 2019-10-15 08:28:26 EDT
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.