1
2
3
4
5
6
7
8 package com.puppycrawl.tools.checkstyle.checks.whitespace.whitespaceafter;
9
10 class InputWhitespaceAfterBraces
11 {
12
13 boolean condition()
14 {
15 return false;
16 }
17
18
19 void testDoWhile()
20 {
21
22 do {
23 testDoWhile();
24 }
25 while (condition());
26
27
28 do testDoWhile(); while (condition());
29 }
30
31
32 void testWhile()
33 {
34
35 while (condition()) {
36 testWhile();
37 }
38
39
40 while(condition());
41 while (condition())
42 testWhile();
43 while (condition())
44 if (condition())
45 testWhile();
46 }
47
48
49 void testFor()
50 {
51
52 for (int i = 1; i < 5; i++) {
53 testFor();
54 }
55
56
57 for(int i = 1;i < 5;i++);
58 for (int i = 1; i < 5; i++)
59 testFor();
60 for (int i = 1; i < 5;
61 i++)
62 if (i > 2)
63 testFor();
64 }
65
66
67 public void testIf()
68 {
69
70 if (condition()) {
71 testIf();
72 }
73 else if (condition()) {
74 testIf();
75 }
76 else {
77 testIf();
78 }
79
80
81 if (condition());
82 if (condition())
83 testIf();
84 if (condition())
85 testIf();
86 else
87 testIf();
88 if (condition())
89 testIf();
90 else {
91 testIf();
92 }
93 if (condition()) {
94 testIf();
95 }
96 else
97 testIf();
98 if (condition())
99 if (condition())
100 testIf();
101 }
102
103 void whitespaceAfterSemi()
104 {
105
106 int i = 1;int j = 2;
107
108
109 for (;;) {
110 }
111 }
112
113
114 public InputWhitespaceAfterBraces() {}
115
116
117 public void emptyImplementation() {}
118 }