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 262743

Summary: Default case doesn't indent
Product: java Reporter: cezariusz <cezariusz>
Component: EditorAssignee: Dusan Balek <dbalek>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.2   
Hardware: PC   
OS: Other   
Issue Type: DEFECT Exception Reporter:

Description cezariusz 2016-07-09 10:01:30 UTC
Product Version: NetBeans IDE Dev (Build 201606280002)
Java: 1.8.0_60; Java HotSpot(TM) 64-Bit Server VM 25.60-b23
Runtime: Java(TM) SE Runtime Environment 1.8.0_60-b27
System: Windows 10 version 10.0 running on amd64; Cp1250; pl_PL (nb)

The default case doesn't indent automatically.

    public void test() {
        String str = "a";
        int n;
        switch (str) {
            case "a":
                n = 1;
                break;
            case "b":
                n = 5;
                break;
                |
        }
    }

Having cursor at the | position enter "default:" and press enter - it won't be aligned with "case".

EXPECTED:

    public void test() {
        String str = "a";
        int n;
        switch (str) {
            case "a":
                n = 1;
                break;
            case "b":
                n = 5;
                break;
            default:
        }
    }

ACTUAL:

    public void test() {
        String str = "a";
        int n;
        switch (str) {
            case "a":
                n = 1;
                break;
            case "b":
                n = 5;
                break;
                default:
        }
    }