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 InputIndentationInvalidBlockIndent { //indent:0 exp:0
18  
19      /** Creates a new instance of InputValidBlockIndent */ //indent:4 exp:4
20      public InputIndentationInvalidBlockIndent() { //indent:4 exp:4
21      } //indent:4 exp:4
22  
23      public void method1() { //indent:4 exp:4
24  
25          { } //indent:8 exp:8
26         { } //indent:7 exp:8 warn
27           { } //indent:9 exp:8 warn
28  
29           { //indent:9 exp:8 warn
30         } //indent:7 exp:8 warn
31  
32        { //indent:6 exp:8 warn
33  
34        } //indent:6 exp:8 warn
35        { //indent:6 exp:8 warn
36          } //indent:8 exp:8
37  
38           { //indent:9 exp:8 warn
39               int var = 3; //indent:13 exp:12 warn
40  
41               var += 3; //indent:13 exp:12 warn
42           } //indent:9 exp:8 warn
43  
44  
45        { //indent:6 exp:8 warn
46            int var = 3; //indent:10 exp:12 warn
47  
48            var += 3; //indent:10 exp:12 warn
49        } //indent:6 exp:8 warn
50  
51  
52        {  int var = 5; } //indent:6 exp:8 warn
53  
54          { //indent:8 exp:8
55            int var = 3; //indent:10 exp:12 warn
56  
57              var += 3; //indent:12 exp:12
58  
59            { //indent:10 exp:12 warn
60                  int innerVar = 4; //indent:16 exp:16
61  
62                  innerVar += var; //indent:16 exp:16
63            } //indent:10 exp:12 warn
64          } //indent:8 exp:8
65          { //indent:8 exp:8
66              int var = 3; //indent:12 exp:12
67  
68            var += 3; //indent:10 exp:12 warn
69  
70            { //indent:10 exp:12 warn
71                int innerVar = 4; //indent:14 exp:16 warn
72  
73                  innerVar += var; //indent:16 exp:16
74              } //indent:12 exp:12
75          } //indent:8 exp:8
76  
77          { //indent:8 exp:8
78              int var = 3; //indent:12 exp:12
79  
80              var += 3; //indent:12 exp:12
81  
82              { //indent:12 exp:12
83                  int innerVar = 4; //indent:16 exp:16
84  
85                  innerVar += var; //indent:16 exp:16
86            } //indent:10 exp:12 warn
87          } //indent:8 exp:8
88  
89      } //indent:4 exp:4
90  
91  
92  //  static init at beginning of line is broken for now //indent:0 exp:0
93  
94  
95    static { int var = 4; } //indent:2 exp:4 warn
96        static { int var = 4; } //indent:6 exp:4 warn
97  
98  
99      static { //indent:4 exp:4
100        int var = 4;  //indent:7 exp:8 warn
101     } //indent:4 exp:4
102 
103       static { //indent:6 exp:4 warn
104         int var = 4;  //indent:8 exp:8
105   } //indent:2 exp:4 warn
106 
107   static { //indent:2 exp:4 warn
108         int var = 4;  //indent:8 exp:8
109       } //indent:6 exp:4 warn
110 
111   static  //indent:2 exp:4 warn
112     { //indent:4 exp:4
113       int var = 4;  //indent:6 exp:8 warn
114     } //indent:4 exp:4
115     static  //indent:4 exp:4
116   { //indent:2 exp:4 warn
117       int var = 4;  //indent:6 exp:8 warn
118       } //indent:6 exp:4 warn
119 
120 
121     static  //indent:4 exp:4
122     { //indent:4 exp:4
123       int var = 4;  //indent:6 exp:8 warn
124     } //indent:4 exp:4
125 
126     static  //indent:4 exp:4
127     { //indent:4 exp:4
128     int var = 4;  //indent:4 exp:8 warn
129   } //indent:2 exp:4 warn
130 
131     static  //indent:4 exp:4
132     { //indent:4 exp:4
133         int var = 4;  //indent:8 exp:8
134       } //indent:6 exp:4 warn
135 
136 
137   { int var = 4; } //indent:2 exp:4 warn
138       { int var = 4; } //indent:6 exp:4 warn
139 
140 
141   { //indent:2 exp:4 warn
142         int var = 4;  //indent:8 exp:8
143       } //indent:6 exp:4 warn
144 
145       { //indent:6 exp:4 warn
146         int var = 4;  //indent:8 exp:8
147   } //indent:2 exp:4 warn
148 
149     { //indent:4 exp:4
150       int var = 4;  //indent:6 exp:8 warn
151     } //indent:4 exp:4
152 
153 } //indent:0 exp:0