Skip to content

Commit

Permalink
Merge branch '1.0.x'
Browse files Browse the repository at this point in the history
Conflicts: MessageSourceAutoConfiguration.java
  • Loading branch information
dsyer committed Aug 21, 2015
2 parents 2583f80 + 68b55ad commit ff8a4d0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ bin
build
lib/
target
.factorypath
.springBeans
interpolated*.xml
dependency-reduced-pom.xml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

package org.springframework.boot.autoconfigure;

import static org.springframework.util.StringUtils.commaDelimitedListToStringArray;
import static org.springframework.util.StringUtils.trimAllWhitespace;

import java.io.IOException;
import java.nio.charset.Charset;
import java.util.Iterator;
Expand All @@ -24,6 +27,7 @@
import org.springframework.boot.autoconfigure.MessageSourceAutoConfiguration.ResourceBundleCondition;
import org.springframework.boot.autoconfigure.condition.ConditionOutcome;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.SearchStrategy;
import org.springframework.boot.autoconfigure.condition.SpringBootCondition;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
Expand All @@ -40,9 +44,6 @@
import org.springframework.util.ConcurrentReferenceHashMap;
import org.springframework.util.StringUtils;

import static org.springframework.util.StringUtils.commaDelimitedListToStringArray;
import static org.springframework.util.StringUtils.trimAllWhitespace;

/**
* {@link EnableAutoConfiguration Auto-configuration} for {@link MessageSource}.
*
Expand All @@ -51,7 +52,7 @@
* @author Eddú Meléndez
*/
@Configuration
@ConditionalOnMissingBean(MessageSource.class)
@ConditionalOnMissingBean(value=MessageSource.class, search=SearchStrategy.CURRENT)
@AutoConfigureOrder(Ordered.HIGHEST_PRECEDENCE)
@Conditional(ResourceBundleCondition.class)
@EnableConfigurationProperties
Expand Down Expand Up @@ -90,7 +91,7 @@ public MessageSource messageSource() {
ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource();
if (StringUtils.hasText(this.basename)) {
messageSource
.setBasenames(commaDelimitedListToStringArray(trimAllWhitespace(this.basename)));
.setBasenames(commaDelimitedListToStringArray(trimAllWhitespace(this.basename)));
}
if (this.encoding != null) {
messageSource.setDefaultEncoding(this.encoding.name());
Expand Down Expand Up @@ -166,7 +167,7 @@ private ConditionOutcome getMatchOutcomeForBasename(ConditionContext context,
private Resource[] getResources(ClassLoader classLoader, String name) {
try {
return new SkipPatternPathMatchingResourcePatternResolver(classLoader)
.getResources("classpath*:" + name + "*.properties");
.getResources("classpath*:" + name + "*.properties");
}
catch (Exception ex) {
return NO_RESOURCES;
Expand All @@ -180,7 +181,7 @@ private Resource[] getResources(ClassLoader classLoader, String name) {
* contain messages.properties.
*/
private static class SkipPatternPathMatchingResourcePatternResolver extends
PathMatchingResourcePatternResolver {
PathMatchingResourcePatternResolver {

private static final ClassLoader ROOT_CLASSLOADER;
static {
Expand All @@ -197,14 +198,14 @@ private static class SkipPatternPathMatchingResourcePatternResolver extends
}

private static final String[] SKIPPED = { "aspectjweaver-", "hibernate-core-",
"hsqldb-", "jackson-annotations-", "jackson-core-", "jackson-databind-",
"javassist-", "snakeyaml-", "spring-aop-", "spring-beans-",
"spring-boot-", "spring-boot-actuator-", "spring-boot-autoconfigure-",
"spring-core-", "spring-context-", "spring-data-commons-",
"spring-expression-", "spring-jdbc-", "spring-orm-", "spring-tx-",
"spring-web-", "spring-webmvc-", "tomcat-embed-", "joda-time-",
"hibernate-entitymanager-", "hibernate-validator-", "logback-classic-",
"logback-core-", "thymeleaf-" };
"hsqldb-", "jackson-annotations-", "jackson-core-", "jackson-databind-",
"javassist-", "snakeyaml-", "spring-aop-", "spring-beans-",
"spring-boot-", "spring-boot-actuator-", "spring-boot-autoconfigure-",
"spring-core-", "spring-context-", "spring-data-commons-",
"spring-expression-", "spring-jdbc-", "spring-orm-", "spring-tx-",
"spring-web-", "spring-webmvc-", "tomcat-embed-", "joda-time-",
"hibernate-entitymanager-", "hibernate-validator-", "logback-classic-",
"logback-core-", "thymeleaf-" };

public SkipPatternPathMatchingResourcePatternResolver(ClassLoader classLoader) {
super(classLoader);
Expand Down
2 changes: 1 addition & 1 deletion spring-boot-dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2129,4 +2129,4 @@
<id>integration-test</id>
</profile>
</profiles>
</project>
</project>

0 comments on commit ff8a4d0

Please sign in to comment.