Skip to content

Commit 5a6fff0

Browse files
committed
Replace for loops with enhanced for loops
1 parent 96f8d6b commit 5a6fff0

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/JobRegistryBackgroundJobRunner.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,12 @@ private void register(String[] paths) throws DuplicateJobException, IOException
122122

123123
maybeCreateJobLoader();
124124

125-
for (int i = 0; i < paths.length; i++) {
125+
for (String s : paths) {
126126

127-
Resource[] resources = parentContext.getResources(paths[i]);
127+
Resource[] resources = parentContext.getResources(s);
128128

129-
for (int j = 0; j < resources.length; j++) {
129+
for (Resource path : resources) {
130130

131-
Resource path = resources[j];
132131
if (logger.isInfoEnabled()) {
133132
logger.info("Registering Job definitions from " + Arrays.toString(resources));
134133
}

spring-batch-infrastructure/src/test/java/org/springframework/batch/container/jms/BatchMessageListenerContainer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ protected boolean receiveAndExecute(final Object invoker, final Session session,
131131
*/
132132
public void initializeProxy() {
133133
ProxyFactory factory = new ProxyFactory();
134-
for (int i = 0; i < advices.length; i++) {
135-
DefaultPointcutAdvisor advisor = new DefaultPointcutAdvisor(advices[i]);
134+
for (Advice advice : advices) {
135+
DefaultPointcutAdvisor advisor = new DefaultPointcutAdvisor(advice);
136136
NameMatchMethodPointcut pointcut = new NameMatchMethodPointcut();
137137
pointcut.addMethodName("receiveAndExecute");
138138
advisor.setPointcut(pointcut);

0 commit comments

Comments
 (0)