Replace for loops with enhanced for loops

This commit is contained in:
Mahmoud Ben Hassine
2023-07-04 18:52:19 +02:00
parent 96f8d6bd35
commit 5a6fff032d
2 changed files with 5 additions and 6 deletions

View File

@@ -122,13 +122,12 @@ public class JobRegistryBackgroundJobRunner {
maybeCreateJobLoader();
for (int i = 0; i < paths.length; i++) {
for (String s : paths) {
Resource[] resources = parentContext.getResources(paths[i]);
Resource[] resources = parentContext.getResources(s);
for (int j = 0; j < resources.length; j++) {
for (Resource path : resources) {
Resource path = resources[j];
if (logger.isInfoEnabled()) {
logger.info("Registering Job definitions from " + Arrays.toString(resources));
}

View File

@@ -131,8 +131,8 @@ public class BatchMessageListenerContainer extends DefaultMessageListenerContain
*/
public void initializeProxy() {
ProxyFactory factory = new ProxyFactory();
for (int i = 0; i < advices.length; i++) {
DefaultPointcutAdvisor advisor = new DefaultPointcutAdvisor(advices[i]);
for (Advice advice : advices) {
DefaultPointcutAdvisor advisor = new DefaultPointcutAdvisor(advice);
NameMatchMethodPointcut pointcut = new NameMatchMethodPointcut();
pointcut.addMethodName("receiveAndExecute");
advisor.setPointcut(pointcut);