From 7a1f17a503bba0482f5d7a549585dfc89e81e0fe Mon Sep 17 00:00:00 2001
From: Zaheer Ahmad <129817147+ZaheerAhmadDev@users.noreply.github.com>
Date: Wed, 25 Mar 2026 18:56:57 +0500
Subject: [PATCH] Issue #371: Upgrade checkstyle dependency
---
.github/workflows/maven.yml | 4 ++--
config/checkstyle.properties | 1 +
pom.xml | 8 ++++----
.../generatepatchfile/GeneratePatchFile.java | 8 ++++----
.../filters/JavaPatchFilterElement.java | 8 ++++----
.../filters/SuppressionJavaPatchFilter.java | 10 ++++++++--
.../filters/SuppressionPatchFilter.java | 6 ++++--
.../filters/SuppressionPatchFilterElement.java | 4 ++--
.../filters/SuppressionJavaPatchFilterTest.java | 16 +++++++---------
.../filters/SuppressionPatchFilterTest.java | 2 +-
.../checkstyle/jgit/GitDiffOnOpenSourceTest.java | 2 +-
.../Regexp/context/expected.txt | 2 +-
.../context/expected.txt | 2 +-
.../newline/expected.txt | 2 +-
.../patchedline/expected.txt | 2 +-
.../JavadocParagraph/context/expected.txt | 2 +-
.../JavadocParagraph/newline/expected.txt | 2 +-
.../JavadocParagraph/patchedline/expected.txt | 2 +-
.../SummaryJavadocCheck/context/expected.txt | 2 +-
.../SummaryJavadocCheck/newline/expected.txt | 2 +-
.../SummaryJavadocCheck/patchedline/expected.txt | 2 +-
21 files changed, 48 insertions(+), 41 deletions(-)
diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
index 3c82ad9f..55193963 100644
--- a/.github/workflows/maven.yml
+++ b/.github/workflows/maven.yml
@@ -19,11 +19,11 @@ jobs:
path: ~/.m2/repository
key: maven-cache-${{ hashFiles('**/pom.xml') }}
- - name: Set up JDK 17
+ - name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: corretto
- java-version: 17
+ java-version: 21
- name: Build with Maven
run: mvn -e --no-transfer-progress install
diff --git a/config/checkstyle.properties b/config/checkstyle.properties
index b71118aa..818a4271 100644
--- a/config/checkstyle.properties
+++ b/config/checkstyle.properties
@@ -4,3 +4,4 @@ checkstyle.header.file=https://raw.githubusercontent.com/checkstyle/checkstyle/m
checkstyle.regexp.header.file=https://raw.githubusercontent.com/checkstyle/checkstyle/master/config/java-regexp.header
checkstyle.importcontrol.file=config/import-control.xml
checkstyle.importcontroltest.file=config/import-control-test.xml
+checkstyle.java.version=21
diff --git a/pom.xml b/pom.xml
index bd96bc25..c50aaf5f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,10 +33,10 @@
UTF-8
- 10.4
+ 13.3.0
3.2.0
- 17
- 17
+ 21
+ 21
5.9.1
@@ -116,7 +116,7 @@
false
true
- https://raw.githubusercontent.com/checkstyle/checkstyle/checkstyle-${checkstyle.version}/config/checkstyle_checks.xml
+ https://raw.githubusercontent.com/checkstyle/checkstyle/checkstyle-${checkstyle.version}/config/checkstyle-checks.xml
config/checkstyle.properties
true
diff --git a/src/main/java/com/github/checkstyle/generatepatchfile/GeneratePatchFile.java b/src/main/java/com/github/checkstyle/generatepatchfile/GeneratePatchFile.java
index 2fb87987..3c3ae0cd 100644
--- a/src/main/java/com/github/checkstyle/generatepatchfile/GeneratePatchFile.java
+++ b/src/main/java/com/github/checkstyle/generatepatchfile/GeneratePatchFile.java
@@ -142,8 +142,8 @@ public GeneratePatchFile(String repoPath, String testerPath,
.readEnvironment().findGitDir().build();
git = new Git(repository);
}
- catch (IOException ex) {
- ex.printStackTrace();
+ catch (IOException exception) {
+ exception.printStackTrace();
}
diffReportDirName = new File(".").getAbsoluteFile().getParent() + "/DiffReport";
}
@@ -406,8 +406,8 @@ private void generateSummaryIndexHtml() {
out.write("\n