Bug 337955 - [quick assist] Allow refactoring of bean property type
Summary: [quick assist] Allow refactoring of bean property type
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows XP
: P5 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2011-02-23 05:27 EST by David Balažic CLA
Modified: 2011-02-24 08:50 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 David Balažic CLA 2011-02-23 05:27:26 EST
Build Identifier: 20100917-0705

I suggest refactoring the type of a property.

- before:

private String foo;

public void setFoo(String foo){
this.foo = foo;
}

public String getFoo(){
return foo;
}


- action: select Refactor menu on the foo property definition (first line in example code) and select another desired type, eg. Long

- after:


private Long foo;

public void setFoo(Long foo){
this.foo = foo;
}

public Long getFoo(){
return foo;
}


Reproducible: Always
Comment 1 Markus Keller CLA 2011-02-23 06:01:25 EST
This can only work as long as the property is not in use yet, since there's no way to update references to the getter and setter in a way that doesn't change behavior.

This sound like a change that should better be done by hand.
Comment 2 David Balažic CLA 2011-02-23 09:10:20 EST
Limiting all changes to same file is not an option?
Or limiting the change only to property and the getter and setter?
Comment 3 Markus Keller CLA 2011-02-24 08:50:08 EST
(In reply to comment #2)
> Limiting all changes to same file is not an option?
> Or limiting the change only to property and the getter and setter?

OK, we could offer that as a quick assist (Ctrl+1) when the caret is on the type of a property.

Implementation would go into AdvancedQuickAssistProcessor (find the connected nodes and set up linked mode).