Commit a0087170 authored by Phillip Webb's avatar Phillip Webb

Polish

parent 18d76349
...@@ -87,7 +87,7 @@ public class ThymeleafAutoConfiguration { ...@@ -87,7 +87,7 @@ public class ThymeleafAutoConfiguration {
} }
@Bean @Bean
public ITemplateResolver defaultTemplateResolver() { public TemplateResolver defaultTemplateResolver() {
TemplateResolver resolver = new TemplateResolver(); TemplateResolver resolver = new TemplateResolver();
resolver.setResourceResolver(thymeleafResourceResolver()); resolver.setResourceResolver(thymeleafResourceResolver());
resolver.setPrefix(this.properties.getPrefix()); resolver.setPrefix(this.properties.getPrefix());
......
...@@ -54,8 +54,6 @@ import org.springframework.util.StringUtils; ...@@ -54,8 +54,6 @@ import org.springframework.util.StringUtils;
*/ */
class BeanDefinitionLoader { class BeanDefinitionLoader {
private static final ResourceLoader DEFAULT_RESOURCE_LOADER = new PathMatchingResourcePatternResolver();
private final Object[] sources; private final Object[] sources;
private final AnnotatedBeanDefinitionReader annotatedReader; private final AnnotatedBeanDefinitionReader annotatedReader;
...@@ -228,8 +226,8 @@ class BeanDefinitionLoader { ...@@ -228,8 +226,8 @@ class BeanDefinitionLoader {
} }
private Resource[] findResources(String source) { private Resource[] findResources(String source) {
ResourceLoader loader = this.resourceLoader != null ? this.resourceLoader ResourceLoader loader = (this.resourceLoader != null ? this.resourceLoader
: DEFAULT_RESOURCE_LOADER; : new PathMatchingResourcePatternResolver());
try { try {
if (loader instanceof ResourcePatternResolver) { if (loader instanceof ResourcePatternResolver) {
return ((ResourcePatternResolver) loader).getResources(source); return ((ResourcePatternResolver) loader).getResources(source);
......
...@@ -62,7 +62,7 @@ public class PropertySourcesLoader { ...@@ -62,7 +62,7 @@ public class PropertySourcesLoader {
Assert.notNull(propertySources, "PropertySources must not be null"); Assert.notNull(propertySources, "PropertySources must not be null");
this.propertySources = propertySources; this.propertySources = propertySources;
this.loaders = SpringFactoriesLoader.loadFactories(PropertySourceLoader.class, this.loaders = SpringFactoriesLoader.loadFactories(PropertySourceLoader.class,
null); getClass().getClassLoader());
} }
/** /**
......
...@@ -767,4 +767,5 @@ public class SpringApplicationTests { ...@@ -767,4 +767,5 @@ public class SpringApplicationTests {
} }
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment