Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 223743 - Renaming a variable - wrong behavior
Renaming a variable - wrong behavior
Product: cnd
Classification: Unclassified
Component: Navigation
PC Linux
: P3 (vote)
: 7.4
Assigned To: Egor Ushakov
Depends on:
  Show dependency treegraph
Reported: 2012-12-12 21:07 UTC by crimcat
Modified: 2013-05-24 02:45 UTC (History)
0 users

See Also:
Issue Type: DEFECT


Note You need to log in before you can comment on or make changes to this bug.
Description crimcat 2012-12-12 21:07:19 UTC
Example code:
function_test(int param) {
    int z = param * (param - 10);
    param = z * z;
    return param;
1) Let' select param identifier, in return statement. Press Ctrl-R for renaming. After the blue highlights appeared on all 'param' identifiers move the cursor right before the first letter - 'p'. Press 'Backspace' to move the identifier close to the 'return' keyword. Only this 'param' identifier is moved, others stay in their places. Then press 'Space' to fix wrong backspace editing operation. Result - all 'param' identifiers in the function are preceded with ' ' (space).
2) Position the cursor inside the 'param' identifier, press 'Space'. It's allowed to insert 'space' character inside the identifier. Then press 'Enter' to finish code refactoring. The result: space character is inserted into all 'param' identifiers within the function. This is wrong behavior, because any refactoring should lead to syntactically correct code.
Comment 1 Egor Ushakov 2013-05-23 13:46:39 UTC
I've fixed the problem when you backspace-delete from the beginning of the identifier, now it is impossible:
The rest will not be fixed for now, currently we do not do any validation of the name entered, you can enter spaces, semicolons, etc. The same way you can name any variable with space inside and it will not compile.
Comment 2 Quality Engineering 2013-05-24 02:45:10 UTC
Integrated into 'main-golden', will be available in build *201305232300* on (upload may still be in progress)
User: Egor Ushakov <>
Log: fixed #223743 - Renaming a variable - wrong behavior

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