Bug 223743 - Renaming a variable - wrong behavior
Renaming a variable - wrong behavior
Status: RESOLVED FIXED
Product: cnd
Classification: Unclassified
Component: Navigation
7.3
PC Linux
: P3 (vote)
: 7.4
Assigned To: Egor Ushakov
issues@cnd
:
Depends on:
Blocks:
  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
:


Attachments

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:
---------------
int
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:
http://hg.netbeans.org/cnd-main/rev/b44aa91d3612
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 http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/b44aa91d3612
User: Egor Ushakov <gorrus@netbeans.org>
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