From f0137bc54c61dc25726b78a0c3450191fbe4e231 Mon Sep 17 00:00:00 2001
From: Mahmoud Ben Hassine
Date: Tue, 4 Jul 2023 21:54:28 +0200
Subject: [PATCH] Remove redundant modifiers
---
.../batch/core/launch/JobLauncher.java | 5 +++--
.../batch/core/launch/support/ExitCodeMapper.java | 15 ++++++++-------
.../batch/core/listener/ListenerMetaData.java | 13 +++++++------
.../annotation/StepScopeConfigurationTests.java | 2 +-
.../batch/item/database/orm/JpaQueryProvider.java | 4 ++--
.../DataFieldMaxValueIncrementerFactory.java | 9 +++++----
.../batch/item/mail/MailErrorHandler.java | 5 +++--
.../batch/repeat/RepeatStatus.java | 4 ++--
.../exception/LogOrRethrowExceptionHandler.java | 5 +++--
.../batch/repeat/support/ResultQueue.java | 4 ++--
.../batch/support/DatabaseType.java | 4 ++--
.../jms/BatchMessageListenerContainer.java | 2 +-
.../item/adapter/HippyMethodInvokerTests.java | 4 ++--
.../ExtendedConnectionDataSourceProxyTests.java | 4 ++--
.../support/AnnotationMethodResolverTests.java | 5 +++--
.../sample/domain/trade/CustomerOperation.java | 5 +++--
16 files changed, 49 insertions(+), 41 deletions(-)
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/JobLauncher.java b/spring-batch-core/src/main/java/org/springframework/batch/core/launch/JobLauncher.java
index 1e5e58450..79afede5c 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/JobLauncher.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/launch/JobLauncher.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2022 the original author or authors.
+ * Copyright 2006-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -33,6 +33,7 @@ import org.springframework.batch.core.repository.JobRestartException;
* @author Lucas Ward
* @author Dave Syer
* @author Taeik Lim
+ * @author Mahmoud Ben Hassine
*/
@FunctionalInterface
public interface JobLauncher {
@@ -59,7 +60,7 @@ public interface JobLauncher {
* same parameters and completed successfully
* @throws JobParametersInvalidException if the parameters are not valid for this job
*/
- public JobExecution run(Job job, JobParameters jobParameters) throws JobExecutionAlreadyRunningException,
+ JobExecution run(Job job, JobParameters jobParameters) throws JobExecutionAlreadyRunningException,
JobRestartException, JobInstanceAlreadyCompleteException, JobParametersInvalidException;
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/ExitCodeMapper.java b/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/ExitCodeMapper.java
index 9c28da39e..d7a6f684a 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/ExitCodeMapper.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/ExitCodeMapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,18 +24,19 @@ package org.springframework.batch.core.launch.support;
* @author Stijn Maller
* @author Lucas Ward
* @author Dave Syer
+ * @author Mahmoud Ben Hassine
*/
public interface ExitCodeMapper {
- static int JVM_EXITCODE_COMPLETED = 0;
+ int JVM_EXITCODE_COMPLETED = 0;
- static int JVM_EXITCODE_GENERIC_ERROR = 1;
+ int JVM_EXITCODE_GENERIC_ERROR = 1;
- static int JVM_EXITCODE_JOB_ERROR = 2;
+ int JVM_EXITCODE_JOB_ERROR = 2;
- public static final String NO_SUCH_JOB = "NO_SUCH_JOB";
+ String NO_SUCH_JOB = "NO_SUCH_JOB";
- public static final String JOB_NOT_PROVIDED = "JOB_NOT_PROVIDED";
+ String JOB_NOT_PROVIDED = "JOB_NOT_PROVIDED";
/**
* Convert the exit code from String into an integer that the calling environment as
@@ -43,6 +44,6 @@ public interface ExitCodeMapper {
* @param exitCode The exit code which is used internally.
* @return The corresponding exit status as known by the calling environment.
*/
- public int intValue(String exitCode);
+ int intValue(String exitCode);
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/ListenerMetaData.java b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/ListenerMetaData.java
index 56f14b1b3..620a2de97 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/ListenerMetaData.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/ListenerMetaData.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,20 +21,21 @@ import java.lang.annotation.Annotation;
* A common interface for listener meta data enumerations.
*
* @author Dan Garrette
+ * @author Mahmoud Ben Hassine
* @since 2.0
* @see JobListenerMetaData
* @see StepListenerMetaData
*/
public interface ListenerMetaData {
- public String getMethodName();
+ String getMethodName();
- public Class extends Annotation> getAnnotation();
+ Class extends Annotation> getAnnotation();
- public Class> getListenerInterface();
+ Class> getListenerInterface();
- public String getPropertyName();
+ String getPropertyName();
- public Class>[] getParamTypes();
+ Class>[] getParamTypes();
}
diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/annotation/StepScopeConfigurationTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/annotation/StepScopeConfigurationTests.java
index 0e24d07b8..7db10118c 100644
--- a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/annotation/StepScopeConfigurationTests.java
+++ b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/annotation/StepScopeConfigurationTests.java
@@ -212,7 +212,7 @@ public class StepScopeConfigurationTests {
}
- public static interface ISimpleHolder {
+ public interface ISimpleHolder {
String call() throws Exception;
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/orm/JpaQueryProvider.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/orm/JpaQueryProvider.java
index 654a0921f..1ccdd8f94 100644
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/orm/JpaQueryProvider.java
+++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/orm/JpaQueryProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2021 the original author or authors.
+ * Copyright 2006-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -41,7 +41,7 @@ public interface JpaQueryProvider {
*
* @return created query
*/
- public Query createQuery();
+ Query createQuery();
/**
* Provide an {@link EntityManager} for the query to be built.
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/DataFieldMaxValueIncrementerFactory.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/DataFieldMaxValueIncrementerFactory.java
index 889930a3c..39fd3e1a9 100644
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/DataFieldMaxValueIncrementerFactory.java
+++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/DataFieldMaxValueIncrementerFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2008 the original author or authors.
+ * Copyright 2006-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@ import org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer
* provided string.
*
* @author Lucas Ward
+ * @author Mahmoud Ben Hassine
*
*/
public interface DataFieldMaxValueIncrementerFactory {
@@ -35,7 +36,7 @@ public interface DataFieldMaxValueIncrementerFactory {
* @throws IllegalArgumentException if databaseType is invalid type, or
* incrementerName is null.
*/
- public DataFieldMaxValueIncrementer getIncrementer(String databaseType, String incrementerName);
+ DataFieldMaxValueIncrementer getIncrementer(String databaseType, String incrementerName);
/**
* Returns boolean indicated whether or not the provided string is supported by this
@@ -44,12 +45,12 @@ public interface DataFieldMaxValueIncrementerFactory {
* @return true if the incrementerType is supported by this database type. Else false
* is returned.
*/
- public boolean isSupportedIncrementerType(String databaseType);
+ boolean isSupportedIncrementerType(String databaseType);
/**
* Returns the list of supported database incrementer types
* @return an array of {@link String}s containing the supported incrementer types.
*/
- public String[] getSupportedIncrementerTypes();
+ String[] getSupportedIncrementerTypes();
}
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/mail/MailErrorHandler.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/mail/MailErrorHandler.java
index b27cc841d..52715ff27 100644
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/mail/MailErrorHandler.java
+++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/mail/MailErrorHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2010 the original author or authors.
+ * Copyright 2006-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@ import org.springframework.mail.MailMessage;
*
* @author Dan Garrette
* @author Dave Syer
+ * @author Mahmoud Ben Hassine
* @since 2.1
*/
public interface MailErrorHandler {
@@ -37,6 +38,6 @@ public interface MailErrorHandler {
* @param exception the exception that caused the failure
* @throws MailException if the exception cannot be handled
*/
- public void handle(MailMessage message, Exception exception) throws MailException;
+ void handle(MailMessage message, Exception exception) throws MailException;
}
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/RepeatStatus.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/RepeatStatus.java
index c94fa1d44..0bafe50e4 100644
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/RepeatStatus.java
+++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/RepeatStatus.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,7 +29,7 @@ public enum RepeatStatus {
private final boolean continuable;
- private RepeatStatus(boolean continuable) {
+ RepeatStatus(boolean continuable) {
this.continuable = continuable;
}
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/exception/LogOrRethrowExceptionHandler.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/exception/LogOrRethrowExceptionHandler.java
index 01be9f802..e30a3bfb0 100644
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/exception/LogOrRethrowExceptionHandler.java
+++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/exception/LogOrRethrowExceptionHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,6 +29,7 @@ import org.springframework.batch.repeat.RepeatException;
* classifier must be the same as the static enum in this class.
*
* @author Dave Syer
+ * @author Mahmoud Ben Hassine
*
*/
public class LogOrRethrowExceptionHandler implements ExceptionHandler {
@@ -39,7 +40,7 @@ public class LogOrRethrowExceptionHandler implements ExceptionHandler {
* @author Dave Syer
*
*/
- public static enum Level {
+ public enum Level {
/**
* Key for {@link Classifier} signalling that the throwable should be rethrown. If
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/ResultQueue.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/ResultQueue.java
index 0325c393c..c8252fa24 100644
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/ResultQueue.java
+++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/ResultQueue.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2022 the original author or authors.
+ * Copyright 2002-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -79,6 +79,6 @@ interface ResultQueue {
* when it is finished.
* @return true if more results are expected, but possibly not yet available.
*/
- public boolean isExpecting();
+ boolean isExpecting();
}
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/DatabaseType.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/DatabaseType.java
index c43338df0..c4086b453 100644
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/DatabaseType.java
+++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/DatabaseType.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2022 the original author or authors.
+ * Copyright 2006-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -52,7 +52,7 @@ public enum DatabaseType {
// in metadata.
private final String productName;
- private DatabaseType(String productName) {
+ DatabaseType(String productName) {
this.productName = productName;
}
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/container/jms/BatchMessageListenerContainer.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/container/jms/BatchMessageListenerContainer.java
index 66302cf48..df3c584f8 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/container/jms/BatchMessageListenerContainer.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/container/jms/BatchMessageListenerContainer.java
@@ -57,7 +57,7 @@ public class BatchMessageListenerContainer extends DefaultMessageListenerContain
* @author Dave Syer
*
*/
- public static interface ContainerDelegate {
+ public interface ContainerDelegate {
boolean receiveAndExecute(Object invoker, Session session, MessageConsumer consumer) throws JMSException;
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/adapter/HippyMethodInvokerTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/adapter/HippyMethodInvokerTests.java
index 319e670f5..f82f63c5a 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/adapter/HippyMethodInvokerTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/adapter/HippyMethodInvokerTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010-2022 the original author or authors.
+ * Copyright 2010-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -158,7 +158,7 @@ class HippyMethodInvokerTests {
}
- public static interface Service {
+ public interface Service {
String getMessage(double value, String input);
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/ExtendedConnectionDataSourceProxyTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/ExtendedConnectionDataSourceProxyTests.java
index e4407c5bc..0439f2ad2 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/ExtendedConnectionDataSourceProxyTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/ExtendedConnectionDataSourceProxyTests.java
@@ -257,14 +257,14 @@ class ExtendedConnectionDataSourceProxyTests {
/**
* Interface implemented by the wrapped DataSource
*/
- private static interface Supported {
+ private interface Supported {
}
/**
* Interface *not* implemented by the wrapped DataSource
*/
- private static interface Unsupported {
+ private interface Unsupported {
}
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/support/AnnotationMethodResolverTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/support/AnnotationMethodResolverTests.java
index cba5ee797..ee0ca2cee 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/support/AnnotationMethodResolverTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/support/AnnotationMethodResolverTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2022 the original author or authors.
+ * Copyright 2002-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,6 +30,7 @@ import org.junit.jupiter.api.Test;
/**
* @author Mark Fisher
+ * @author Mahmoud Ben Hassine
*/
class AnnotationMethodResolverTests {
@@ -55,7 +56,7 @@ class AnnotationMethodResolverTests {
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
- private static @interface TestAnnotation {
+ private @interface TestAnnotation {
}
diff --git a/spring-batch-samples/src/main/java/org/springframework/batch/sample/domain/trade/CustomerOperation.java b/spring-batch-samples/src/main/java/org/springframework/batch/sample/domain/trade/CustomerOperation.java
index 87f1e64c2..a0eeb7ba5 100644
--- a/spring-batch-samples/src/main/java/org/springframework/batch/sample/domain/trade/CustomerOperation.java
+++ b/spring-batch-samples/src/main/java/org/springframework/batch/sample/domain/trade/CustomerOperation.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2014 the original author or authors.
+ * Copyright 2006-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,6 +23,7 @@ import java.util.Map;
* Enum representing on of 3 possible actions on a customer update: Add, update, or delete
*
* @author Lucas Ward
+ * @author Mahmoud Ben Hassine
*
*/
public enum CustomerOperation {
@@ -33,7 +34,7 @@ public enum CustomerOperation {
private static final Map CODE_MAP;
- private CustomerOperation(char code) {
+ CustomerOperation(char code) {
this.code = code;
}