View Javadoc
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 = 4                                                            //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 = 8                                                //indent:1 exp:1
12   * tabWidth = 4                                                               //indent:1 exp:1
13   * throwsIndent = 8                                                           //indent:1 exp:1
14   *                                                                            //indent:1 exp:1
15   *                                                                            //indent:1 exp:1
16   */                                                                           //indent:1 exp:1
17  class InputIndentationAndroidStyleCorrect //indent:0 exp:0
18          extends FooForExtend { //indent:8 exp:8
19  
20      String string = foo("fooooooooooooooo", 0, false); //indent:4 exp:4
21  
22      String string1 = //indent:4 exp:4
23              foo("fooooooooooooooo", 0, false); //indent:12 exp:12
24  
25      String foo (String aStr, //indent:4 exp:4
26              int aNnum, boolean aFlag) { //indent:12 exp:12
27  
28          if (true && true && //indent:8 exp:8
29                  true && true) { //indent:16 exp:16
30              String string2 = foo("fooooooo" //indent:12 exp:12
31                      + "oooooooo", 0, false); //indent:20 exp:20
32              if (false && //indent:12 exp:12
33                      false && false) { //indent:20 exp:20
34  
35              } //indent:12 exp:12
36          } //indent:8 exp:8
37          return "string"; //indent:8 exp:8
38      } //indent:4 exp:4
39  } //indent:0 exp:0
40  
41  class InputIndentationAndroidStyleIncorrect //indent:0 exp:0
42     extends FooForExtend { //indent:3 exp:8 warn
43  
44     String string = foo("fooooooooooooooo", 0, false); //indent:3 exp:4 warn
45  
46      String string1 = //indent:4 exp:4
47          foo("fooooooooooooooo", 0, false); //indent:8 exp:12 warn
48  
49      String foo (String aStr, //indent:4 exp:4
50          int aNnum, boolean aFlag) { //indent:8 exp:12 warn
51  
52          if (true && true && //indent:8 exp:8
53               true && true) { //indent:13 exp:16 warn
54  
55              String string2 = foo("fooooooo" //indent:12 exp:12
56                  + "oooooooo", 0, false); //indent:16 exp:20 warn
57          if (false && //indent:8 exp:12 warn
58                    false && false) { //indent:18 exp:>=16
59  
60             }  //indent:11 exp:12 warn
61          } //indent:8 exp:8
62         return "string";  //indent:7 exp:8 warn
63      } //indent:4 exp:4
64  } //indent:0 exp:0
65  
66  class FooForExtend {} //indent:0 exp:0