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 = 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  public class InputIndentationValidAssignIndent //indent:0 exp:0
18  { //indent:0 exp:0
19      void foo(String[] args) //indent:4 exp:4
20      { //indent:4 exp:4
21          int i = 1 + //indent:8 exp:8
22              2 + //indent:12 exp:>=12
23              3; //indent:12 exp:>=12
24          String line = mIndentCheck[ //indent:8 exp:8
25              getLineNo()]; //indent:12 exp:>=12
26          String line1 = //indent:8 exp:8
27              getLine(); //indent:12 exp:>=12
28          line1 = //indent:8 exp:8
29              getLine(); //indent:12 exp:>=12
30          int i1  //indent:8 exp:8
31              = //indent:12 exp:>=12
32              1; //indent:12 exp:>=12
33          i = 3; //indent:8 exp:8
34  
35          Integer brace = //indent:8 exp:8
36              (candidate == SLIST) //indent:12 exp:>=12
37              ? candidate : null; //indent:12 exp:>=12
38  
39          AnInterfaceFooWithALongName f = //indent:8 exp:8
40              new AnInterfaceFooWithALongName() { //indent:12 exp:>=12
41                  public void bar() { //indent:16 exp:16
42                  } //indent:16 exp:16
43              }; //indent:12 exp:12
44  
45          AnInterfaceFooWithALongName f1 //indent:8 exp:8
46              = new AnInterfaceFooWithALongName() { //indent:12 exp:>=12
47                  public void bar() { //indent:16 exp:16
48                  } //indent:16 exp:16
49              }; //indent:12 exp:12
50  // XXX: need to be fixed //indent:0 exp:0
51  //         function.lastArgument().candidate = parameters; //indent:0 exp:0
52  //         function.lastArgument().candidate //indent:0 exp:0
53  //             = //indent:0 exp:0
54  //             parameters; //indent:0 exp:0
55          //     : add more testing //indent:8 exp:8
56      } //indent:4 exp:4
57  
58      private interface AnInterfaceFooWithALongName { //indent:4 exp:4
59          void bar(); //indent:8 exp:8
60      } //indent:4 exp:4
61  
62      private static final int SLIST = 1; //indent:4 exp:4
63      private static final int parameters = 1; //indent:4 exp:4
64      int candidate = 0; //indent:4 exp:4
65      private String[] mIndentCheck = null; //indent:4 exp:4
66      private InputIndentationValidAssignIndent function = null; //indent:4 exp:4
67      int getLineNo() { //indent:4 exp:4
68          return 1; //indent:8 exp:8
69      } //indent:4 exp:4
70      String getLine() { //indent:4 exp:4
71          return ""; //indent:8 exp:8
72      } //indent:4 exp:4
73      InputIndentationValidAssignIndent lastArgument() { //indent:4 exp:4
74          return this; //indent:8 exp:8
75      } //indent:4 exp:4
76  } //indent:0 exp:0