diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcJobInstanceDao.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcJobInstanceDao.java index 30b087867..61d7d0d32 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcJobInstanceDao.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcJobInstanceDao.java @@ -353,7 +353,7 @@ public class JdbcJobInstanceDao extends AbstractJdbcBatchMetadataDao implements * @author Dave Syer * */ - private final class JobInstanceRowMapper implements RowMapper { + private static final class JobInstanceRowMapper implements RowMapper { public JobInstanceRowMapper() { } diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/step/builder/FaultTolerantStepBuilder.java b/spring-batch-core/src/main/java/org/springframework/batch/core/step/builder/FaultTolerantStepBuilder.java index 186c96834..1efb06b8b 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/step/builder/FaultTolerantStepBuilder.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/step/builder/FaultTolerantStepBuilder.java @@ -694,7 +694,7 @@ public class FaultTolerantStepBuilder extends SimpleStepBuilder { * must be handled in the implementation or the step will terminate * */ - private class TerminateOnExceptionChunkListenerDelegate implements ChunkListener { + private static class TerminateOnExceptionChunkListenerDelegate implements ChunkListener { private ChunkListener chunkListener; diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/BatchRetryTemplate.java b/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/BatchRetryTemplate.java index 01f78cd1b..10a73504c 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/BatchRetryTemplate.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/BatchRetryTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2013 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,11 +52,12 @@ import java.util.List; * other items in the same batch fail fatally first. * * @author Dave Syer + * @author Mahmoud Ben Hassine * */ public class BatchRetryTemplate implements RetryOperations { - private class BatchRetryState extends DefaultRetryState { + private static class BatchRetryState extends DefaultRetryState { private final Collection keys; diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/listener/JobListenerFactoryBeanTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/listener/JobListenerFactoryBeanTests.java index ad365e1b9..59bdb90e4 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/listener/JobListenerFactoryBeanTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/listener/JobListenerFactoryBeanTests.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. @@ -37,6 +37,7 @@ import org.springframework.core.Ordered; /** * @author Lucas Ward + * @author Mahmoud Ben Hassine * */ class JobListenerFactoryBeanTests { @@ -233,7 +234,7 @@ class JobListenerFactoryBeanTests { assertThrows(IllegalArgumentException.class, factoryBean::getObject); } - private class JobListenerWithInterface implements JobExecutionListener { + private static class JobListenerWithInterface implements JobExecutionListener { boolean beforeJobCalled = false; @@ -251,7 +252,7 @@ class JobListenerFactoryBeanTests { } - private class AnnotatedTestClass { + private static class AnnotatedTestClass { boolean beforeJobCalled = false; diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/listener/MulticasterBatchListenerTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/listener/MulticasterBatchListenerTests.java index 9b4d28a3e..8d944be45 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/listener/MulticasterBatchListenerTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/listener/MulticasterBatchListenerTests.java @@ -548,7 +548,7 @@ class MulticasterBatchListenerTests { assertEquals("listener error", message, "Wrong message: " + message); } - private final class AnnotationBasedStepListener { + private static final class AnnotationBasedStepListener { private IllegalStateException exception = new IllegalStateException("listener error"); diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/listener/StepListenerFactoryBeanTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/listener/StepListenerFactoryBeanTests.java index e7fd7153e..f01c8b2fa 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/listener/StepListenerFactoryBeanTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/listener/StepListenerFactoryBeanTests.java @@ -363,7 +363,7 @@ class StepListenerFactoryBeanTests { assertThrows(IllegalArgumentException.class, factoryBean::getObject); } - private class MultipleAfterStep implements StepExecutionListener { + private static class MultipleAfterStep implements StepExecutionListener { int callcount = 0; @@ -384,7 +384,7 @@ class StepListenerFactoryBeanTests { } @SuppressWarnings("unused") - private class ThreeStepExecutionListener implements StepExecutionListener { + private static class ThreeStepExecutionListener implements StepExecutionListener { int callcount = 0; @@ -413,7 +413,7 @@ class StepListenerFactoryBeanTests { } @SuppressWarnings("unused") - private class TestListener implements SkipListener { + private static class TestListener implements SkipListener { boolean beforeStepCalled = false; diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBeanRollbackTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBeanRollbackTests.java index 4d2f762f7..ea08e1353 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBeanRollbackTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBeanRollbackTests.java @@ -589,7 +589,7 @@ class FaultTolerantStepFactoryBeanRollbackTests { return map; } - class ExceptionThrowingChunkListener implements ChunkListener { + static class ExceptionThrowingChunkListener implements ChunkListener { private int phase = -1; diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/step/tasklet/TaskletStepTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/step/tasklet/TaskletStepTests.java index dcb0a213c..ec1fcfb04 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/step/tasklet/TaskletStepTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/step/tasklet/TaskletStepTests.java @@ -929,7 +929,7 @@ class TaskletStepTests { } - private class MockRestartableItemReader extends AbstractItemStreamItemReader + private static class MockRestartableItemReader extends AbstractItemStreamItemReader implements StepExecutionListener { private boolean getExecutionAttributesCalled = false; diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/test/ldif/builder/MappingLdifReaderBuilderTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/test/ldif/builder/MappingLdifReaderBuilderTests.java index 7dadc3c00..d8942794b 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/test/ldif/builder/MappingLdifReaderBuilderTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/test/ldif/builder/MappingLdifReaderBuilderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2022 the original author or authors. + * Copyright 2017-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. @@ -199,7 +199,7 @@ class MappingLdifReaderBuilderTests { } - public class TestMapper implements RecordMapper { + public static class TestMapper implements RecordMapper { @Nullable @Override diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/test/step/FaultTolerantStepIntegrationTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/test/step/FaultTolerantStepIntegrationTests.java index 3cbb678d3..32579d820 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/test/step/FaultTolerantStepIntegrationTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/test/step/FaultTolerantStepIntegrationTests.java @@ -260,7 +260,7 @@ class FaultTolerantStepIntegrationTests { return stepExecution; } - private class SkipIllegalArgumentExceptionSkipPolicy implements SkipPolicy { + private static class SkipIllegalArgumentExceptionSkipPolicy implements SkipPolicy { @Override public boolean shouldSkip(Throwable throwable, long skipCount) throws SkipLimitExceededException { diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/SimpleBinaryBufferedReaderFactory.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/SimpleBinaryBufferedReaderFactory.java index 4ccbd2b2d..0314896ff 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/SimpleBinaryBufferedReaderFactory.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/SimpleBinaryBufferedReaderFactory.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. @@ -31,6 +31,7 @@ import org.springframework.core.io.Resource; * implementation. * * @author Dave Syer + * @author Mahmoud Ben Hassine * @since 2.1 */ public class SimpleBinaryBufferedReaderFactory implements BufferedReaderFactory { @@ -61,7 +62,7 @@ public class SimpleBinaryBufferedReaderFactory implements BufferedReaderFactory * @author Dave Syer * */ - private final class BinaryBufferedReader extends BufferedReader { + private static final class BinaryBufferedReader extends BufferedReader { private final String ending; diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JdbcBatchItemWriterNamedParameterTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JdbcBatchItemWriterNamedParameterTests.java index 8bbcdcb8f..5a6cbb55d 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JdbcBatchItemWriterNamedParameterTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JdbcBatchItemWriterNamedParameterTests.java @@ -54,7 +54,7 @@ public class JdbcBatchItemWriterNamedParameterTests { private final String sql = "update foo set bar = :bar where id = :id"; @SuppressWarnings("unused") - private class Foo { + private static class Foo { private Long id; diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/support/SimpleMethodInvokerTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/support/SimpleMethodInvokerTests.java index 9270d650f..2060de79a 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/support/SimpleMethodInvokerTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/support/SimpleMethodInvokerTests.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. @@ -29,6 +29,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; /** * @author Lucas Ward + * @author Mahmoud Ben Hassine * */ class SimpleMethodInvokerTests { @@ -106,7 +107,7 @@ class SimpleMethodInvokerTests { } @SuppressWarnings("unused") - private class TestClass { + private static class TestClass { boolean beforeCalled = false; diff --git a/spring-batch-integration/src/test/java/org/springframework/batch/integration/async/AsyncItemWriterTests.java b/spring-batch-integration/src/test/java/org/springframework/batch/integration/async/AsyncItemWriterTests.java index 4d8a75f19..44a99d970 100644 --- a/spring-batch-integration/src/test/java/org/springframework/batch/integration/async/AsyncItemWriterTests.java +++ b/spring-batch-integration/src/test/java/org/springframework/batch/integration/async/AsyncItemWriterTests.java @@ -193,7 +193,7 @@ class AsyncItemWriterTests { assertFalse(itemWriter.isClosed); } - private class ListItemWriter implements ItemWriter { + private static class ListItemWriter implements ItemWriter { protected List items; @@ -214,7 +214,7 @@ class AsyncItemWriterTests { } - private class ListItemStreamWriter implements ItemStreamWriter { + private static class ListItemStreamWriter implements ItemStreamWriter { public boolean isOpened = false; diff --git a/spring-batch-test/src/main/java/org/springframework/batch/test/JobScopeTestExecutionListener.java b/spring-batch-test/src/main/java/org/springframework/batch/test/JobScopeTestExecutionListener.java index 00c08f895..0096d88cf 100644 --- a/spring-batch-test/src/main/java/org/springframework/batch/test/JobScopeTestExecutionListener.java +++ b/spring-batch-test/src/main/java/org/springframework/batch/test/JobScopeTestExecutionListener.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. @@ -61,6 +61,7 @@ import org.springframework.util.ReflectionUtils.MethodCallback; * * @author Dave Syer * @author Jimmy Praet + * @author Mahmoud Ben Hassine */ public class JobScopeTestExecutionListener implements TestExecutionListener { @@ -139,7 +140,7 @@ public class JobScopeTestExecutionListener implements TestExecutionListener { * Look for a method returning the type provided, preferring one with the name * provided. */ - private final class ExtractorMethodCallback implements MethodCallback { + private static final class ExtractorMethodCallback implements MethodCallback { private String preferredName; diff --git a/spring-batch-test/src/main/java/org/springframework/batch/test/StepScopeTestExecutionListener.java b/spring-batch-test/src/main/java/org/springframework/batch/test/StepScopeTestExecutionListener.java index 3aa675fbf..8948ee440 100644 --- a/spring-batch-test/src/main/java/org/springframework/batch/test/StepScopeTestExecutionListener.java +++ b/spring-batch-test/src/main/java/org/springframework/batch/test/StepScopeTestExecutionListener.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. @@ -62,6 +62,7 @@ import org.springframework.util.ReflectionUtils.MethodCallback; * * @author Dave Syer * @author Chris Schaefer + * @author Mahmoud Ben Hassine */ public class StepScopeTestExecutionListener implements TestExecutionListener { @@ -142,7 +143,7 @@ public class StepScopeTestExecutionListener implements TestExecutionListener { * Look for a method returning the type provided, preferring one with the name * provided. */ - private final class ExtractorMethodCallback implements MethodCallback { + private static final class ExtractorMethodCallback implements MethodCallback { private String preferredName;