Commit 31939138 authored by Phillip Webb's avatar Phillip Webb

Polish

parent 63de33ef
/* /*
* Copyright 2012-2013 the original author or authors. * Copyright 2012-2014 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -16,9 +16,6 @@ ...@@ -16,9 +16,6 @@
package org.springframework.boot.autoconfigure; package org.springframework.boot.autoconfigure;
import static org.springframework.util.StringUtils.commaDelimitedListToStringArray;
import static org.springframework.util.StringUtils.trimAllWhitespace;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.bind.RelaxedPropertyResolver; import org.springframework.boot.bind.RelaxedPropertyResolver;
import org.springframework.context.EnvironmentAware; import org.springframework.context.EnvironmentAware;
...@@ -31,6 +28,9 @@ import org.springframework.core.annotation.Order; ...@@ -31,6 +28,9 @@ import org.springframework.core.annotation.Order;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.util.StringUtils; 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}. * {@link EnableAutoConfiguration Auto-configuration} for {@link MessageSource}.
* *
...@@ -53,7 +53,8 @@ public class MessageSourceAutoConfiguration implements EnvironmentAware { ...@@ -53,7 +53,8 @@ public class MessageSourceAutoConfiguration implements EnvironmentAware {
ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource(); ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource();
String basename = this.environment.getProperty("basename", "messages"); String basename = this.environment.getProperty("basename", "messages");
if (StringUtils.hasText(basename)) { if (StringUtils.hasText(basename)) {
messageSource.setBasenames(commaDelimitedListToStringArray(trimAllWhitespace(basename))); messageSource
.setBasenames(commaDelimitedListToStringArray(trimAllWhitespace(basename)));
} }
String encoding = this.environment.getProperty("encoding", "utf-8"); String encoding = this.environment.getProperty("encoding", "utf-8");
messageSource.setDefaultEncoding(encoding); messageSource.setDefaultEncoding(encoding);
......
/* /*
* Copyright 2012-2013 the original author or authors. * Copyright 2012-2014 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -16,14 +16,14 @@ ...@@ -16,14 +16,14 @@
package org.springframework.boot.autoconfigure; package org.springframework.boot.autoconfigure;
import static org.junit.Assert.assertEquals;
import java.util.Locale; import java.util.Locale;
import org.junit.Test; import org.junit.Test;
import org.springframework.boot.test.EnvironmentTestUtils; import org.springframework.boot.test.EnvironmentTestUtils;
import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import static org.junit.Assert.assertEquals;
/** /**
* Tests for {@link MessageSourceAutoConfiguration}. * Tests for {@link MessageSourceAutoConfiguration}.
* *
......
= Spring Boot Reference Guide = Spring Boot Reference Guide
Phillip Webb; Dave Syer; Josh Long; Phillip Webb; Dave Syer; Josh Long; Stéphane Nicoll;
:doctype: book :doctype: book
:toc: :toc:
:toclevels: 4 :toclevels: 4
......
...@@ -11,7 +11,7 @@ welcome = { -> ...@@ -11,7 +11,7 @@ welcome = { ->
hostName = "localhost"; hostName = "localhost";
} }
// Get Spring Boot version from context Get Spring Boot version from context
def version = crash.context.attributes.get("spring.boot.version") def version = crash.context.attributes.get("spring.boot.version")
return """\ return """\
......
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