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.
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.
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.
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