Replace for loops with enhanced for loop where appropriate
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
@@ -83,8 +83,7 @@ public class DataSourceInitializer implements InitializingBean {
|
||||
private void initialize() {
|
||||
if (!initialized) {
|
||||
if (initScripts != null) {
|
||||
for (int i = 0; i < initScripts.length; i++) {
|
||||
Resource script = initScripts[i];
|
||||
for (Resource script : initScripts) {
|
||||
doExecuteScript(script);
|
||||
}
|
||||
}
|
||||
@@ -112,8 +111,8 @@ public class DataSourceInitializer implements InitializingBean {
|
||||
catch (IOException e) {
|
||||
throw new BeanInitializationException("Cannot load script from [" + scriptResource + "]", e);
|
||||
}
|
||||
for (int i = 0; i < scripts.length; i++) {
|
||||
String script = scripts[i].trim();
|
||||
for (String s : scripts) {
|
||||
String script = s.trim();
|
||||
if (StringUtils.hasText(script)) {
|
||||
try {
|
||||
jdbcTemplate.execute(script);
|
||||
|
||||
Reference in New Issue
Block a user