View Javadoc
1   package com.puppycrawl.tools.checkstyle.checks.indentation.commentsindentation;
2   
3   public class InputCommentsIndentationInMultiblockStructures {
4       void foo() {
5           if (true) {
6               assert true;
7           // comment for else
8           } else {}
9   
10          if (true) {
11              assert true;
12          // violation
13          }
14          else {}
15  
16          if (true) {
17              assert true;
18                  // violation
19          } else {}
20  
21          if (true) {
22              assert true;
23  // violation
24          } else {}
25  
26          try {
27              assert true;
28          // comment for catch
29          } catch (Exception ex) {}
30  
31          try {
32              assert true;
33          // violation
34          }
35          catch (Exception ex) {}
36  
37          try {
38              assert true;
39  // violation
40          } catch (Exception ex) {}
41  
42          try {
43              assert true;
44                  // violation
45          } catch (Exception ex) {}
46  
47          try {
48              assert true;
49          // comment for finally
50          } finally {}
51  
52          try {
53              assert true;
54          // violation
55          }
56          finally {}
57  
58          try {
59              assert true;
60  // violation
61          } finally {}
62  
63          try {
64              assert true;
65                  // violation
66          } finally {}
67  
68          try {} catch (Exception ex) {
69              assert true;
70          // comment for finally
71          } finally {}
72  
73          try {} catch (Exception ex) {
74              assert true;
75          // violation
76          }
77          finally {}
78  
79          try {} catch (Exception ex) {
80              assert true;
81  // violation
82          } finally {}
83  
84          try {} catch (Exception ex) {
85              assert true;
86                  // violation
87          } finally {}
88  
89          try {} catch (ClassCastException ex) {
90              assert true;
91          // comment for catch
92          } catch (Exception ex) {}
93  
94          try {} catch (ClassCastException ex) {
95              assert true;
96          // violation
97          }
98          catch (Exception ex) {}
99  
100         try {} catch (ClassCastException ex) {
101             assert true;
102 // violation
103         } catch (Exception ex) {}
104 
105         try {} catch (ClassCastException ex) {
106             assert true;
107                 // violation
108         } catch (Exception ex) {}
109 
110         do {
111             assert true;
112         // comment for while
113         } while (false);
114 
115         do {
116             assert true;
117         // violation
118         }
119         while (false);
120 
121         do {
122             assert true;
123                 // violation
124         } while (false);
125 
126         do {
127             assert true;
128 // violation
129         } while (false);
130     }
131 }