Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 79257 - alowing refactoring to work on (string) data, as well as code
alowing refactoring to work on (string) data, as well as code
Status: RESOLVED WONTFIX
Product: editor
Classification: Unclassified
Component: Refactoring
5.x
All All
: P3 with 2 votes (vote)
: TBD
Assigned To: Jan Becicka
issues@java
:
: 212160 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-06-27 21:50 UTC by hefest
Modified: 2016-07-07 07:30 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo