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   * @author  jrichard                                                         //indent:1 exp:1
16   */                                                                           //indent:1 exp:1
17  public class InputIndentationValidForIndent { //indent:0 exp:0
18  
19      /** Creates a new instance of InputIndentationValidForIndent */ //indent:4 exp:4
20      public InputIndentationValidForIndent() { //indent:4 exp:4
21      } //indent:4 exp:4
22  
23  
24      private void method1(int[] indices) //indent:4 exp:4
25      { //indent:4 exp:4
26          for (int i=0; i<10; i++) //indent:8 exp:8
27              System.getProperty("foo"); //indent:12 exp:12
28  
29          for (int i=0; i<10; i++) System.getProperty("foo"); //indent:8 exp:8
30  
31          for (int i=0; i<10; i++) { //indent:8 exp:8
32          } //indent:8 exp:8
33  
34          for (int i=0; i<10; i++) //indent:8 exp:8
35          { //indent:8 exp:8
36          } //indent:8 exp:8
37  
38          for (int i=0; i<10; i++) //indent:8 exp:8
39          { //indent:8 exp:8
40              System.getProperty("foo"); //indent:12 exp:12
41          } //indent:8 exp:8
42  
43          for (int i=0; i<10; i++) //indent:8 exp:8
44          { //indent:8 exp:8
45              boolean test = true; //indent:12 exp:12
46              if (test) { // mixed styles are OK //indent:12 exp:12
47                  System.getProperty("foo"); //indent:16 exp:16
48              } //indent:12 exp:12
49          } //indent:8 exp:8
50  
51          for ( //indent:8 exp:8
52              int i=0; //indent:12 exp:12
53              i<10; //indent:12 exp:12
54              i++) //indent:12 exp:12
55          { //indent:8 exp:8
56          } //indent:8 exp:8
57  
58          for (int i=0; //indent:8 exp:8
59              i<10 && 4<5 //indent:12 exp:12
60                  && 7<8; //indent:16 exp:16
61              i++) //indent:12 exp:12
62          { //indent:8 exp:8
63          } //indent:8 exp:8
64  
65          for (int i=0; i<10 && 4<5 //indent:8 exp:8
66                  && 7<8; //indent:16 exp:>=12
67              i++) { //indent:12 exp:12
68          } //indent:8 exp:8
69  
70          for (int i=0; i<10 && 4<5 && 7<8; //indent:8 exp:8
71              i++) { //indent:12 exp:12
72          } //indent:8 exp:8
73  
74  
75          for (int i=0; //indent:8 exp:8
76              i<10; i++ //indent:12 exp:12
77          ) { //indent:8 exp:8
78              System.getProperty("foo"); //indent:12 exp:12
79          } //indent:8 exp:8
80  
81          for ( final int index : indices ) { //indent:8 exp:8
82              String.CASE_INSENSITIVE_ORDER.equals(index); //indent:12 exp:12
83          } //indent:8 exp:8
84          for ( final int index : indices ) //indent:8 exp:8
85          { //indent:8 exp:8
86              String.CASE_INSENSITIVE_ORDER.equals(index); //indent:12 exp:12
87          } //indent:8 exp:8
88      } //indent:4 exp:4
89  } //indent:0 exp:0