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 238075 - Introduce Method/Field refactoring breaks lambda code
Summary: Introduce Method/Field refactoring breaks lambda code
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-07 03:45 UTC by Alexander Kouznetsov
Modified: 2013-12-05 02:53 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Kouznetsov 2013-11-07 03:45:54 UTC
Whenever I have lambda code like:

button.setOnAction(t -> {
    // some code here
});

and apply Introduce Method/Field refactoring to some code inside, I end up with doubled opening brace which breaks code compilation:

button.setOnAction(t -> {{
    // newMethod/newVariable here
});
Comment 1 Svata Dedic 2013-11-29 17:26:48 UTC
Actually when lambda contents is somehow changed + class changed so that the lambda tree itself is diffed, curly braces double for lambdas without parenthesis around their parameter.

Fixed in http://hg.netbeans.org/jet-main/rev/0922840b6b2c
Comment 2 Quality Engineering 2013-12-05 02:53:57 UTC
Integrated into 'main-silver', will be available in build *201312050002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/0922840b6b2c
User: Svata Dedic <sdedic@netbeans.org>
Log: #238075: patching lambda stops copying at arrow for lambdas without parenthesis