Skip to content

Commit ad2dfe8

Browse files
committed
Upgrade checkstyle version
1 parent 7428f62 commit ad2dfe8

File tree

9 files changed

+22
-73
lines changed

9 files changed

+22
-73
lines changed

build-tools/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
<dependency>
6767
<groupId>com.puppycrawl.tools</groupId>
6868
<artifactId>checkstyle</artifactId>
69-
<version>8.7</version>
69+
<version>8.18</version>
7070
</dependency>
7171
</dependencies>
7272

build-tools/src/main/java/software/amazon/awssdk/buildtools/checkstyle/MissingSdkAnnotationCheck.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
1919
import com.puppycrawl.tools.checkstyle.api.DetailAST;
2020
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
21-
import com.puppycrawl.tools.checkstyle.utils.AnnotationUtility;
22-
import com.puppycrawl.tools.checkstyle.utils.ScopeUtils;
21+
import com.puppycrawl.tools.checkstyle.utils.AnnotationUtil;
22+
import com.puppycrawl.tools.checkstyle.utils.ScopeUtil;
2323
import java.util.Arrays;
2424
import java.util.List;
2525

@@ -50,7 +50,7 @@ public int[] getRequiredTokens() {
5050

5151
@Override
5252
public void visitToken(DetailAST ast) {
53-
if (!ScopeUtils.isOuterMostType(ast) || SDK_ANNOTATIONS.stream().anyMatch(a -> AnnotationUtility.containsAnnotation
53+
if (!ScopeUtil.isOuterMostType(ast) || SDK_ANNOTATIONS.stream().anyMatch(a -> AnnotationUtil.containsAnnotation
5454
(ast, a))) {
5555
return;
5656
}

build-tools/src/main/java/software/amazon/awssdk/buildtools/checkstyle/SdkPublicMethodNameCheck.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import com.puppycrawl.tools.checkstyle.api.DetailAST;
1919
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
2020
import com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck;
21-
import com.puppycrawl.tools.checkstyle.utils.AnnotationUtility;
21+
import com.puppycrawl.tools.checkstyle.utils.AnnotationUtil;
2222

2323
/**
2424
* Sdk Method Name check to check only public methods in the classes with {@code @SdkPublicApi} annotation.
@@ -55,8 +55,8 @@ public void visitToken(DetailAST ast) {
5555
DetailAST classDef = ast.getParent().getParent();
5656

5757
try {
58-
if (!AnnotationUtility.containsAnnotation(ast, OVERRIDE)
59-
&& AnnotationUtility.containsAnnotation(classDef, SDK_PUBLIC_API)) {
58+
if (!AnnotationUtil.containsAnnotation(ast, OVERRIDE)
59+
&& AnnotationUtil.containsAnnotation(classDef, SDK_PUBLIC_API)) {
6060
super.visitToken(ast);
6161
}
6262
} catch (NullPointerException ex) {

build-tools/src/main/java/software/amazon/awssdk/buildtools/checkstyle/UnnecessaryFinalOnLocalVariableCheck.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
1919
import com.puppycrawl.tools.checkstyle.api.DetailAST;
2020
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
21-
import com.puppycrawl.tools.checkstyle.utils.ScopeUtils;
21+
import com.puppycrawl.tools.checkstyle.utils.ScopeUtil;
2222

2323
/**
2424
* A rule that disallows unnecessary 'final' on local variables
@@ -42,8 +42,8 @@ public int[] getRequiredTokens() {
4242

4343
@Override
4444
public void visitToken(DetailAST ast) {
45-
if (ScopeUtils.isLocalVariableDef(ast) && ast.findFirstToken(TokenTypes.MODIFIERS)
46-
.findFirstToken(TokenTypes.FINAL) != null) {
45+
if (ScopeUtil.isLocalVariableDef(ast) && ast.findFirstToken(TokenTypes.MODIFIERS)
46+
.findFirstToken(TokenTypes.FINAL) != null) {
4747
log(ast, "final should be removed from local variable");
4848
}
4949
}

build-tools/src/main/resources/software/amazon/awssdk/checkstyle.xml

Lines changed: 3 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,10 @@
4343
default="checkstyle-suppressions.xml"/>
4444
</module>
4545

46-
<!-- Allow suppressing rules via comments. -->
47-
<module name="SuppressionCommentFilter"/>
48-
4946
<module name="TreeWalker">
50-
<!-- Make the file contents available to the tree walker, so that we can check comments for rule suppression. -->
51-
<module name="FileContentsHolder"/>
47+
48+
<!-- Allow suppressing rules via comments. -->
49+
<module name="SuppressionCommentFilter"/>
5250

5351
<!-- Class names must match the file name in which they are defined. -->
5452
<module name="OuterTypeFilename"/>
@@ -89,11 +87,6 @@
8987
<!-- Braces must be used for all blocks. -->
9088
<module name="NeedBraces"/>
9189

92-
<!-- Left curly braces cannot be placed on the next line. -->
93-
<module name="LeftCurly">
94-
<property name="maxLineLength" value="130"/>
95-
</module>
96-
9790
<!-- Braces must not be empty for most language constructs. -->
9891
<module name="EmptyBlock">
9992
<property name="option" value="TEXT"/>
@@ -314,14 +307,6 @@
314307
<!-- There must be no space between a method name and its parameter list. -->
315308
<module name="ParenPad"/>
316309

317-
<!--&lt;!&ndash; Operators in multi-line statements must be placed at the beginning, not end, of the lines. &ndash;&gt;-->
318-
<!--<module name="OperatorWrap">-->
319-
<!--<property name="option" value="NL"/>-->
320-
<!--<property name="tokens"-->
321-
<!--value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR, METHOD_REF "/>-->
322-
<!--<property name="severity" value="warning"/> &lt;!&ndash; TODO: Make error. &ndash;&gt;-->
323-
<!--</module>-->
324-
325310
<!-- Non-field annotations must be on separate lines, or in the case of single parameterless annotation can be
326311
placed on the same line as the signature. -->
327312
<module name="AnnotationLocation">
@@ -336,45 +321,6 @@
336321
<property name="allowSamelineMultipleAnnotations" value="true"/>
337322
</module>
338323

339-
<!-- Javadoc @param, @return, etc. must not be empty (but may be excluded). -->
340-
<module name="NonEmptyAtclauseDescription"/>
341-
342-
<!--&lt;!&ndash; Javadoc summaries must be a complete sentence, and must not say things like "This X" or "A X"... &ndash;&gt;-->
343-
<!--<module name="SummaryJavadoc">-->
344-
<!--<property name="forbiddenSummaryFragments"-->
345-
<!--value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>-->
346-
<!--<property name="severity" value="warning"/> &lt;!&ndash; TODO: Make error. &ndash;&gt;-->
347-
<!--</module>-->
348-
349-
<!--&lt;!&ndash; One blank line must exist between each javadoc paragraph, and each paragraph <p> must occur on the same-->
350-
<!--line as the text. &ndash;&gt;-->
351-
<!--<module name="JavadocParagraph">-->
352-
<!--<property name="severity" value="warning"/> &lt;!&ndash; TODO: Make error. &ndash;&gt;-->
353-
<!--</module>-->
354-
355-
<!-- Javadoc @param, etc. must follow a specific order. -->
356-
<module name="AtclauseOrder">
357-
<property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
358-
<property name="target" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
359-
</module>
360-
361-
<!--&lt;!&ndash; Javadoc must be specified for all public methods and follow a specific pattern. &ndash;&gt;-->
362-
<!--<module name="JavadocMethod">-->
363-
<!--<property name="scope" value="public"/>-->
364-
<!--<property name="allowMissingParamTags" value="true"/>-->
365-
<!--<property name="allowMissingThrowsTags" value="true"/>-->
366-
<!--<property name="allowMissingReturnTag" value="true"/>-->
367-
<!--<property name="minLineCount" value="2"/>-->
368-
<!--<property name="allowedAnnotations" value="Override, Test"/>-->
369-
<!--<property name="allowThrowsTagsForSubclasses" value="true"/>-->
370-
<!--<property name="severity" value="warning"/> &lt;!&ndash; TODO: Make error. &ndash;&gt;-->
371-
<!--</module>-->
372-
373-
<!-- Single-line style javadoc may be used. -->
374-
<module name="SingleLineJavadoc">
375-
<property name="ignoreInlineTags" value="false"/>
376-
</module>
377-
378324
<!-- Catch blocks must not be empty without a comment. -->
379325
<module name="EmptyCatchBlock"/>
380326

core/sdk-core/src/main/java/software/amazon/awssdk/core/internal/http/pipeline/stages/ApiCallAttemptTimeoutTrackingStage.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ public ApiCallAttemptTimeoutTrackingStage(HttpClientDependencies dependencies, R
5050
/**
5151
* Start and end api call attempt timer around the execution of the api call attempt. It's important
5252
* that the client execution task is canceled before the InterruptedException is handled by
53-
* {@link #wrapped#execute(SdkHttpFullRequest)} so the interrupt status doesn't leak out to the callers code
53+
* {@link ApiCallTimeoutTrackingStage#wrapped#execute(SdkHttpFullRequest)} so the interrupt status doesn't leak out to the
54+
* callers code.
5455
*/
5556
@Override
5657
public Response<OutputT> execute(SdkHttpFullRequest request, RequestExecutionContext context) throws Exception {

core/sdk-core/src/main/java/software/amazon/awssdk/core/internal/http/pipeline/stages/ApiCallTimeoutTrackingStage.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ public Response<OutputT> execute(SdkHttpFullRequest request, RequestExecutionCon
6666
/**
6767
* Start and end client execution timer around the execution of the request. It's important
6868
* that the client execution task is canceled before the InterruptedException is handled by
69-
* {@link #wrapped#execute(SdkHttpFullRequest)} so the interrupt status doesn't leak out to the callers code
69+
* {@link ApiCallTimeoutTrackingStage#wrapped#execute(SdkHttpFullRequest)} so the interrupt status
70+
* doesn't leak out to the callers code
7071
*/
7172
private Response<OutputT> executeWithTimer(SdkHttpFullRequest request, RequestExecutionContext context) throws Exception {
7273

core/sdk-core/src/main/java/software/amazon/awssdk/core/internal/http/pipeline/stages/MakeAsyncHttpRequestStage.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,10 @@ private class ResponseHandler implements TransformingAsyncResponseHandler<Respon
207207

208208
/**
209209
* @param responseFuture the response future to be returned from
210-
* {@link #executeHttpRequest(SdkHttpFullRequest, RequestExecutionContext)}
211-
* @param transformFuture the transformFuture returned from {@link #responseHandler#prepare()}
212-
* @param errorTransformFuture the error transform future returned from {@link #errorResponseHandler#prepare()}
210+
* {@link MakeAsyncHttpRequestStage#executeHttpRequest(SdkHttpFullRequest, RequestExecutionContext)}
211+
* @param transformFuture the transformFuture returned from {@link MakeAsyncHttpRequestStage#responseHandler#prepare()}
212+
* @param errorTransformFuture the error transform future returned from
213+
* {@link MakeAsyncHttpRequestStage#errorResponseHandler#prepare()}
213214
*/
214215
ResponseHandler(CompletableFuture<Response<OutputT>> responseFuture,
215216
CompletableFuture<OutputT> transformFuture,

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
<maven-javadoc-plugin.version>3.0.1</maven-javadoc-plugin.version>
124124
<maven-dependency-plugin.version>3.1.1</maven-dependency-plugin.version>
125125
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
126-
<checkstyle.version>7.8.2</checkstyle.version>
126+
<checkstyle.version>8.18</checkstyle.version>
127127
<jacoco-maven-plugin.version>0.8.2</jacoco-maven-plugin.version>
128128
<nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
129129
<exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>

0 commit comments

Comments
 (0)