From 530fb0808db3e60e68d3678e4e38843d070babd5 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Mon, 8 Mar 2021 23:45:56 +0100 Subject: [PATCH] Polishing --- .../beans/factory/groovy/GroovyBeanDefinitionReader.java | 6 +++--- .../src/main/java/org/springframework/util/StringUtils.java | 6 +++--- .../web/reactive/resource/ResourceUrlProvider.java | 2 +- .../web/servlet/resource/ResourceUrlProvider.java | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/groovy/GroovyBeanDefinitionReader.java b/spring-beans/src/main/java/org/springframework/beans/factory/groovy/GroovyBeanDefinitionReader.java index cf13a408173..14427fee93e 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/groovy/GroovyBeanDefinitionReader.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/groovy/GroovyBeanDefinitionReader.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2021 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. @@ -489,8 +489,8 @@ public class GroovyBeanDefinitionReader extends AbstractBeanDefinitionReader imp resolveConstructorArguments(args, 2, hasClosureArgument ? args.length - 1 : args.length); this.currentBeanDefinition = new GroovyBeanDefinitionWrapper(beanName, (Class) args[1], constructorArgs); Map namedArgs = (Map) args[0]; - for (Object o : namedArgs.keySet()) { - String propName = (String) o; + for (Object key : namedArgs.keySet()) { + String propName = (String) key; setProperty(propName, namedArgs.get(propName)); } } diff --git a/spring-core/src/main/java/org/springframework/util/StringUtils.java b/spring-core/src/main/java/org/springframework/util/StringUtils.java index 6d6d577cc51..670edea3a4f 100644 --- a/spring-core/src/main/java/org/springframework/util/StringUtils.java +++ b/spring-core/src/main/java/org/springframework/util/StringUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2021 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. @@ -1342,8 +1342,8 @@ public abstract class StringUtils { } StringJoiner sj = new StringJoiner(delim); - for (Object o : arr) { - sj.add(String.valueOf(o)); + for (Object elem : arr) { + sj.add(String.valueOf(elem)); } return sj.toString(); } diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/resource/ResourceUrlProvider.java b/spring-webflux/src/main/java/org/springframework/web/reactive/resource/ResourceUrlProvider.java index 2146fbdde3f..b78d8532008 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/resource/ResourceUrlProvider.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/resource/ResourceUrlProvider.java @@ -57,12 +57,12 @@ public class ResourceUrlProvider implements ApplicationListener handlerMap = new LinkedHashMap<>(); @Nullable private ApplicationContext applicationContext; + @Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { this.applicationContext = applicationContext; diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/ResourceUrlProvider.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/ResourceUrlProvider.java index c536be5e77a..c1f926cd86d 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/ResourceUrlProvider.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/ResourceUrlProvider.java @@ -67,6 +67,7 @@ public class ResourceUrlProvider implements ApplicationListener beans = appContext.getBeansOfType(SimpleUrlHandlerMapping.class); List mappings = new ArrayList<>(beans.values()); @@ -225,7 +226,6 @@ public class ResourceUrlProvider implements ApplicationListener