Skip to content

Commit 7cbfbaf

Browse files
josephmaternveach
authored andcommitted
minor: fix violations from RequireEmptyLineBeforeAtClauseBlock
1 parent 220b4aa commit 7cbfbaf

File tree

48 files changed

+465
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+465
-0
lines changed

sevntu-checks/src/main/java/com/github/sevntu/checkstyle/SevntuUtil.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ private SevntuUtil() {
3939
* This utility method if used to mark that token passed to
4040
* {@link AbstractCheck#visitToken(com.puppycrawl.tools.checkstyle.api.DetailAST)} is not
4141
* supported by this method.
42+
*
4243
* @param token
4344
* token/type that is not supported
4445
* @throws IllegalArgumentException

sevntu-checks/src/main/java/com/github/sevntu/checkstyle/checks/annotation/ForbidAnnotationCheck.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
* value="XXX"/> <property name="annotationTargets"
3838
* value="METHOD_DEF,CLASS_DEF"/> </module>
3939
* </pre>
40+
*
4041
* @author <a href="mailto:[email protected]">Hidoyatov Victor</a>
4142
* @since 1.12.0
4243
*/
@@ -59,6 +60,7 @@ public class ForbidAnnotationCheck extends AbstractCheck {
5960

6061
/**
6162
* Setter for annotationNames.
63+
*
6264
* @param names - array of annotation's names
6365
*/
6466
public void setAnnotationNames(final String... names) {
@@ -71,6 +73,7 @@ public void setAnnotationNames(final String... names) {
7173

7274
/**
7375
* Getter for annotationNames.
76+
*
7477
* @param targets - array of type's names
7578
*/
7679
public void setAnnotationTargets(String... targets) {
@@ -138,6 +141,7 @@ private static String getAnnotationName(DetailAST annotation) {
138141

139142
/**
140143
* Return true if mAnnotationNames contains aAnnotationName.
144+
*
141145
* @param annotationName - name of current annotation
142146
* @return boolean
143147
*/
@@ -147,6 +151,7 @@ private boolean isRequiredAnnotationName(String annotationName) {
147151

148152
/**
149153
* Return true if mAnnotationTargets contains aTargetType.
154+
*
150155
* @param targetType - type of current annotation
151156
* @return boolean
152157
*/

sevntu-checks/src/main/java/com/github/sevntu/checkstyle/checks/annotation/RequiredParameterForAnnotationCheck.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ public class RequiredParameterForAnnotationCheck extends AbstractCheck {
117117

118118
/**
119119
* The annotation name we are interested in.
120+
*
120121
* @param annotationName set annotation name
121122
*/
122123
public void setAnnotationName(String annotationName) {
@@ -125,6 +126,7 @@ public void setAnnotationName(String annotationName) {
125126

126127
/**
127128
* The required list of parameters we have to use.
129+
*
128130
* @param requiredPropertiesParameter set required list of parameters
129131
*/
130132
public void setRequiredParameters(String... requiredPropertiesParameter) {
@@ -169,6 +171,7 @@ public void visitToken(DetailAST annotationNode) {
169171

170172
/**
171173
* Returns full name of an annotation.
174+
*
172175
* @param annotationNode The node to examine.
173176
* @return name of an annotation.
174177
*/
@@ -194,6 +197,7 @@ private static String getAnnotationName(DetailAST annotationNode) {
194197

195198
/**
196199
* Returns the name of annotations properties.
200+
*
197201
* @param annotationNode The node to examine.
198202
* @return name of annotation properties.
199203
*/

sevntu-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/AvoidDefaultSerializableInInnerClassesCheck.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
* implement both methods. For more information read
3333
* "Effective Java (2nd edition)" chapter 11, item 74, page 294.
3434
* </p>
35+
*
3536
* @author <a href="mailto:[email protected]">Ilia Dubinin</a>
3637
* @since 1.8.0
3738
*/
@@ -54,6 +55,7 @@ public class AvoidDefaultSerializableInInnerClassesCheck extends AbstractCheck {
5455
* <p>
5556
* Set allow partly implementation serializable interface.
5657
* </p>
58+
*
5759
* @param allow - Option, that allow partial implementation
5860
* of serializable interface.
5961
*/
@@ -94,6 +96,7 @@ public void visitToken(DetailAST detailAST) {
9496
* Return true if it is nested class. Terminology is here :
9597
* http://download.oracle.com/javase/tutorial/java/javaOO/nested.html
9698
* </p>
99+
*
97100
* @param classNode - class node
98101
* @return - boolean variable
99102
*/
@@ -147,6 +150,7 @@ && isVoidMethod(methodNode)
147150
* Return true, if methods readObject() and writeObject() have correct
148151
* modifiers.
149152
* </p>
153+
*
150154
* @param methodNode
151155
* - current method node;
152156
* @return boolean value;
@@ -166,6 +170,7 @@ private static boolean isPrivateMethod(DetailAST methodNode) {
166170
* <p>
167171
* Return true, if method has void type.
168172
* </p>
173+
*
169174
* @param methodNode - method node
170175
* @return boolean variable
171176
*/
@@ -180,6 +185,7 @@ private static boolean isVoidMethod(DetailAST methodNode) {
180185
* Return true, if method has correct parameters (ObjectInputStream for
181186
* readObject() and ObjectOutputStream for writeObject()).
182187
* </p>
188+
*
183189
* @param methodNode - method node.
184190
* @param parameterText - correct parameter text.
185191
* @return boolean variable.
@@ -240,6 +246,7 @@ private final class SiblingIterator {
240246
* <b>
241247
* Children Iterator constructor.
242248
* </b>
249+
*
243250
* @param parent - child parent.
244251
*/
245252
/* package */ SiblingIterator(DetailAST parent) {
@@ -250,6 +257,7 @@ private final class SiblingIterator {
250257
* <b>
251258
* Return boolean value, if has next element.
252259
* </b>
260+
*
253261
* @return boolean value
254262
*/
255263
public boolean hasNextSibling() {
@@ -260,6 +268,7 @@ public boolean hasNextSibling() {
260268
* <b>
261269
* Return next DetailAST element.
262270
* </b>
271+
*
263272
* @return next DetailAST.
264273
*/
265274

sevntu-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/AvoidHidingCauseExceptionCheck.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
* throw new RuntimeException("Runtime Exception!");
6161
* }
6262
* </pre>
63+
*
6364
* @author <a href="mailto:[email protected]"> Daniil
6465
* Yaroslavtsev</a>
6566
* @author <a href="mailto:[email protected]">Ilja Dubinin</a>
@@ -114,6 +115,7 @@ public void visitToken(DetailAST detailAST) {
114115

115116
/**
116117
* Returns true when aThrowParamNamesList contains caught exception.
118+
*
117119
* @param throwParamNamesList List of throw parameter names.
118120
* @param wrapExcNames List of caught exception names.
119121
* @return true when aThrowParamNamesList contains caught exception
@@ -134,6 +136,7 @@ private static boolean isContainsCaughtExc(List<DetailAST> throwParamNamesList,
134136
/**
135137
* Returns a List of<code>DetailAST</code> that contains the names of
136138
* parameters for current "throw" keyword.
139+
*
137140
* @param startNode The start node for exception name searching.
138141
* @param paramNamesAST The list, that will be contain names of the
139142
* parameters
@@ -160,6 +163,7 @@ private List<DetailAST> buildThrowParamNamesList(DetailAST startNode,
160163
* Recursive method which searches for the <code>LITERAL_THROW</code>
161164
* DetailASTs all levels below on the current <code>aParentAST</code> node
162165
* without entering into nested try/catch blocks.
166+
*
163167
* @param parentAST A start node for "throw" keyword <code>DetailASTs
164168
* </code> searching.
165169
* @return null-safe list of <code>LITERAL_THROW</code> literals
@@ -184,6 +188,7 @@ private List<DetailAST> makeThrowList(DetailAST parentAST) {
184188
/**
185189
* Searches for all exceptions that wraps the original exception
186190
* object (only in current "catch" block).
191+
*
187192
* @param currentCatchAST A LITERAL_CATCH node of the
188193
* current "catch" block.
189194
* @param parentAST Current parent node to start search.
@@ -232,6 +237,7 @@ private List<String> makeExceptionsList(DetailAST currentCatchAST,
232237

233238
/**
234239
* Gets all the children one level below on the current parent node.
240+
*
235241
* @param node Current parent node.
236242
* @return List of children one level below on the current
237243
* parent node (aNode).

sevntu-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/AvoidModifiersForTypesCheck.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ public class AvoidModifiersForTypesCheck extends AbstractCheck {
214214
/**
215215
* Sets the regexp for the names of classes, that could not have 'annotation'
216216
* modifier.
217+
*
217218
* @param forbiddenClassesRegexpAnnotation
218219
* String contains the regex to set for the names of classes, that
219220
* could not have 'annotation' modifier.
@@ -234,6 +235,7 @@ public void setForbiddenClassesRegexpAnnotation(String forbiddenClassesRegexpAnn
234235
/**
235236
* Sets the regexp for the names of classes, that could not have 'final'
236237
* modifier.
238+
*
237239
* @param forbiddenClassesRegexpFinal
238240
* String contains the regex to set for the names of classes, that
239241
* could not have 'final' modifier.
@@ -254,6 +256,7 @@ public void setForbiddenClassesRegexpFinal(String forbiddenClassesRegexpFinal) {
254256
/**
255257
* Sets the regexp for the names of classes, that could not have 'static'
256258
* modifier.
259+
*
257260
* @param forbiddenClassesRegexpStatic
258261
* String contains the regex to set for the names of classes, that
259262
* could not have 'static' modifier.
@@ -274,6 +277,7 @@ public void setForbiddenClassesRegexpStatic(String forbiddenClassesRegexpStatic)
274277
/**
275278
* Sets the regexp for the names of classes, that could not have 'transient'
276279
* modifier.
280+
*
277281
* @param forbiddenClassesRegexpTransient
278282
* String contains the regex to set for the names of classes, that
279283
* could not have 'transient' modifier.
@@ -294,6 +298,7 @@ public void setForbiddenClassesRegexpTransient(String forbiddenClassesRegexpTran
294298
/**
295299
* Sets the regexp for the names of classes, that could not have 'volatile'
296300
* modifier.
301+
*
297302
* @param forbiddenClassesRegexpVolatile
298303
* String contains the regex to set for the names of classes, that
299304
* could not have 'volatile' modifier.
@@ -314,6 +319,7 @@ public void setForbiddenClassesRegexpVolatile(String forbiddenClassesRegexpVolat
314319
/**
315320
* Sets the regexp for the names of classes, that could not have 'private'
316321
* modifier.
322+
*
317323
* @param forbiddenClassesRegexpPrivate
318324
* String contains the regex to set for the names of classes, that
319325
* could not have 'private' modifier.
@@ -334,6 +340,7 @@ public void setForbiddenClassesRegexpPrivate(String forbiddenClassesRegexpPrivat
334340
/**
335341
* Sets the regexp for the names of classes, that could not have no modifier
336342
* ('package-private').
343+
*
337344
* @param forbiddenClassesRegexpPackagePrivate
338345
* String contains the regex to set for the names of classes, that
339346
* could not have no modifier ('package-private').
@@ -355,6 +362,7 @@ public void setForbiddenClassesRegexpPackagePrivate(
355362
/**
356363
* Sets the regexp for the names of classes, that could not have 'protected'
357364
* modifier.
365+
*
358366
* @param forbiddenClassesRegexpProtected
359367
* String contains the regex to set for the names of classes, that
360368
* could not have 'protected' modifier.
@@ -375,6 +383,7 @@ public void setForbiddenClassesRegexpProtected(String forbiddenClassesRegexpProt
375383
/**
376384
* Sets the regexp for the names of classes, that could not have 'public'
377385
* modifier.
386+
*
378387
* @param forbiddenClassesRegexpPublic
379388
* String contains the regex to set for the names of classes, that
380389
* could not have 'public' modifier.
@@ -440,6 +449,7 @@ public void visitToken(DetailAST ast) {
440449
/**
441450
* Checks whether a specific Java modifier is used in a given class with
442451
* the specified regular expression.
452+
*
443453
* @param modifierType the modifier type
444454
* @param className the class name
445455
* @return either <code>true</code> if the regexp match the className,
@@ -452,6 +462,7 @@ private boolean match(int modifierType, String className) {
452462

453463
/**
454464
* Maps the modifierType to a regular expression.
465+
*
455466
* @param modifierType the modifier type
456467
* @return the Pattern object storing the regexp for the names of classes,
457468
* that must not have the modifierType.
@@ -494,6 +505,7 @@ private Pattern mapToRegExp(int modifierType) {
494505

495506
/**
496507
* Gets the full className of the defined variable.
508+
*
497509
* @param variableDefNode
498510
* A DetailAST node is related to variable definition (VARIABLE_DEF
499511
* node type).
@@ -525,6 +537,7 @@ private static String getClassNameAndPath(DetailAST variableDefNode) {
525537

526538
/**
527539
* Gets the class name from full (dotted) classPath.
540+
*
528541
* @param classNameAndPath
529542
* - the full (dotted) classPath. Must not be null.
530543
* @return the name of the class is specified by the current full name&path.
@@ -537,6 +550,7 @@ private static String getClassName(final String classNameAndPath) {
537550
/**
538551
* Gets the modifiers of the defined variable (annotation, public, private, final, static,
539552
* transient or volatile).
553+
*
540554
* @param variableDefAst
541555
* A DetailAST node is related to the variable definition
542556
* (VARIABLE_DEF type)
@@ -556,6 +570,7 @@ private static Set<Integer> getModifiers(DetailAST variableDefAst) {
556570
/**
557571
* Gets all the children which are one level below on the current DetailAST
558572
* parent node.
573+
*
559574
* @param node
560575
* The parent node.
561576
* @return The list of children one level below on the current parent node.

sevntu-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/AvoidNotShortCircuitOperatorsForBooleanCheck.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
* || isModifier() &amp;&amp; isNotTrue();
6868
* }
6969
* </pre>
70+
*
7071
* @author <a href="mailto:[email protected]"> Daniil
7172
* Yaroslavtsev</a>
7273
* @since 1.8.0
@@ -134,6 +135,7 @@ public final void visitToken(final DetailAST detailAST) {
134135
/**
135136
* Checks whether the current method/variable definition type
136137
* is "Boolean".
138+
*
137139
* @param node - current method or variable definition node.
138140
* @return "true" if current method or variable has a Boolean type.
139141
*/
@@ -145,6 +147,7 @@ private static boolean isBooleanType(final DetailAST node) {
145147
/**
146148
* Checks that current expression is calculated using "|", "&amp;", "|=", "&amp;="
147149
* operators contains at least one Boolean operand.
150+
*
148151
* @param node - current TokenTypes.EXPR node to check.
149152
* @return "true" if current expression is calculated using "|", "&amp;",
150153
* "|=". "&amp;=" operators contains at least one Boolean operand or false
@@ -190,6 +193,7 @@ && isBooleanType(currentNode)) {
190193
* Searches for all supported operands names in current expression.
191194
* When checking, treatments to external class variables, method calls,
192195
* etc are not considered as expression operands.
196+
*
193197
* @param exprParentAST - the current TokenTypes.EXPR parent node.
194198
* @return List of supported operands contained in current expression.
195199
*/
@@ -212,6 +216,7 @@ public final List<String> getSupportedOperandsNames(
212216
/**
213217
* Checks is the current expression has
214218
* keywords "true" or "false".
219+
*
215220
* @param parentAST - the current TokenTypes.EXPR parent node.
216221
* @return true if the current processed expression contains
217222
* "true" or "false" keywords and false otherwise.
@@ -237,6 +242,7 @@ public final boolean hasTrueOrFalseLiteral(final DetailAST parentAST) {
237242

238243
/**
239244
* Gets all the children one level below on the current top node.
245+
*
240246
* @param node - current parent node.
241247
* @return an array of children one level below on the current parent node
242248
* aNode.

sevntu-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/ConfusingConditionCheck.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ && isConditionAllNegative(literalIf)) {
181181

182182
/**
183183
* Checks if the given AST can be ignored.
184+
*
184185
* @param literalIf The AST to check.
185186
* @return {@code true} if it can be ignored.
186187
*/
@@ -286,6 +287,7 @@ private static int getAmountOfCodeRowsInBlock(DetailAST detailAST) {
286287

287288
/**
288289
* Retrieves the first, opening brace of an {@code if} or {@code else} statement.
290+
*
289291
* @param detailAST The token to examine.
290292
* @return The opening brace token or {@code null} if it doesn't exist.
291293
*/

0 commit comments

Comments
 (0)