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.

Bug 270953 - Refactor -> Introduce Method... inside lambda does not consider referenced finals
Summary: Refactor -> Introduce Method... inside lambda does not consider referenced fi...
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 8.2
Hardware: All All
: P2 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-23 22:35 UTC by SirIntellegence
Modified: 2017-07-26 02:08 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


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

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 http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/4d867a2b7bc7
User: Svata Dedic <sdedic@netbeans.org>
Log: #270953: introduce method must scan the whole method for local variable accesses, not just the lambda