1 package com.google.checkstyle.test.chapter4formatting.rule4841indentation;
2
3 class InputIndentationCorrectWhileDoWhileAndParameter {
4
5 String getString(int someInt, String someString) {
6 return "String";
7 }
8
9 void fooMethodWithIf() {
10
11 while (conditionFirst("Loooooooooooooooooong", new
12 SecondWhileLongName("Loooooooooooooooooog").
13 getInteger(new FooWhileClass(), "Loooooooooooooooooog"),
14 new InnerClassFoo())) {}
15
16 do {
17
18 } while (conditionFirst("Loooooooooooooooooong", new
19 SecondWhileLongName("Loooooooooooooooooog").
20 getInteger(new FooWhileClass(), "Loooooooooooooooooog"),
21 new InnerClassFoo()));
22
23 while (conditionSecond(10000000000.0, new
24 SecondWhileLongName("Looooooooooooo"
25 + "oooooooooooong").getString(new FooWhileClass(),
26 new SecondWhileLongName("loooooooooong").
27 getInteger(new FooWhileClass(), "loooooooooooooong")), "loooooooooooong")
28 || conditionThird(2048) || conditionFourth(new
29 SecondWhileLongName("Looooooooooooooo"
30 + "ooooooooooooong").getBoolean(new FooWhileClass(), false)) ||
31 conditionFifth(true, new SecondWhileLongName(
32 getString(2048, "Looo"
33 + "ooooooooooooooooooooooooooooooooooooooooooong")).getBoolean(
34 new FooWhileClass(), true)) || conditionSixth(false, new
35 SecondWhileLongName(getString(100000, "Loooooong"
36 + "Fooooooo><"))) || conditionNoArg()
37 || conditionNoArg() ||
38 conditionNoArg() || conditionNoArg()) {}
39
40 do {
41
42 } while (conditionSecond(10000000000.0, new
43 SecondWhileLongName("Looooooooooooo"
44 + "oooooooooooong").getString(new FooWhileClass(),
45 new SecondWhileLongName("loooooooooong").
46 getInteger(new FooWhileClass(), "loooooooong")), "loooooooooooong")
47 || conditionThird(2048) || conditionFourth(new
48 SecondWhileLongName("Looooooooooooooo"
49 + "ooooooooooooong").getBoolean(new FooWhileClass(), false)) ||
50 conditionFifth(true, new SecondWhileLongName(getString(2048, "Looo"
51 + "ooooooooooooooooooooooooooooooooooooooooooong")).getBoolean(
52 new FooWhileClass(), true)) || conditionSixth(false, new
53 SecondWhileLongName(getString(100000, "Loooooong"
54 + "Fooooooo><"))) || conditionNoArg()
55 || conditionNoArg() ||
56 conditionNoArg() || conditionNoArg());
57 }
58
59 private boolean conditionFirst(String longString, int
60 integer, InnerClassFoo someInstance) {
61 return false;
62 }
63
64 private boolean conditionSecond(double longLongLongDoubleValue,
65 String longLongLongString, String secondLongLongString) {
66 return false;
67 }
68
69 private boolean conditionThird(long veryLongValue) {
70 return false;
71 }
72
73 private boolean conditionFourth(boolean flag) {
74 return false;
75 }
76
77 private boolean conditionFifth(boolean flag1, boolean flag2) {
78 return false;
79 }
80
81 private boolean conditionSixth(boolean flag,
82 SecondWhileLongName instance) {
83 return false;
84 }
85
86 private boolean conditionNoArg() {
87 return false;
88 }
89
90 class InnerClassFoo {
91
92 void fooMethodWithIf() {
93 while (conditionFirst("Loooooooooooooooooong", new
94 SecondWhileLongName("Loooooooooooooooooog").
95 getInteger(new FooWhileClass(), "Loooooooooooooooooog"),
96 new InnerClassFoo())) {}
97
98 do {
99
100 } while (conditionFirst("Loooooooooooooooooong", new
101 SecondWhileLongName("Loooooooooooooooooog").
102 getInteger(new FooWhileClass(), "Loooooooooooooooooog"),
103 new InnerClassFoo()));
104
105 while (conditionSecond(10000000000.0, new
106 SecondWhileLongName("Looooooooooooo"
107 + "oooooooooooong").getString(new FooWhileClass(),
108 new SecondWhileLongName("loooooooooong").
109 getInteger(new FooWhileClass(), "loooooooooooong")), "loooooooooooong")
110 || conditionThird(2048) || conditionFourth(new
111 SecondWhileLongName("Looooooooooooooo"
112 + "ooooooooooooong").getBoolean(new FooWhileClass(), false)) ||
113 conditionFifth(true, new SecondWhileLongName(getString(2048, "Looo"
114 + "ooooooooooooooooooooooooooooooooooooooooooong")).getBoolean(
115 new FooWhileClass(), true)) || conditionSixth(false, new
116 SecondWhileLongName(getString(100000, "Loooooong"
117 + "Fooooooo><"))) || conditionNoArg()
118 || conditionNoArg() ||
119 conditionNoArg() || conditionNoArg()) {}
120
121 do {
122
123 } while (conditionSecond(10000000000.0, new
124 SecondWhileLongName("Looooooooooooo"
125 + "oooooooooooong").getString(new FooWhileClass(),
126 new SecondWhileLongName("loooooooooong").
127 getInteger(new FooWhileClass(), "loooooooooooong")), "loooooooooooong")
128 || conditionThird(2048) || conditionFourth(new
129 SecondWhileLongName("Looooooooooooooo"
130 + "ooooooooooooong").getBoolean(new FooWhileClass(), false)) ||
131 conditionFifth(true, new SecondWhileLongName(getString(2048, "Looo"
132 + "ooooooooooooooooooooooooooooooooooooooooooong")).getBoolean(
133 new FooWhileClass(), true)) || conditionSixth(false, new
134 SecondWhileLongName(getString(100000, "Loooooong"
135 + "Fooooooo><"))) || conditionNoArg()
136 || conditionNoArg() ||
137 conditionNoArg() || conditionNoArg());
138 }
139
140 FooWhileClass anonymousClass = new FooWhileClass() {
141
142 void fooMethodWithIf(String stringStringStringStringLooooongString,
143 int intIntIntVeryLongNameForIntVariable, boolean
144 fooooooooobooleanBooleanVeryLongName) {
145
146 while (conditionFirst("Loooooooooooooooooong", new
147 SecondWhileLongName("Loooooooooooooooooog").
148 getInteger(new FooWhileClass(), "Loooooooooooooooooog"),
149 new InnerClassFoo())) {}
150
151 do {
152
153 } while (conditionFirst("Loooooooooooooooooong", new
154 SecondWhileLongName("Loooooooooooooooooog").
155 getInteger(new FooWhileClass(), "Loooooooooooooooooog"),
156 new InnerClassFoo()));
157
158 while (conditionSecond(10000000000.0, new
159 SecondWhileLongName("Looooooooooooo"
160 + "oooooooooooong").getString(new FooWhileClass(),
161 new SecondWhileLongName("loooooooooong").
162 getInteger(new FooWhileClass(), "loooooooooong")), "loooooooooooong")
163 || conditionThird(2048) || conditionFourth(new
164 SecondWhileLongName("Looooooooooooooo"
165 + "ooooooooooooong").getBoolean(new FooWhileClass(), false)) ||
166 conditionFifth(true, new SecondWhileLongName(getString(2048, "Lo"
167 + "ooooooooooooooooooooooooooooooooooooooooooong")).getBoolean(
168 new FooWhileClass(), true)) || conditionSixth(false, new
169 SecondWhileLongName(getString(100000, "Loooooong"
170 + "Fooooooo><"))) || conditionNoArg()
171 || conditionNoArg() ||
172 conditionNoArg() || conditionNoArg()
173 && fooooooooobooleanBooleanVeryLongName) {}
174
175 do {
176
177 } while (conditionSecond(10000000000.0, new
178 SecondWhileLongName("Looooooooooooo"
179 + "oooooooooooong").getString(new FooWhileClass(),
180 new SecondWhileLongName("loooooooooong").
181 getInteger(new FooWhileClass(), "loooooooooong")), "loooooooooooong")
182 || conditionThird(2048) || conditionFourth(new
183 SecondWhileLongName("Looooooooooooooo"
184 + "ooooooooooooong").getBoolean(new FooWhileClass(), false)) ||
185 conditionFifth(true, new SecondWhileLongName(getString(2048, "Lo"
186 + "ooooooooooooooooooooooooooooooooooooooooooong")).getBoolean(
187 new FooWhileClass(), true)) || conditionSixth(false, new
188 SecondWhileLongName(getString(100000, "Loooooong"
189 + "Fooooooo><"))) || conditionNoArg()
190 || conditionNoArg() ||
191 conditionNoArg() || conditionNoArg()
192 && fooooooooobooleanBooleanVeryLongName);
193 }
194 };
195 }
196 }
197
198 class SecondWhileLongName {
199
200 public SecondWhileLongName(String string) {
201
202 }
203
204 String getString(FooWhileClass instance, int integer) {
205 return "String";
206 }
207
208 int getInteger(FooWhileClass instance, String string) {
209 return -1;
210 }
211
212 boolean getBoolean(FooWhileClass instance, boolean flag) {
213 return false;
214 }
215
216 SecondWhileLongName getInstance() {
217 return new SecondWhileLongName("VeryLoooooooooo"
218 + "oongString");
219 }
220 }
221 class FooWhileClass {}