1 package com.google.checkstyle.test.chapter4formatting.rule42blockindentation;
2
3 class InputIndentationCorrectIfAndParameter {
4
5 String getString(int someInt, String someString) {
6 return "String";
7 }
8
9 void fooMethodWithIf() {
10
11 if (conditionFirst("Loooooooooooooooooong", new
12 SecondClassLongNam3("Loooooooooooooooooog").
13 getInteger(new FooIfClass(), "Loooooooooooooooooog"),
14 new InnerClassFoo())) {}
15
16 if (conditionSecond(10000000000.0, new
17 SecondClassLongNam3("Looooooooooooo"
18 + "oooooooooooong").getString(new FooIfClass(),
19 new SecondClassLongNam3("loooooooooong").
20 getInteger(new FooIfClass(), "loooooooooooooong")), "loooooooooooong")
21 || conditionThird(2048) || conditionFourth(new
22 SecondClassLongNam3("Looooooooooooooo"
23 + "ooooooooooooong").getBoolean(new FooIfClass(), false)) ||
24 conditionFifth(true, new SecondClassLongNam3(getString(2048, "Looo"
25 + "ooooooooooooooooooooooooooooooooooooooooooong")).getBoolean(
26 new FooIfClass(), true)) || conditionSixth(false, new
27 SecondClassLongNam3(getString(100000, "Loooooong"
28 + "Fooooooo><"))) || conditionNoArg()
29 || conditionNoArg() ||
30 conditionNoArg() || conditionNoArg()) {}
31 }
32
33 private boolean conditionFirst(String longString, int
34 integer, InnerClassFoo someInstance) {
35 return false;
36 }
37
38 private boolean conditionSecond(double longLongLongDoubleValue,
39 String longLongLongString, String secondLongLongString) {
40 return false;
41 }
42
43 private boolean conditionThird(long veryLongValue) {
44 return false;
45 }
46
47 private boolean conditionFourth(boolean flag) {
48 return false;
49 }
50
51 private boolean conditionFifth(boolean flag1, boolean flag2) {
52 return false;
53 }
54
55 private boolean conditionSixth(boolean flag,
56 SecondClassLongNam3 instance) {
57 return false;
58 }
59
60 private boolean conditionNoArg() {
61 return false;
62 }
63
64 class InnerClassFoo {
65
66 void fooMethodWithIf() {
67 if (conditionFirst("Loooooooooooooooooong", new
68 SecondClassLongNam3("Loooooooooooooooooog").
69 getInteger(new FooIfClass(), "Loooooooooooooooooog"),
70 new InnerClassFoo())) {}
71
72 if (conditionSecond(10000000000.0, new
73 SecondClassLongNam3("Looooooooooooo"
74 + "oooooooooooong").getString(new FooIfClass(),
75 new SecondClassLongNam3("loooooooooong").
76 getInteger(new FooIfClass(), "loooooooooooooong")), "loooooooooooong")
77 || conditionThird(2048) || conditionFourth(new
78 SecondClassLongNam3("Looooooooooooooo"
79 + "ooooooooooooong").getBoolean(new FooIfClass(), false)) ||
80 conditionFifth(true, new SecondClassLongNam3(getString(2048, "Looo"
81 + "ooooooooooooooooooooooooooooooooooooooooooong")).getBoolean(
82 new FooIfClass(), true)) || conditionSixth(false, new
83 SecondClassLongNam3(getString(100000, "Loooooong"
84 + "Fooooooo><"))) || conditionNoArg()
85 || conditionNoArg() ||
86 conditionNoArg() || conditionNoArg()) {}
87 }
88
89 FooIfClass anonymousClass = new FooIfClass() {
90
91 void fooMethodWithIf(String stringStringStringStringLooooongString,
92 int intIntIntVeryLongNameForIntVariable, boolean
93 fooooooooobooleanBooleanVeryLongName) {
94
95 if (conditionFirst("Loooooooooooooooooong", new
96 SecondClassLongNam3("Loooooooooooooooooog").
97 getInteger(new FooIfClass(), "Loooooooooooooooooog"),
98 new InnerClassFoo())) {}
99
100 if (conditionSecond(10000000000.0, new
101 SecondClassLongNam3("Looooooooooooo"
102 + "oooooooooooong").getString(new FooIfClass(),
103 new SecondClassLongNam3("loooooooooong").
104 getInteger(new FooIfClass(), "looooooooooooong")), "loooooooooooong")
105 || conditionThird(2048) || conditionFourth(new
106 SecondClassLongNam3("Looooooooooooooo"
107 + "ooooooooooooong").getBoolean(new FooIfClass(), false)) ||
108 conditionFifth(true, new SecondClassLongNam3(getString(2048, "Lo"
109 + "ooooooooooooooooooooooooooooooooooooooooooong")).getBoolean(
110 new FooIfClass(), true)) || conditionSixth(false, new
111 SecondClassLongNam3(getString(100000, "Loooooong"
112 + "Fooooooo><"))) || conditionNoArg()
113 || conditionNoArg() ||
114 conditionNoArg() || conditionNoArg()
115 && fooooooooobooleanBooleanVeryLongName) {}
116 }
117 };
118 }
119 }
120
121 class SecondClassLongNam3 {
122
123 public SecondClassLongNam3(String string) {
124
125 }
126
127 String getString(FooIfClass instance, int integer) {
128 return "String";
129 }
130
131 int getInteger(FooIfClass instance, String string) {
132 return -1;
133 }
134
135 boolean getBoolean(FooIfClass instance, boolean flag) {
136 return false;
137 }
138
139 SecondClassLongNam3 getInstance() {
140 return new SecondClassLongNam3("VeryLoooooooooo"
141 + "oongString");
142 }
143 }
144 class FooIfClass {}