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 270558

Summary: unexpectet indentation
Product: ide Reporter: muellermi <muellermi>
Component: CodeAssignee: issues@ide <issues>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.2   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:
Attachments: IDE log

Description muellermi 2017-05-04 10:08:27 UTC
Product Version = NetBeans IDE 8.2 (Build 201609300101)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.8.0_112
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.112-b15

Reproducibility: Happens every time

given this code, formated as expected:

        _priorCalcBasics.getCostCenterCosts().stream()
                .map((ccc) -> {
                    KGLListCostCenterCost c = new KGLListCostCenterCost();
                    c.setPrior(ccc);
                    c.setCostCenterText(ccc.getCostCenterText());
                    c.setCostCenter(ccc.getCostCenter());
                    c.setPriorId(ccc.getPriorId());
                    c.setDepartmentKey(ccc.getDepartmentKey());
                    return c;
                }).forEachOrdered((c) -> {
                    calcBasics.getCostCenterCosts().add(c);
                });

now format the code (Alt+Shift+F):

        _priorCalcBasics.getCostCenterCosts().stream()
                .map((ccc) -> {
                    KGLListCostCenterCost c = new KGLListCostCenterCost();
                    c.setPrior(ccc);
                    c.setCostCenterText(ccc.getCostCenterText());
                    c.setCostCenter(ccc.getCostCenter());
                    c.setPriorId(ccc.getPriorId());
                    c.setDepartmentKey(ccc.getDepartmentKey());
                    return c;
                }).forEachOrdered((c) -> {
            calcBasics.getCostCenterCosts().add(c);
        });

NetBeans does not indent the forEach loop properly, shall be formated as above (more readable and expected by checkstyle)
Comment 1 muellermi 2017-05-04 10:08:34 UTC
Created attachment 164244 [details]
IDE log