Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
68b55ada
Commit
68b55ada
authored
Aug 21, 2015
by
Dave Syer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add search=CURRENT to MessageSourceAutoConfiguration
Fixes gh-3803
parent
089cda7a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
MessageSourceAutoConfiguration.java
...rk/boot/autoconfigure/MessageSourceAutoConfiguration.java
+7
-6
No files found.
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/MessageSourceAutoConfiguration.java
View file @
68b55ada
...
@@ -16,7 +16,11 @@
...
@@ -16,7 +16,11 @@
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.autoconfigure.condition.SearchStrategy
;
import
org.springframework.boot.bind.RelaxedPropertyResolver
;
import
org.springframework.boot.bind.RelaxedPropertyResolver
;
import
org.springframework.context.EnvironmentAware
;
import
org.springframework.context.EnvironmentAware
;
import
org.springframework.context.MessageSource
;
import
org.springframework.context.MessageSource
;
...
@@ -28,16 +32,13 @@ import org.springframework.core.annotation.Order;
...
@@ -28,16 +32,13 @@ 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}.
*
*
* @author Dave Syer
* @author Dave Syer
*/
*/
@Configuration
@Configuration
@ConditionalOnMissingBean
(
MessageSource
.
class
)
@ConditionalOnMissingBean
(
value
=
MessageSource
.
class
,
search
=
SearchStrategy
.
CURRENT
)
@Order
(
Ordered
.
HIGHEST_PRECEDENCE
)
@Order
(
Ordered
.
HIGHEST_PRECEDENCE
)
public
class
MessageSourceAutoConfiguration
implements
EnvironmentAware
{
public
class
MessageSourceAutoConfiguration
implements
EnvironmentAware
{
...
@@ -54,7 +55,7 @@ public class MessageSourceAutoConfiguration implements EnvironmentAware {
...
@@ -54,7 +55,7 @@ public class MessageSourceAutoConfiguration implements EnvironmentAware {
String
basename
=
this
.
environment
.
getProperty
(
"basename"
,
"messages"
);
String
basename
=
this
.
environment
.
getProperty
(
"basename"
,
"messages"
);
if
(
StringUtils
.
hasText
(
basename
))
{
if
(
StringUtils
.
hasText
(
basename
))
{
messageSource
messageSource
.
setBasenames
(
commaDelimitedListToStringArray
(
trimAllWhitespace
(
basename
)));
.
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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment