From fa70bcd775e02a79a2b53a768cda0b1361a4bba7 Mon Sep 17 00:00:00 2001 From: Jinho Han Date: Fri, 1 Jul 2022 00:01:19 +0900 Subject: [PATCH] Add final to RunIdIncrementer and Job/Step BuilderFactory fields Issue #4143 --- .../core/configuration/annotation/JobBuilderFactory.java | 5 +++-- .../core/configuration/annotation/StepBuilderFactory.java | 5 +++-- .../batch/core/launch/support/RunIdIncrementer.java | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/JobBuilderFactory.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/JobBuilderFactory.java index c5f5e4b0a..df3b41132 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/JobBuilderFactory.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/JobBuilderFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-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. @@ -25,6 +25,7 @@ import org.springframework.util.Assert; * * @author Dave Syer * @author Mahmoud Ben Hassine + * @author Jinho Han * @deprecated Deprecated as of v5.0 and scheduled for removal in v5.2 in favor of using * the {@link JobBuilder}. * @@ -32,7 +33,7 @@ import org.springframework.util.Assert; @Deprecated(since = "5.0.0", forRemoval = true) public class JobBuilderFactory { - private JobRepository jobRepository; + private final JobRepository jobRepository; /** * @param jobRepository The {@link JobRepository} to be used by the builder factory. diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/StepBuilderFactory.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/StepBuilderFactory.java index 32476fa05..4ff6c21b9 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/StepBuilderFactory.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/StepBuilderFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-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. @@ -26,6 +26,7 @@ import org.springframework.util.Assert; * * @author Dave Syer * @author Mahmoud Ben Hassine + * @author Jinho Han * @deprecated Deprecated as of v5.0 and scheduled for removal in v5.2 in favor of using * the {@link StepBuilder}. * @@ -33,7 +34,7 @@ import org.springframework.util.Assert; @Deprecated(since = "5.0.0", forRemoval = true) public class StepBuilderFactory { - private JobRepository jobRepository; + private final JobRepository jobRepository; /** * Constructor for the {@link StepBuilderFactory}. diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/RunIdIncrementer.java b/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/RunIdIncrementer.java index d83ddeb85..919ccb026 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/RunIdIncrementer.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/RunIdIncrementer.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2020 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. @@ -28,10 +28,11 @@ import org.springframework.lang.Nullable; * * @author Dave Syer * @author Mahmoud Ben Hassine + * @author Jinho Han */ public class RunIdIncrementer implements JobParametersIncrementer { - private static String RUN_ID_KEY = "run.id"; + private static final String RUN_ID_KEY = "run.id"; private String key = RUN_ID_KEY;