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 253914 - Introduce variable does not work properly inside a lambda expression
Summary: Introduce variable does not work properly inside a lambda expression
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 8.1
Hardware: PC Windows 8
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-28 18:25 UTC by misterm
Modified: 2015-08-05 01:19 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (20.76 KB, text/plain)
2015-07-28 18:25 UTC, misterm
Details

Note You need to log in before you can comment on or make changes to this bug.
Description misterm 2015-07-28 18:25:28 UTC
For this lambda:

field.getAnnotationMirrors().stream().anyMatch(mirror -> ((QualifiedNameable)mirror.getAnnotationType().asElement()).getQualifiedName().contentEquals(INJECT))

If I select:

((QualifiedNameable)mirror.getAnnotationType().asElement()).getQualifiedName()

and Introduce variable..., the variable is declared *outside* the lambda, which breaks the code.

Product Version = NetBeans IDE Dev (Build 20150721-1f9bde712944)
Operating System = Windows 8 version 6.2 running on amd64
Java; VM; Vendor = 1.8.0_40
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.40-b25
Comment 1 misterm 2015-07-28 18:25:33 UTC
Created attachment 154981 [details]
IDE log
Comment 2 Svata Dedic 2015-08-04 15:18:19 UTC
Fixed in jet-main#825f308c62f3
Comment 3 Quality Engineering 2015-08-05 01:19:13 UTC
Integrated into 'main-silver', will be available in build *201508050002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/825f308c62f3
User: Svata Dedic <sdedic@netbeans.org>
Log: #253914: introduce variable is able to convert lambda expression into lambda with a body