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 79257

Summary: alowing refactoring to work on (string) data, as well as code
Product: editor Reporter: hefest <hefest>
Component: RefactoringAssignee: Jan Becicka <jbecicka>
Status: RESOLVED WONTFIX    
Severity: blocker CC: jglick, vidhyadharantechdays
Priority: P3    
Version: 5.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description hefest 2006-06-27 21:50:46 UTC
From my message ("refactoring so constrained it becomes useless") on
nbdev@netbeans.org:

...
4.) string manipulation should be improved: if I have a class
mytestpackage.MyClass which I want to rename to
com.mycompany.myproduct.some.package.SensibleClassName, the
refactoring algorithm should e.g. notice that there are strings in the
file like "mytestpackage.MyClass" (in, say, a Class.forName()
statement) and transform it into
"com/mycompany/myproduct/some/package/SensibleClassName"
5.) the same goes for moving/renaming packages: the refactoring
algorithm should detect  strings in the file like
"mytestpackage/an_image.jpg" and transform it into
"com/mycompany/myproduct/some/package/an_image.jpg"

Some of these are probably implemented and only the first two ideas
are an exact science (the rest can't be guaranteed to be correct
without intelligent supervision on a case by case base), but
refactoring - through no fault of it's own - is basically severely
undercut.
...

Basically, I suggest dividing changes into "certainly necessary" and something
like "probably should be done, but it's your call". The above examples fall into
the second category.
Jesse Glick had the following idea:
"The simplest approach is to assume that any string constant matching the name
should be changed; this should get most or all references but may change
something it shouldn't."
I believe that 90+% of refactoring suggestions made this way would be good so
it's a good idea, as long as the user can pick and choose the changes he/she
wants done.
There's room for improovement in the before/after comparison frame as well: in
this respect, using the eclipse code comparison dialog might not be a bad idea.
Comment 1 Ralph Ruijs 2012-05-09 09:22:59 UTC
*** Bug 212160 has been marked as a duplicate of this bug. ***
Comment 2 Martin Balin 2016-07-07 07:30:00 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