aboutsummaryrefslogtreecommitdiff
path: root/src/test/resources/com/puppycrawl/tools/checkstyle/checks/blocks/leftcurly/InputLeftCurlyNlowSwitch.java
blob: 92742fb9abec2931209503c844cd067d0359f6d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package com.puppycrawl.tools.checkstyle.checks.blocks.leftcurly;
/**
  * This test-input is intended to be checked using following configuration:
  *
  * option = NLOW
  *
  */
public class InputLeftCurlyNlowSwitch {

    public void doStuff() {
        int x = 1;
        switch (x) {
            case 0:
            { // warn
                break;
            }
            case (1
                + 0):
            { // OK, wrapped line
                break;
            }
            case 2: {
                break;
            }
            default
                :
            { // OK, wrapped line
                break;
            }
            case 3:
            case 4:
                x++;
                { // OK, standalone block
                }
                break;
            case 5: {
                    x++;
                }
                x++;
                break;
        }
        switch (x) {
            case
                0:
            { // OK, wrapped line
                break;
            }
            default:
                // do nothing
        }
    }

}