Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 270953 - Refactor -> Introduce Method... inside lambda does not consider referenced finals
Refactor -> Introduce Method... inside lambda does not consider referenced fi...
Product: java
Classification: Unclassified
Component: Refactoring
All All
: P2 (vote)
: Dev
Assigned To: Svata Dedic
Depends on:
  Show dependency treegraph
Reported: 2017-06-23 22:35 UTC by SirIntellegence
Modified: 2017-07-26 02:08 UTC (History)
0 users

See Also:
Issue Type: DEFECT

java test file (490 bytes, text/plain)
2017-06-23 22:35 UTC, SirIntellegence

Note You need to log in before you can comment on or make changes to this bug.
Description SirIntellegence 2017-06-23 22:35:21 UTC
Created attachment 164615 [details]
java test file

Using the attached java file, select all or part of the contents of the lambda expression (excluding the "item->"), and use Refactor -> Introduce Method. The resulting method will only have one param for "item" and none for the referenced explicit and implicit final variables.
Comment 1 SirIntellegence 2017-06-23 22:37:51 UTC
This bug results in users having to introduce a method manually or resorting to creative solutions... (Like Refactor->Convert Anonymous to Member)
Comment 2 Svata Dedic 2017-06-30 13:37:37 UTC
Fixed in jet-main#4d867a2b7bc7
Comment 3 Quality Engineering 2017-07-26 02:08:56 UTC
Integrated into 'main-silver', will be available in build *201707260001* on (upload may still be in progress)

User: Svata Dedic <>
Log: #270953: introduce method must scan the whole method for local variable accesses, not just the lambda

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