Replace for loops with enhanced for loop where appropriate

This commit is contained in:
Mahmoud Ben Hassine
2023-06-12 16:05:44 +02:00
parent 8c5456cff6
commit 7babb341f5
10 changed files with 44 additions and 44 deletions

View File

@@ -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.
@@ -231,8 +231,8 @@ public abstract class AbstractJob implements Job, StepLocator, BeanNameAware, In
* @param listeners the listeners to set.
*/
public void setJobExecutionListeners(JobExecutionListener[] listeners) {
for (int i = 0; i < listeners.length; i++) {
this.listener.register(listeners[i]);
for (JobExecutionListener jobExecutionListener : listeners) {
this.listener.register(jobExecutionListener);
}
}

View File

@@ -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.
@@ -379,8 +379,8 @@ public abstract class AbstractStep implements Step, InitializingBean, BeanNameAw
* @param listeners an array of listener objects of known types.
*/
public void setStepExecutionListeners(StepExecutionListener[] listeners) {
for (int i = 0; i < listeners.length; i++) {
registerStepExecutionListener(listeners[i]);
for (StepExecutionListener listener : listeners) {
registerStepExecutionListener(listener);
}
}

View File

@@ -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.
@@ -167,8 +167,8 @@ public class TaskletStep extends AbstractStep {
* @param listeners an array of listener objects of known types.
*/
public void setChunkListeners(ChunkListener[] listeners) {
for (int i = 0; i < listeners.length; i++) {
registerChunkListener(listeners[i]);
for (ChunkListener listener : listeners) {
registerChunkListener(listener);
}
}
@@ -182,8 +182,8 @@ public class TaskletStep extends AbstractStep {
* @param streams an array of {@link ItemStream} objects.
*/
public void setStreams(ItemStream[] streams) {
for (int i = 0; i < streams.length; i++) {
registerStream(streams[i]);
for (ItemStream itemStream : streams) {
registerStream(itemStream);
}
}