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.
Code sample snippet, with desired formatting: new ArrayList<>().stream() .filter(o -> true) .forEach(o -> { System.out.println(""); }); Code sample after formatting: new ArrayList<>().stream() .filter(o -> true) .forEach(o -> { System.out.println(""); }); I am increasing the priority since it is a regression from 8.0.2. I just realized it because it generated a lot of changes in our code base. Product Version: NetBeans IDE Dev (Build 20150818-602910034ac6) Java: 1.8.0_51; Java HotSpot(TM) 64-Bit Server VM 25.51-b03 Runtime: Java(TM) SE Runtime Environment 1.8.0_51-b16 System: Linux version 3.4.63-2.44-desktop running on amd64; UTF-8; en_US (nb)
Another sample, before formatting (expected): new ArrayList<>().stream() .filter(o -> true) .map(o -> { return o; }) .collect(toList()); After formatting (unexpected and not desired): new ArrayList<>().stream() .filter(o -> true) .map(o -> { return o; }) .collect(toList());
Reproducable in Build 201508230002
Unfortunately, I cannot reproduce the issue with the default formatting options using the current dev build. Could you please specify a non-default formatting options that you are using? Thanks.
Ok, you were right. I found the specific issue here. I need to have the 'Wrap After Lambda Arrow' option turned on at Java | Wrapping section of formatting options.
Fixed in jet-main. http://hg.netbeans.org/jet-main/rev/4cb5e94b6942
Integrated into 'main-silver', will be available in build *201508290002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/4cb5e94b6942 User: Dusan Balek <dbalek@netbeans.org> Log: Issue #254665 - Formatting of lambda bodies is incorrect when compared with previous version - fixed.
v. Build 20150901-35e5ab47fab7