1   package com.puppycrawl.tools.checkstyle.checks.indentation.indentation; //indent:0 exp:0
2   
3   /**                                                                           //indent:0 exp:0
4    * This test-input is intended to be checked using following configuration:   //indent:1 exp:1
5    *                                                                            //indent:1 exp:1
6    * arrayInitIndent = 4                                                        //indent:1 exp:1
7    * basicOffset = 2                                                            //indent:1 exp:1
8    * braceAdjustment = 0                                                        //indent:1 exp:1
9    * caseIndent = 4                                                             //indent:1 exp:1
10   * forceStrictCondition = false                                               //indent:1 exp:1
11   * lineWrappingIndentation = 4                                                //indent:1 exp:1
12   * tabWidth = 4                                                               //indent:1 exp:1
13   * throwsIndent = 4                                                           //indent:1 exp:1
14   *                                                                            //indent:1 exp:1
15   *                                                                            //indent:1 exp:1
16   */                                                                           //indent:1 exp:1
17  class InputIndentationCorrectIfAndParameter { //indent:0 exp:0
18  
19    String getString(int someInt, String someString) { //indent:2 exp:2
20      return "String"; //indent:4 exp:4
21    } //indent:2 exp:2
22  
23    void fooMethodWithIf() { //indent:2 exp:2
24  
25      if (conditionFirst("Loooooooooooooooooong", new //indent:4 exp:4
26          SecondClassLongNam7("Loooooooooooooooooog"). //indent:8 exp:8
27          getInteger(new InputIndentationCorrectIfAndParameter(), "Looooog"), //indent:8 exp:8
28          new InnerClassFoo())) {} //indent:8 exp:8
29  
30      if (conditionSecond(10000000000.0, new //indent:4 exp:4
31          SecondClassLongNam7("Looooooooooooo" //indent:8 exp:8
32          + "oooooooooooong").getString(new InputIndentationCorrectIfAndParameter(), //indent:8 exp:8
33          new SecondClassLongNam7("loooooooooong"). //indent:8 exp:8
34          getInteger(new InputIndentationCorrectIfAndParameter(), "long")), "loong") //indent:8 exp:8
35          || conditionThird(2048) || conditionFourth(new //indent:8 exp:8
36          SecondClassLongNam7("Looooooooooooooo" //indent:8 exp:8
37          + "oo").gB(new InputIndentationCorrectIfAndParameter(), false)) || //indent:8 exp:8
38          conditionFifth(true, new SecondClassLongNam7(getString(2048, "Looo" //indent:8 exp:8
39          + "ooooooooooooooooooooooooooooooooooooooooooong")).gB( //indent:8 exp:8
40          new InputIndentationCorrectIfAndParameter(), true)) || co(false, new //indent:8 exp:8
41          SecondClassLongNam7(getString(100000, "Loooooong" //indent:8 exp:8
42          + "Fooooooo><"))) || conditionNoArg() //indent:8 exp:8
43          || conditionNoArg() || //indent:8 exp:8
44          conditionNoArg() || conditionNoArg()) {} //indent:8 exp:8
45    } //indent:2 exp:2
46  
47    private boolean conditionFirst(String longString, int //indent:2 exp:2
48        integer, InnerClassFoo someInstance) { //indent:6 exp:6
49      return false; //indent:4 exp:4
50    } //indent:2 exp:2
51  
52    private boolean conditionSecond(double longLongLongDoubleValue, //indent:2 exp:2
53        String longLongLongString, String secondLongLongString) { //indent:6 exp:6
54      return false; //indent:4 exp:4
55    } //indent:2 exp:2
56  
57    private boolean conditionThird(long veryLongValue) { //indent:2 exp:2
58      return false; //indent:4 exp:4
59    } //indent:2 exp:2
60  
61    private boolean conditionFourth(boolean flag) { //indent:2 exp:2
62      return false; //indent:4 exp:4
63    } //indent:2 exp:2
64  
65    private boolean conditionFifth(boolean flag1, boolean flag2) { //indent:2 exp:2
66      return false; //indent:4 exp:4
67    } //indent:2 exp:2
68  
69    private boolean co(boolean flag, //indent:2 exp:2
70        SecondClassLongNam7 instance) { //indent:6 exp:6
71      return false; //indent:4 exp:4
72    } //indent:2 exp:2
73  
74    private boolean conditionNoArg() { //indent:2 exp:2
75      return false; //indent:4 exp:4
76    } //indent:2 exp:2
77  
78    class InnerClassFoo { //indent:2 exp:2
79  
80      void fooMethodWithIf() { //indent:4 exp:4
81        if (conditionFirst("Loooooooooooooooooong", new //indent:6 exp:6
82            SecondClassLongNam7("Loooooooooooooooooog"). //indent:10 exp:10
83                getInteger(new InputIndentationCorrectIfAndParameter(), "Log"), //indent:14 exp:>=10
84                new InnerClassFoo())) {} //indent:14 exp:>=10
85  
86        if (conditionSecond(10000000000.0, new //indent:6 exp:6
87            SecondClassLongNam7("Looooooooooooo" //indent:10 exp:10
88            + "ooooooong").getString(new InputIndentationCorrectIfAndParameter(), //indent:10 exp:10
89            new SecondClassLongNam7("loooooooooong"). //indent:10 exp:10
90            getInteger(new InputIndentationCorrectIfAndParameter(), "long")), "l") //indent:10 exp:10
91            || conditionThird(2048) || conditionFourth(new //indent:10 exp:10
92            SecondClassLongNam7("Looooooooooooooo" //indent:10 exp:10
93              + "og").gB(new InputIndentationCorrectIfAndParameter(), false)) || //indent:12 exp:>=10
94              conditionFifth(true, new SecondClassLongNam7(getString(2048, "Loo" //indent:12 exp:>=10
95              + "ooooooooooooooooooooooooooooooooooooooooooong")).gB( //indent:12 exp:>=10
96              new InputIndentationCorrectIfAndParameter(), true)) ||co(false,new //indent:12 exp:>=10
97                SecondClassLongNam7(getString(100000, "Loooooong" //indent:14 exp:>=10
98                + "Fooooooo><"))) || conditionNoArg() //indent:14 exp:>=10
99                || conditionNoArg() || //indent:14 exp:>=10
100               conditionNoArg() || conditionNoArg()) {} //indent:14 exp:>=10
101     } //indent:4 exp:4
102 
103     Object ann = new Object() { //indent:4 exp:4
104 
105       void fooMethodWithIf(String stringStringStringStringLooooongString, //indent:6 exp:6
106           int intIntIntVeryLongNameForIntVariable, boolean //indent:10 exp:10
107               fooooooooobooleanBooleanVeryLongName) { //indent:14 exp:>=10
108 
109         if (conditionFirst("Loooooooooooooooooong", new //indent:8 exp:8
110             SecondClassLongNam7("Loooooooooooooooooog"). //indent:12 exp:12
111                 getInteger(new InputIndentationCorrectIfAndParameter(), "Lg"), //indent:16 exp:>=12
112                    new InnerClassFoo())) {} //indent:19 exp:>=12
113 
114         if (conditionSecond(10000000000.0, new //indent:8 exp:8
115             SecondClassLongNam7("Looooooooooooo" //indent:12 exp:12
116             + "oooooong").getString(new InputIndentationCorrectIfAndParameter(), //indent:12 exp:12
117             new SecondClassLongNam7("loooooooooong"). //indent:12 exp:12
118             getInteger(new InputIndentationCorrectIfAndParameter(), "lg")), "l") //indent:12 exp:12
119             || conditionThird(2048) || conditionFourth(new //indent:12 exp:12
120             SecondClassLongNam7("Looooooooooooooo" //indent:12 exp:12
121               + "o").gB(new InputIndentationCorrectIfAndParameter(), false))|| //indent:14 exp:>=12
122               conditionFifth(true, new SecondClassLongNam7(getString(2048, "L" //indent:14 exp:>=12
123               + "ooooooooooooooooooooooooooooooooooooooooooong")).gB( //indent:14 exp:>=12
124               new InputIndentationCorrectIfAndParameter(),true))||co(false,new //indent:14 exp:>=12
125                 SecondClassLongNam7(getString(100000, "Loooooong" //indent:16 exp:>=12
126                 + "Fooooooo><"))) || conditionNoArg() //indent:16 exp:>=12
127                 || conditionNoArg() || //indent:16 exp:>=12
128                   conditionNoArg() || conditionNoArg() //indent:18 exp:>=12
129                      && fooooooooobooleanBooleanVeryLongName) {} //indent:21 exp:>=12
130       } //indent:6 exp:6
131     }; //indent:4 exp:4
132   } //indent:2 exp:2
133 } //indent:0 exp:0
134 
135 class SecondClassLongNam7 { //indent:0 exp:0
136 
137   public SecondClassLongNam7(String string) { //indent:2 exp:2
138 
139   } //indent:2 exp:2
140 
141   String getString(InputIndentationCorrectIfAndParameter instance, int integer) { //indent:2 exp:2
142     return "String"; //indent:4 exp:4
143   } //indent:2 exp:2
144 
145   int getInteger(InputIndentationCorrectIfAndParameter instance, String string) { //indent:2 exp:2
146     return -1;   //indent:4 exp:4
147   } //indent:2 exp:2
148 
149   boolean gB(InputIndentationCorrectIfAndParameter instance,boolean flag){ //indent:2 exp:2
150     return false; //indent:4 exp:4
151   } //indent:2 exp:2
152 
153   SecondClassLongNam7 getInstance() { //indent:2 exp:2
154     return new SecondClassLongNam7("VeryLoooooooooo" //indent:4 exp:4
155         + "oongString"); //indent:8 exp:8
156   } //indent:2 exp:2
157 } //indent:0 exp:0