1
2
3
4
5
6
7
8
9
10
11 package com.puppycrawl.tools.checkstyle.checks.indentation.indentation;
12
13
14 class Example2 {
15 String field = "example";
16 int[] values = {
17 10,
18 20,
19 30
20 };
21
22 void processValues() throws Exception {
23 handleValue("Test String", 42);
24 }
25
26 void handleValue(String aFooString,
27 int aFooInt) {
28
29 boolean cond1,cond2,cond3,cond4,cond5,cond6;
30 cond1=cond2=cond3=cond4=cond5=cond6=false;
31
32 if (cond1
33 || cond2) {
34 field = field.toUpperCase()
35 .concat(" TASK");
36 }
37
38 if ((cond1 && cond2)
39 || (cond3 && cond4)
40 || !(cond5 && cond6)) {
41 field.toUpperCase()
42 .concat(" TASK")
43 .chars().forEach(c -> {
44 System.out.println((char) c);
45 });
46 }
47 }
48
49 void demonstrateSwitch() throws Exception {
50 switch (field) {
51 case "EXAMPLE": processValues();
52 case "COMPLETED": handleValue("Completed Case", 456);
53 }
54 }
55 }
56
57
58
59