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 215138 - Inline field refactoring does not work as expected
Summary: Inline field refactoring does not work as expected
Status: REOPENED
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 7.2
Hardware: PC Linux
: P3 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
: 238207 240453 (view as bug list)
Depends on: 238595 238598 238614 238658 238717 238720 238948 239000 239005 239161 239187 239191 239211 239337 239397
Blocks:
  Show dependency tree
 
Reported: 2012-07-03 17:48 UTC by Michel Graciano
Modified: 2014-01-22 10:27 UTC (History)
3 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Info shown when getter/setter or comment exists (38.17 KB, image/png)
2012-07-04 13:51 UTC, Petr Somol
Details
Info shown when getter/setter or comment exists (20.97 KB, image/png)
2012-07-04 13:52 UTC, Petr Somol
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michel Graciano 2012-07-03 17:48:54 UTC
If I call field rename from Refactor > Rename, it shows a dialog with some options, as comments and getters/setters rename too. But if I use inline rename (Ctrl+R), it does not. IMHO, if the property is a JavaBean property, the dialog should be opened given the user the option to rename the getters/setters too, or at least the shortcut for Refactor > Rename should be changed.
Comment 1 Petr Somol 2012-07-04 13:51:34 UTC
Created attachment 121733 [details]
Info shown when getter/setter or comment exists

Creating a specific inline UI to specify whether or not rename getters/setters and comment occurrences seems to go against the idea of quick inline action. However, a simple yet practical solution seems to be as follows: after Ctrl-R when inline refactoring has started (all occurrences of the renamed entity emphasized and marked by rectangles), in case any relevant getters/setters or comments exist, show a passive info pop-up message as illustrated in attachment, and enable pressing Ctrl-R once more to open the existing refactoring dialog.

The info message should give accurate information, like if just a getter but no setter exist, reflect it in the message.

Alternatively to what I illustrate in the attachment, renaming getters/setters and occurrences in comments can be enabled by default and the message would just offer Ctrl-R to go to existing dialog only if users want to switch any of these options off. This might be probably the more practical option.
Comment 2 Petr Somol 2012-07-04 13:52:55 UTC
Created attachment 121734 [details]
Info shown when getter/setter or comment exists
Comment 3 Petr Somol 2012-07-04 13:56:33 UTC
As for exact wording if the alternative is accepted, I would consider:

"dummy" getter, setter and instances in comments will be renamed. Press Ctrl-R for options.
Comment 4 Michel Graciano 2012-07-04 14:08:39 UTC
(In reply to comment #2)
> Created attachment 121734 [details]
> Info shown when getter/setter or comment exists

I totally agree with this proposal.
Comment 5 Jiri Prox 2013-11-19 11:36:47 UTC
*** Bug 238207 has been marked as a duplicate of this bug. ***
Comment 6 Ralph Ruijs 2013-11-19 14:38:14 UTC
changeset   : b43f743677af
author      : Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
date        : Tue Nov 19 15:35:14 CET 2013
summary     : #215138 - Inline field refactoring does not work as expected
Comment 7 Ralph Ruijs 2013-12-12 13:50:44 UTC
After discussions with QA, the new instant refactoring is disabled by default and can be enabled by adding the startup-option -J-Dorg.netbeans.modules.java.refactoring.instantRename=true

The instant refactoring will be enabled again after all issues have been fixed.

http://hg.netbeans.org/jet-main/rev/d733d86ae410
Comment 8 Ralph Ruijs 2013-12-12 14:02:00 UTC
from bug 239205, comment 1
+ how to uncheck "Apply Rename on Comment" without mouse?
Comment 9 Quality Engineering 2013-12-13 02:51:05 UTC
Integrated into 'main-silver', will be available in build *201312130002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/d733d86ae410
User: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
Log: #215138 - InstantRename enabled by option org.netbeans.modules.java.refactoring.instantRename
Comment 10 Ralph Ruijs 2014-01-21 10:33:09 UTC
*** Bug 240453 has been marked as a duplicate of this bug. ***