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 249828 - Enter should accept default parameter
Summary: Enter should accept default parameter
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 8.0.2
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on: 250412
Blocks:
  Show dependency tree
 
Reported: 2015-01-15 12:54 UTC by cezariusz
Modified: 2015-07-27 08:14 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description cezariusz 2015-01-15 12:54:32 UTC
Steps to reproduce:
1. Write some code returning a value, for example:
Integer.parseInt("10");
2. Call hint (Alt-Enter or Ctrl-1 if using Eclipse keybinding like me).
3. Select "Assign Return Value To New Variable" (should be the only option).
4. Press Enter to accept it.
5. You will get:
int parseInt = Integer.parseInt("10");
with the "parseInt" variable selected.
6. Press Enter again to accept the suggested variable name.
Expected result:
* variable name accepted, cursor at the end of the current line:
int parseInt = Integer.parseInt("10");|
Actual result:
* variable name deleted leaving the following erroneous code:
            int 
                    = Integer.parseInt("10");
Comment 1 Svata Dedic 2015-02-13 11:44:37 UTC
Good point. I'll invoke 'instant rename' after the refactoring; however some systematic support to rename/change generated identifiers/expressions would be nice - tracked as issue #250412.

Fixed in jet-main#ea9160bab304
Comment 2 Quality Engineering 2015-02-28 09:02:34 UTC
Integrated into 'main-silver', will be available in build *201502280001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/ea9160bab304
User: Svata Dedic <sdedic@netbeans.org>
Log: #249828: instant rename is invoked after refactoring
Comment 3 cezariusz 2015-07-27 08:14:47 UTC
Verified with Build 201507240001.