This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 192580

Summary: [Type Migration] Add ability to refactor the type of a member variable. [70cat]
Product: editor Reporter: esmithbss <esmithbss>
Component: RefactoringAssignee: Ralph Ruijs <ralphbenjamin>
Status: REOPENED ---    
Severity: normal CC: muellermi, ralphbenjamin, zimmi
Priority: P3    
Version: 8.2   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description esmithbss 2010-11-28 03:46:13 UTC
Product Version = NetBeans IDE Dev (Build 201011250001)
Operating System = Windows XP version 5.1 running on x86
Java; VM; Vendor = 1.6.0_20
Runtime = Java HotSpot(TM) Client VM 16.3-b01

A very helpful refactoring would be the ability to refactor a member variable's type such that all of it's uses within the class are automatically re-typed as well.

I understand this is a very difficult refactoring due to the internal analysis of the class; however, starting with parameter types for setters/getters, type casts and the variable declaration itself is a great first step.
Comment 1 Geertjan Wielenga 2011-09-11 20:02:44 UTC
I agree, would be great to have this. Now that we're able to change the name of a property and have the names of the getters and setters be updated at the same time, it would be great to also be able to change the TYPE of the property and have the TYPE of the getters and setters be updated at the same time!
Comment 2 Ralph Ruijs 2011-10-20 08:27:55 UTC
*** Bug 203242 has been marked as a duplicate of this bug. ***
Comment 3 Martin Balin 2016-07-07 07:31:42 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss
Comment 4 joelmob 2016-11-30 14:09:39 UTC
I can reproduce this in NetBeans IDE 8.2 (Build 201609300101). I find no way to refactor the type of a member variable.

Intellij Community have this, if someone want to try to find out how they do it the source can be found here:

Here is a explanation of Type Migration from Jetbrains,
The Type Migration refactoring allows you to automatically change a member type (e.g. from integer to string), and data flow dependent type entries, like method return types, local variables, parameters etc. across the entire project. It also lets automatically convert variable or method return type between arrays and collections. If any conflicts are found IntelliJ IDEA warns you about them.