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
a4da3e97
Commit
a4da3e97
authored
Aug 27, 2014
by
Dave Syer
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '1.1.x'
parents
d16ae2af
1ddcf365
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletion
+22
-1
PropertySourcesPropertyValues.java
...ingframework/boot/bind/PropertySourcesPropertyValues.java
+7
-1
PropertySourcesPropertyValuesTests.java
...amework/boot/bind/PropertySourcesPropertyValuesTests.java
+15
-0
No files found.
spring-boot/src/main/java/org/springframework/boot/bind/PropertySourcesPropertyValues.java
View file @
a4da3e97
...
@@ -152,7 +152,13 @@ public class PropertySourcesPropertyValues implements PropertyValues {
...
@@ -152,7 +152,13 @@ public class PropertySourcesPropertyValues implements PropertyValues {
private
void
processDefaultPropertySource
(
PropertySource
<?>
source
,
private
void
processDefaultPropertySource
(
PropertySource
<?>
source
,
PropertySourcesPropertyResolver
resolver
,
String
[]
includes
,
String
[]
exacts
)
{
PropertySourcesPropertyResolver
resolver
,
String
[]
includes
,
String
[]
exacts
)
{
for
(
String
propertyName
:
exacts
)
{
for
(
String
propertyName
:
exacts
)
{
Object
value
=
resolver
.
getProperty
(
propertyName
);
Object
value
=
null
;
try
{
value
=
resolver
.
getProperty
(
propertyName
,
Object
.
class
);
}
catch
(
RuntimeException
ex
)
{
// Probably could not convert to Object, weird, but ignoreable
}
if
(
value
==
null
)
{
if
(
value
==
null
)
{
value
=
source
.
getProperty
(
propertyName
.
toUpperCase
());
value
=
source
.
getProperty
(
propertyName
.
toUpperCase
());
}
}
...
...
spring-boot/src/test/java/org/springframework/boot/bind/PropertySourcesPropertyValuesTests.java
View file @
a4da3e97
...
@@ -138,6 +138,21 @@ public class PropertySourcesPropertyValuesTests {
...
@@ -138,6 +138,21 @@ public class PropertySourcesPropertyValuesTests {
assertEquals
(
"bar"
,
target
.
getName
());
assertEquals
(
"bar"
,
target
.
getName
());
}
}
@Test
public
void
testPlaceholdersErrorInNonEnumerable
()
{
TestBean
target
=
new
TestBean
();
DataBinder
binder
=
new
DataBinder
(
target
);
this
.
propertySources
.
addFirst
(
new
PropertySource
<
Object
>(
"application"
,
"STUFF"
)
{
@Override
public
Object
getProperty
(
String
name
)
{
return
new
Object
();
}
});
binder
.
bind
(
new
PropertySourcesPropertyValues
(
this
.
propertySources
,
null
,
Collections
.
singleton
(
"name"
)));
assertEquals
(
null
,
target
.
getName
());
}
public
static
class
TestBean
{
public
static
class
TestBean
{
private
String
name
;
private
String
name
;
...
...
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