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.
Java sample: - select latest foo(1), press Alt+Shift+V and press OK ==> IDE replaces =============================================================== package javaapplication3; public class JavaApplication3 { public static int foo(int x) { return 2 * x; } public static void main(String[] args) { int x = foo(1) + foo(2); if (true) { int y = foo(2) + foo(1); int z = foo(1) + foo(1); // <-- replace latest foo(1) } } } =============================================================== on =============================================================== public static void main(String[] args) { final int foo = foo(1); // <-- new line int x = foo + foo(2); // <-- replaced if (true) { int y = foo(2) + foo; // <-- replaced int z = foo + foo; // <-- replaced (2 times) } } =============================================================== In C++ IDE will replace =============================================================== int foo(int x) { return 2 * x; } int main() { int x = foo(1) + foo(2); if (true) { int y = foo(2) + foo(1); int z = foo(1) + foo(1); // <-- replace latest foo(1) } } =============================================================== on int main() { int x = foo(1) + foo(2); if (true) { int y = foo(2) + foo(1); int foo = foo(1); // <-- new line int z = foo(1) + foo; // <-- replaced } } ===============================================================