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.
Rename of a lambda argument can successfully be renamed by CTRL+R except for if that lambda argument hides a member variable or is implicitly typed. Given the following example: private boolean o1; private void bogie() { Collections.<String>sort(Collections.<String>emptyList(), (o1, o2) -> { return o1.length() - o2.length(); }); } Netbeans will inform that "Local variable hides a field". Executing action "Rename Local Variable" OR placing the cursor on `o1' in the lambda argument and hitting CTRL+R will not do anything. Placing on `o1' in the lambda body will incorrectly rename the member variable name, not the argument list name. Note that o2 can be renamed quite fine. If the lambda arguments are explicitly typed the rename works correctly: private boolean o1; private void bogie() { Collections.<String>sort(Collections.<String>emptyList(), (String o1, String o2) -> { return o1.length() - o2.length(); }); }
Highlighting is not working correctly in this case as well. I think this should be fixed in java/source, but please reassign if this is not the right component.
Fixed in jet-main#3fa549217d1a
*** Bug 241502 has been marked as a duplicate of this bug. ***
Integrated into 'main-silver', will be available in build *201402140001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/3fa549217d1a User: Svata Dedic <sdedic@netbeans.org> Log: #240912: support highlight of lambda implicit params