提交 530fb080 编写于 作者: J Juergen Hoeller

Polishing

上级 48688b7b
/*
* 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));
}
}
......
/*
* 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();
}
......
......@@ -57,12 +57,12 @@ public class ResourceUrlProvider implements ApplicationListener<ContextRefreshed
private static final Log logger = LogFactory.getLog(ResourceUrlProvider.class);
private final Map<PathPattern, ResourceWebHandler> handlerMap = new LinkedHashMap<>();
@Nullable
private ApplicationContext applicationContext;
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
this.applicationContext = applicationContext;
......
......@@ -67,6 +67,7 @@ public class ResourceUrlProvider implements ApplicationListener<ContextRefreshed
private boolean autodetect = true;
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
this.applicationContext = applicationContext;
......@@ -134,6 +135,7 @@ public class ResourceUrlProvider implements ApplicationListener<ContextRefreshed
return this.autodetect;
}
@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
if (event.getApplicationContext() == this.applicationContext && isAutodetect()) {
......@@ -145,7 +147,6 @@ public class ResourceUrlProvider implements ApplicationListener<ContextRefreshed
}
}
protected void detectResourceHandlers(ApplicationContext appContext) {
Map<String, SimpleUrlHandlerMapping> beans = appContext.getBeansOfType(SimpleUrlHandlerMapping.class);
List<SimpleUrlHandlerMapping> mappings = new ArrayList<>(beans.values());
......@@ -225,7 +226,6 @@ public class ResourceUrlProvider implements ApplicationListener<ContextRefreshed
*/
@Nullable
public final String getForLookupPath(String lookupPath) {
// Clean duplicate slashes or pathWithinPattern won't match lookupPath
String previous;
do {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册