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 - Default case doesn't indent
Summary: Default case doesn't indent
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.2
Hardware: PC Other
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-09 10:01 UTC by cezariusz
Modified: 2016-07-09 10:01 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 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:
        }
    }