diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml
index 6cdeb56e2..d5b5b3276 100644
--- a/.github/workflows/static-analysis.yml
+++ b/.github/workflows/static-analysis.yml
@@ -15,30 +15,6 @@ defaults:
shell: bash
jobs:
- run-checkstyle:
- name: Run CheckStyle
- # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on
- runs-on: ubuntu-20.04
- steps:
- - name: Clone source code
- uses: actions/checkout@v4.1.1 # https://github.com/actions/checkout
- with:
- # Whether to configure the token or SSH key with the local git config. Default: true
- persist-credentials: false
- - name: Install JDK
- uses: actions/setup-java@v4.0.0 # https://github.com/actions/setup-java
- with:
- distribution: 'adopt' # https://github.com/actions/setup-java#supported-distributions
- java-version: '8' # https://github.com/actions/setup-java#supported-version-syntax
- - name: Restore existing cache
- uses: actions/cache@v4.0.0 # https://github.com/actions/cache
- with:
- # https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#input-parameters-for-the-cache-action
- key: maven-repository-${{ hashFiles('pom.xml') }}
- path: ~/.m2/repository
- restore-keys: maven-repository-
- - name: Run CheckStyle
- run: ./src/main/scripts/execute-command.sh checkstyle
run-pmd:
name: Run PMD
diff --git a/pom.xml b/pom.xml
index 8c83dd14c..183b06f03 100644
--- a/pom.xml
+++ b/pom.xml
@@ -569,7 +569,6 @@
3.4.1
2.2.2
- 2.17
3.0.0
@@ -831,20 +830,6 @@
-
- org.apache.maven.plugins
- maven-checkstyle-plugin
- ${checkstyle.plugin.version}
-
- false
- true
- true
- false
- ${basedir}/src/main/config/checkstyle.xml
- ${basedir}/src/main/config/checkstyle-suppressions.xml
-
-
-
org.apache.maven.plugins
maven-clean-plugin
diff --git a/src/main/config/checkstyle-suppressions.xml b/src/main/config/checkstyle-suppressions.xml
deleted file mode 100644
index a44c007cd..000000000
--- a/src/main/config/checkstyle-suppressions.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/config/checkstyle.xml b/src/main/config/checkstyle.xml
deleted file mode 100644
index 6a0bce0f3..000000000
--- a/src/main/config/checkstyle.xml
+++ /dev/null
@@ -1,276 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/java/ru/mystamps/web/common/Pager.java b/src/main/java/ru/mystamps/web/common/Pager.java
index caf2d5e6c..75c0083cc 100644
--- a/src/main/java/ru/mystamps/web/common/Pager.java
+++ b/src/main/java/ru/mystamps/web/common/Pager.java
@@ -145,14 +145,12 @@ private static List createItems(
nextItemsCnt--;
}
- // CheckStyle: ignore LineLength for next 3 lines
// we've added too much to the beginning
} else if (prevItemsCnt > ITEMS_BEFORE_CURRENT && nextItemsCnt <= ITEMS_AFTER_CURRENT) {
while (prevItemsCnt > ITEMS_BEFORE_CURRENT && (prevItemsCnt + nextItemsCnt + 1) > MAX_ITEMS) {
prevItemsCnt--;
}
- // CheckStyle: ignore LineLength for next 3 lines
// we've added too much to the end
} else if (nextItemsCnt > ITEMS_AFTER_CURRENT && prevItemsCnt <= ITEMS_BEFORE_CURRENT) {
while (nextItemsCnt > ITEMS_AFTER_CURRENT && (prevItemsCnt + nextItemsCnt + 1) > MAX_ITEMS) {
diff --git a/src/main/java/ru/mystamps/web/config/MvcConfig.java b/src/main/java/ru/mystamps/web/config/MvcConfig.java
index 6bbe24017..e1d2bc2b7 100755
--- a/src/main/java/ru/mystamps/web/config/MvcConfig.java
+++ b/src/main/java/ru/mystamps/web/config/MvcConfig.java
@@ -113,7 +113,6 @@ public void addResourceHandlers(ResourceHandlerRegistry registry) {
VersionResourceResolver resourceResolver = new VersionResourceResolver()
.addFixedVersionStrategy(ResourceUrl.RESOURCES_VERSION, "/**");
- // CheckStyle: ignore MagicNumber for next 1 line
CacheControl cacheControl = CacheControl.maxAge(Duration.ofDays(7));
registry.addResourceHandler("/static/**")
@@ -168,7 +167,6 @@ public void addInterceptors(InterceptorRegistry registry) {
}
@Override
- // CheckStyle: ignore LineLength for next 2 lines
// LATER: remove deprecation and usage of setUseSuffixPatternMatch() during upgrade to Spring Framework 5.3
// See: https://docs.spring.io/spring-framework/docs/5.2.22.RELEASE/javadoc-api/org/springframework/web/servlet/config/annotation/PathMatchConfigurer.html#setUseSuffixPatternMatch-java.lang.Boolean-
@SuppressWarnings("deprecation")
diff --git a/src/main/java/ru/mystamps/web/feature/account/JdbcUsersActivationDao.java b/src/main/java/ru/mystamps/web/feature/account/JdbcUsersActivationDao.java
index 043141138..0384bf367 100644
--- a/src/main/java/ru/mystamps/web/feature/account/JdbcUsersActivationDao.java
+++ b/src/main/java/ru/mystamps/web/feature/account/JdbcUsersActivationDao.java
@@ -38,7 +38,6 @@ public class JdbcUsersActivationDao implements UsersActivationDao {
private final String removeByActivationKeySql;
private final String addActivationKeySql;
- @SuppressWarnings("checkstyle:linelength")
public JdbcUsersActivationDao(Environment env, NamedParameterJdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
this.findByActivationKeySql = env.getRequiredProperty("users_activation.find_by_activation_key");
diff --git a/src/main/java/ru/mystamps/web/feature/category/CategoryServiceImpl.java b/src/main/java/ru/mystamps/web/feature/category/CategoryServiceImpl.java
index 7a1135e6a..0d44b0be1 100644
--- a/src/main/java/ru/mystamps/web/feature/category/CategoryServiceImpl.java
+++ b/src/main/java/ru/mystamps/web/feature/category/CategoryServiceImpl.java
@@ -92,7 +92,6 @@ public List findIdsByNames(List names) {
return categoryDao.findIdsByNames(lowerCasesNames);
}
- // CheckStyle: ignore LineLength for next 1 line
// @todo #819 CategoryServiceImpl.findIdsWhenNameStartsWith(): add unit test for converting to lower case
@Override
@Transactional(readOnly = true)
diff --git a/src/main/java/ru/mystamps/web/feature/category/JdbcCategoryDao.java b/src/main/java/ru/mystamps/web/feature/category/JdbcCategoryDao.java
index 17a7d056b..7c7333678 100644
--- a/src/main/java/ru/mystamps/web/feature/category/JdbcCategoryDao.java
+++ b/src/main/java/ru/mystamps/web/feature/category/JdbcCategoryDao.java
@@ -64,7 +64,6 @@ public class JdbcCategoryDao implements CategoryDao {
@SuppressWarnings("PMD.LongVariable")
private final String findFromLastCreatedSeriesByUserSql;
- @SuppressWarnings("checkstyle:linelength")
public JdbcCategoryDao(Environment env, NamedParameterJdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
this.addCategorySql = env.getRequiredProperty("category.create");
diff --git a/src/main/java/ru/mystamps/web/feature/collection/JdbcCollectionDao.java b/src/main/java/ru/mystamps/web/feature/collection/JdbcCollectionDao.java
index 3057eeb7b..fb2e90f9a 100644
--- a/src/main/java/ru/mystamps/web/feature/collection/JdbcCollectionDao.java
+++ b/src/main/java/ru/mystamps/web/feature/collection/JdbcCollectionDao.java
@@ -62,7 +62,6 @@ public class JdbcCollectionDao implements CollectionDao {
private final String removeSeriesInstanceSql;
private final String findCollectionInfoBySlugSql;
- @SuppressWarnings("checkstyle:linelength")
public JdbcCollectionDao(Environment env, NamedParameterJdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
this.findLastCreatedCollectionsSql = env.getRequiredProperty("collection.find_last_created");
@@ -259,7 +258,6 @@ public Integer addSeriesToUserCollection(AddToCollectionDbDto dto) {
JdbcUtils.ID_KEY_COLUMN
);
- // CheckStyle: ignore LineLength for next 3 lines
Validate.validState(
affected == 1,
"Unexpected number of affected rows after adding series #%d to collection of user #%d: %d",
@@ -280,7 +278,6 @@ public void removeSeriesFromUserCollection(Integer userId, Integer seriesInstanc
int affected = jdbcTemplate.update(removeSeriesInstanceSql, params);
if (affected != 1) {
- // CheckStyle: ignore LineLength for next 2 lines
LOG.warn(
"Unexpected number of affected rows after removing series instance #{} from collection of user #{}: {}",
seriesInstanceId,
diff --git a/src/main/java/ru/mystamps/web/feature/country/CountryServiceImpl.java b/src/main/java/ru/mystamps/web/feature/country/CountryServiceImpl.java
index 5c0e19ff0..8bdae53ba 100644
--- a/src/main/java/ru/mystamps/web/feature/country/CountryServiceImpl.java
+++ b/src/main/java/ru/mystamps/web/feature/country/CountryServiceImpl.java
@@ -92,7 +92,6 @@ public List findIdsByNames(List names) {
return countryDao.findIdsByNames(lowerCasesNames);
}
- // CheckStyle: ignore LineLength for next 1 line
// @todo #819 CountryServiceImpl.findIdsWhenNameStartsWith(): add unit test for converting to lower case
@Override
@Transactional(readOnly = true)
diff --git a/src/main/java/ru/mystamps/web/feature/country/JdbcCountryDao.java b/src/main/java/ru/mystamps/web/feature/country/JdbcCountryDao.java
index 3adb0f9ec..074ad5ad3 100644
--- a/src/main/java/ru/mystamps/web/feature/country/JdbcCountryDao.java
+++ b/src/main/java/ru/mystamps/web/feature/country/JdbcCountryDao.java
@@ -65,7 +65,6 @@ public class JdbcCountryDao implements CountryDao {
@SuppressWarnings("PMD.LongVariable")
private final String findLastCountryCreatedByUserSql;
- @SuppressWarnings("checkstyle:linelength")
public JdbcCountryDao(Environment env, NamedParameterJdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
this.addCountrySql = env.getRequiredProperty("country.create");
diff --git a/src/main/java/ru/mystamps/web/feature/image/FilesystemImagePersistenceStrategy.java b/src/main/java/ru/mystamps/web/feature/image/FilesystemImagePersistenceStrategy.java
index d5c8ccadb..414b79ccc 100644
--- a/src/main/java/ru/mystamps/web/feature/image/FilesystemImagePersistenceStrategy.java
+++ b/src/main/java/ru/mystamps/web/feature/image/FilesystemImagePersistenceStrategy.java
@@ -51,7 +51,6 @@ public void init() {
log.warn("Directory '{}' doesn't exist! Image uploading won't work", storageDir);
} else if (!storageDir.canWrite()) {
- // CheckStyle: ignore ParenPad for next 1 line
log.warn( // NOPMD: GuardLogStatement (https://github.com/pmd/pmd/issues/957)
// FIXME(java9): log also user: ProcessHandle.current().info().user()
"Directory '{}' exists but isn't writable for the current user! "
@@ -70,7 +69,6 @@ public void init() {
} else if (!previewDir.canWrite()) {
// FIXME(java9): log also user: ProcessHandle.current().info().user()
- // CheckStyle: ignore ParenPad for next 1 line
log.warn( // NOPMD: GuardLogStatement (https://github.com/pmd/pmd/issues/957)
"Directory '{}' exists but isn't writable for the current user! "
+ "Image preview generation won't work",
diff --git a/src/main/java/ru/mystamps/web/feature/participant/JdbcParticipantDao.java b/src/main/java/ru/mystamps/web/feature/participant/JdbcParticipantDao.java
index 7ef133892..0e82eaa50 100644
--- a/src/main/java/ru/mystamps/web/feature/participant/JdbcParticipantDao.java
+++ b/src/main/java/ru/mystamps/web/feature/participant/JdbcParticipantDao.java
@@ -45,7 +45,6 @@ public class JdbcParticipantDao implements ParticipantDao {
private final String findAllGroupsSql;
private final String findGroupIdByNameSql;
- @SuppressWarnings("checkstyle:linelength")
public JdbcParticipantDao(Environment env, NamedParameterJdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
this.addParticipantSql = env.getRequiredProperty("transaction_participant.create");
diff --git a/src/main/java/ru/mystamps/web/feature/series/DownloadImageInterceptor.java b/src/main/java/ru/mystamps/web/feature/series/DownloadImageInterceptor.java
index 142fbbc3e..ecbdca5b5 100644
--- a/src/main/java/ru/mystamps/web/feature/series/DownloadImageInterceptor.java
+++ b/src/main/java/ru/mystamps/web/feature/series/DownloadImageInterceptor.java
@@ -89,7 +89,6 @@ public boolean preHandle(
if (!(request instanceof StandardMultipartHttpServletRequest)) {
// It could mean that