|
63 | 63 | <!-- Ensure proper whitespace usage around "<" and ">" for generic types --> |
64 | 64 | <module name="GenericWhitespace"/> |
65 | 65 |
|
66 | | - <!-- Ensure that classes with only static methods do not have a public constructor --> |
67 | | - <module name="HideUtilityClassConstructor"/> |
68 | | - |
69 | 66 | <!-- Disallow native literals --> |
70 | 67 | <module name="IllegalToken"> |
71 | 68 | <property name="tokens" value="LITERAL_NATIVE"/> |
|
86 | 83 | <module name="MemberName"/> |
87 | 84 |
|
88 | 85 | <!-- Ensure method name format and disallow methods to be named the same as the class (and therefore constructor). Default format: "^[a-z][a-zA-Z0-9]*$" --> |
89 | | - <module name="MethodName"/> |
| 86 | + <module name="MethodName"> |
| 87 | + <!-- TODO: Disable rule or fix violations with the chance to break extensions. There are 479 violations as of 14-06-2018 dd-mm-yyyy --> |
| 88 | + <property name="severity" value="ignore"/> |
| 89 | + </module> |
90 | 90 |
|
91 | 91 | <!-- Check method parameter padding --> |
92 | 92 | <module name="MethodParamPad"/> |
93 | 93 |
|
94 | 94 | <!-- Check method type name format. Default format: "^[A-Z]$" --> |
95 | 95 | <module name="MethodTypeParameterName"/> |
96 | 96 |
|
97 | | - <!-- Ensure that non-abstract classes define a constructor and not rely on the default one --> |
98 | | - <module name="MissingCtor"/> |
99 | | - |
100 | 97 | <!-- Ensure that both the @Deprecated and the @deprecated javadoc tag are present when one is present --> |
101 | 98 | <module name="MissingDeprecated"/> |
102 | 99 |
|
|
137 | 134 | <property name="allowEmptyCatches" value="true"/> |
138 | 135 | <property name="tokens" value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, |
139 | 136 | BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, EQUAL, GE, GT, LAMBDA, LAND, LCURLY, LE, LITERAL_CATCH, LITERAL_DO, |
140 | | - LITERAL_ELSE, LITERAL_FINALLY, LITERAL_RETURN, LITERAL_TRY, |
| 137 | + LITERAL_ELSE, LITERAL_FINALLY, LITERAL_RETURN, |
141 | 138 | LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, |
142 | 139 | RCURLY, SL, SLIST, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN, TYPE_EXTENSION_AND"/> |
143 | 140 | </module> |
|
163 | 160 | <!-- Disallow redundant (double or default-available class) imports --> |
164 | 161 | <module name="RedundantImport"/> |
165 | 162 |
|
166 | | - <!-- Require "this" for non-static field access --> |
167 | | - <module name="RequireThis"/> |
168 | | - |
169 | 163 | <!-- Ensure usage of "}" for the given tokens --> |
170 | 164 | <module name="RightCurly"> |
171 | 165 | <property name="tokens" value="LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE"/> |
|
189 | 183 | <!-- Disallow the "==" operator for string literals --> |
190 | 184 | <module name="StringLiteralEquality"/> |
191 | 185 |
|
192 | | - <!-- Ensure that an overriding clone() method invokes super.clone() --> |
193 | | - <module name="SuperClone"/> |
194 | | - |
195 | | - <!-- Ensure that an overriding finalize() method invokes super.finalize() --> |
196 | | - <module name="SuperFinalize"/> |
197 | | - |
198 | 186 | <!-- Disallow whitespaces between type cast parenthesis (No whitespace at X: "(XObjectX) obj") --> |
199 | 187 | <module name="TypecastParenPad"/> |
200 | 188 |
|
|
219 | 207 | <!-- Disallow whitespaces between if/for/while and '(' --> |
220 | 208 | <module name="RegexpSingleline"> |
221 | 209 | <property name="severity" value="error"/> |
222 | | - <property name="format" value="(^|[^w\._])(if|for|while)[\s]+\("/> |
| 210 | + <property name="format" value="(^|[^\w\._])(if|for|while)[\s]+\("/> |
223 | 211 | <property name="message" value="Whitespace between if/for/while and '(' is not allowed."/> |
224 | 212 | </module> |
225 | 213 |
|
| 214 | + <!-- Ensure whitespace between try and '{' --> |
| 215 | + <module name="RegexpSingleline"> |
| 216 | + <property name="severity" value="error"/> |
| 217 | + <property name="format" value="(^|[^\w\._])try\{"/> |
| 218 | + <property name="message" value="'try' is not followed by whitespace."/> |
| 219 | + </module> |
| 220 | + |
| 221 | + <!-- Disallow whitespaces between try and '(' (try-with-resources) --> |
| 222 | + <module name="RegexpSingleline"> |
| 223 | + <property name="severity" value="error"/> |
| 224 | + <property name="format" value="(^|[^\w\._])try[\s]+\("/> |
| 225 | + <property name="message" value="'try' with resources is followed by whitespace."/> |
| 226 | + </module> |
| 227 | + |
226 | 228 | <!-- Ensure that every file ends with a newline --> |
227 | 229 | <module name="NewlineAtEndOfFile"/> |
228 | 230 |
|
|
0 commit comments