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