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