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
fc0cee5e
Commit
fc0cee5e
authored
Aug 17, 2019
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.1.x'
parents
326f6895
47c3b1d0
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
13 additions
and
15 deletions
+13
-15
PropertySourcesPlaceholdersResolver.java
.../properties/bind/PropertySourcesPlaceholdersResolver.java
+1
-1
SpringApplicationJsonEnvironmentPostProcessor.java
...ot/env/SpringApplicationJsonEnvironmentPostProcessor.java
+1
-1
Origin.java
...src/main/java/org/springframework/boot/origin/Origin.java
+2
-2
ApplicationPid.java
.../java/org/springframework/boot/system/ApplicationPid.java
+1
-1
DefaultErrorAttributes.java
...mework/boot/web/servlet/error/DefaultErrorAttributes.java
+1
-1
SpringApplicationBuilderTests.java
...framework/boot/builder/SpringApplicationBuilderTests.java
+1
-1
ConfigFileApplicationListenerTests.java
...ot/context/config/ConfigFileApplicationListenerTests.java
+3
-3
ConfigurationPropertyNameTests.java
...ext/properties/source/ConfigurationPropertyNameTests.java
+1
-1
AbstractServletWebServerFactoryTests.java
.../servlet/server/AbstractServletWebServerFactoryTests.java
+2
-4
No files found.
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/PropertySourcesPlaceholdersResolver.java
View file @
fc0cee5e
...
@@ -53,7 +53,7 @@ public class PropertySourcesPlaceholdersResolver implements PlaceholdersResolver
...
@@ -53,7 +53,7 @@ public class PropertySourcesPlaceholdersResolver implements PlaceholdersResolver
@Override
@Override
public
Object
resolvePlaceholders
(
Object
value
)
{
public
Object
resolvePlaceholders
(
Object
value
)
{
if
(
value
!=
null
&&
value
instanceof
String
)
{
if
(
value
instanceof
String
)
{
return
this
.
helper
.
replacePlaceholders
((
String
)
value
,
this
::
resolvePlaceholder
);
return
this
.
helper
.
replacePlaceholders
((
String
)
value
,
this
::
resolvePlaceholder
);
}
}
return
value
;
return
value
;
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/env/SpringApplicationJsonEnvironmentPostProcessor.java
View file @
fc0cee5e
...
@@ -204,7 +204,7 @@ public class SpringApplicationJsonEnvironmentPostProcessor implements Environmen
...
@@ -204,7 +204,7 @@ public class SpringApplicationJsonEnvironmentPostProcessor implements Environmen
static
JsonPropertyValue
get
(
PropertySource
<?>
propertySource
)
{
static
JsonPropertyValue
get
(
PropertySource
<?>
propertySource
)
{
for
(
String
candidate
:
CANDIDATES
)
{
for
(
String
candidate
:
CANDIDATES
)
{
Object
value
=
propertySource
.
getProperty
(
candidate
);
Object
value
=
propertySource
.
getProperty
(
candidate
);
if
(
value
!=
null
&&
value
instanceof
String
&&
StringUtils
.
hasLength
((
String
)
value
))
{
if
(
value
instanceof
String
&&
StringUtils
.
hasLength
((
String
)
value
))
{
return
new
JsonPropertyValue
(
propertySource
,
candidate
,
(
String
)
value
);
return
new
JsonPropertyValue
(
propertySource
,
candidate
,
(
String
)
value
);
}
}
}
}
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/origin/Origin.java
View file @
fc0cee5e
...
@@ -44,10 +44,10 @@ public interface Origin {
...
@@ -44,10 +44,10 @@ public interface Origin {
return
(
Origin
)
source
;
return
(
Origin
)
source
;
}
}
Origin
origin
=
null
;
Origin
origin
=
null
;
if
(
source
!=
null
&&
source
instanceof
OriginProvider
)
{
if
(
source
instanceof
OriginProvider
)
{
origin
=
((
OriginProvider
)
source
).
getOrigin
();
origin
=
((
OriginProvider
)
source
).
getOrigin
();
}
}
if
(
origin
==
null
&&
source
!=
null
&&
source
instanceof
Throwable
)
{
if
(
origin
==
null
&&
source
instanceof
Throwable
)
{
return
from
(((
Throwable
)
source
).
getCause
());
return
from
(((
Throwable
)
source
).
getCause
());
}
}
return
origin
;
return
origin
;
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/system/ApplicationPid.java
View file @
fc0cee5e
...
@@ -64,7 +64,7 @@ public class ApplicationPid {
...
@@ -64,7 +64,7 @@ public class ApplicationPid {
if
(
obj
==
this
)
{
if
(
obj
==
this
)
{
return
true
;
return
true
;
}
}
if
(
obj
!=
null
&&
obj
instanceof
ApplicationPid
)
{
if
(
obj
instanceof
ApplicationPid
)
{
return
ObjectUtils
.
nullSafeEquals
(
this
.
pid
,
((
ApplicationPid
)
obj
).
pid
);
return
ObjectUtils
.
nullSafeEquals
(
this
.
pid
,
((
ApplicationPid
)
obj
).
pid
);
}
}
return
false
;
return
false
;
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/error/DefaultErrorAttributes.java
View file @
fc0cee5e
...
@@ -130,7 +130,7 @@ public class DefaultErrorAttributes implements ErrorAttributes, HandlerException
...
@@ -130,7 +130,7 @@ public class DefaultErrorAttributes implements ErrorAttributes, HandlerException
Throwable
error
=
getError
(
webRequest
);
Throwable
error
=
getError
(
webRequest
);
if
(
error
!=
null
)
{
if
(
error
!=
null
)
{
while
(
error
instanceof
ServletException
&&
error
.
getCause
()
!=
null
)
{
while
(
error
instanceof
ServletException
&&
error
.
getCause
()
!=
null
)
{
error
=
((
ServletException
)
error
)
.
getCause
();
error
=
error
.
getCause
();
}
}
if
(
this
.
includeException
)
{
if
(
this
.
includeException
)
{
errorAttributes
.
put
(
"exception"
,
error
.
getClass
().
getName
());
errorAttributes
.
put
(
"exception"
,
error
.
getClass
().
getName
());
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/builder/SpringApplicationBuilderTests.java
View file @
fc0cee5e
...
@@ -155,7 +155,7 @@ class SpringApplicationBuilderTests {
...
@@ -155,7 +155,7 @@ class SpringApplicationBuilderTests {
ClassLoader
classLoader
=
new
URLClassLoader
(
new
URL
[
0
],
getClass
().
getClassLoader
());
ClassLoader
classLoader
=
new
URLClassLoader
(
new
URL
[
0
],
getClass
().
getClassLoader
());
application
.
resourceLoader
(
new
DefaultResourceLoader
(
classLoader
));
application
.
resourceLoader
(
new
DefaultResourceLoader
(
classLoader
));
this
.
context
=
application
.
run
();
this
.
context
=
application
.
run
();
assertThat
(
((
SpyApplicationContext
)
this
.
context
)
.
getClassLoader
()).
isEqualTo
(
classLoader
);
assertThat
(
this
.
context
.
getClassLoader
()).
isEqualTo
(
classLoader
);
}
}
@Test
@Test
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigFileApplicationListenerTests.java
View file @
fc0cee5e
...
@@ -306,8 +306,8 @@ class ConfigFileApplicationListenerTests {
...
@@ -306,8 +306,8 @@ class ConfigFileApplicationListenerTests {
@Test
@Test
void
defaultPropertyAsFallback
()
{
void
defaultPropertyAsFallback
()
{
this
.
environment
.
getPropertySources
()
.
addLast
(
this
.
environment
.
getPropertySources
()
new
MapPropertySource
(
"defaultProperties"
,
Collections
.
singletonMap
(
"my.fallback"
,
(
Object
)
"foo"
)));
.
addLast
(
new
MapPropertySource
(
"defaultProperties"
,
Collections
.
singletonMap
(
"my.fallback"
,
"foo"
)));
this
.
initializer
.
postProcessEnvironment
(
this
.
environment
,
this
.
application
);
this
.
initializer
.
postProcessEnvironment
(
this
.
environment
,
this
.
application
);
String
property
=
this
.
environment
.
getProperty
(
"my.fallback"
);
String
property
=
this
.
environment
.
getProperty
(
"my.fallback"
);
assertThat
(
property
).
isEqualTo
(
"foo"
);
assertThat
(
property
).
isEqualTo
(
"foo"
);
...
@@ -316,7 +316,7 @@ class ConfigFileApplicationListenerTests {
...
@@ -316,7 +316,7 @@ class ConfigFileApplicationListenerTests {
@Test
@Test
void
defaultPropertyAsFallbackDuringFileParsing
()
{
void
defaultPropertyAsFallbackDuringFileParsing
()
{
this
.
environment
.
getPropertySources
().
addLast
(
new
MapPropertySource
(
"defaultProperties"
,
this
.
environment
.
getPropertySources
().
addLast
(
new
MapPropertySource
(
"defaultProperties"
,
Collections
.
singletonMap
(
"spring.config.name"
,
(
Object
)
"testproperties"
)));
Collections
.
singletonMap
(
"spring.config.name"
,
"testproperties"
)));
this
.
initializer
.
postProcessEnvironment
(
this
.
environment
,
this
.
application
);
this
.
initializer
.
postProcessEnvironment
(
this
.
environment
,
this
.
application
);
String
property
=
this
.
environment
.
getProperty
(
"the.property"
);
String
property
=
this
.
environment
.
getProperty
(
"the.property"
);
assertThat
(
property
).
isEqualTo
(
"frompropertiesfile"
);
assertThat
(
property
).
isEqualTo
(
"frompropertiesfile"
);
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/source/ConfigurationPropertyNameTests.java
View file @
fc0cee5e
...
@@ -410,7 +410,7 @@ class ConfigurationPropertyNameTests {
...
@@ -410,7 +410,7 @@ class ConfigurationPropertyNameTests {
@Test
@Test
void
appendWhenElementNameIsNullShouldReturnName
()
{
void
appendWhenElementNameIsNullShouldReturnName
()
{
ConfigurationPropertyName
name
=
ConfigurationPropertyName
.
of
(
"foo"
);
ConfigurationPropertyName
name
=
ConfigurationPropertyName
.
of
(
"foo"
);
assertThat
((
Object
)
name
.
append
(
(
String
)
null
)).
isSameAs
(
name
);
assertThat
((
Object
)
name
.
append
(
null
)).
isSameAs
(
name
);
}
}
@Test
@Test
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java
View file @
fc0cee5e
...
@@ -767,8 +767,7 @@ public abstract class AbstractServletWebServerFactoryTests {
...
@@ -767,8 +767,7 @@ public abstract class AbstractServletWebServerFactoryTests {
this
.
webServer
=
factory
.
getWebServer
(
new
ServletRegistrationBean
<>(
new
ExampleServlet
(
false
,
true
),
"/hello"
));
this
.
webServer
=
factory
.
getWebServer
(
new
ServletRegistrationBean
<>(
new
ExampleServlet
(
false
,
true
),
"/hello"
));
this
.
webServer
.
start
();
this
.
webServer
.
start
();
TestGzipInputStreamFactory
inputStreamFactory
=
new
TestGzipInputStreamFactory
();
TestGzipInputStreamFactory
inputStreamFactory
=
new
TestGzipInputStreamFactory
();
Map
<
String
,
InputStreamFactory
>
contentDecoderMap
=
Collections
.
singletonMap
(
"gzip"
,
Map
<
String
,
InputStreamFactory
>
contentDecoderMap
=
Collections
.
singletonMap
(
"gzip"
,
inputStreamFactory
);
(
InputStreamFactory
)
inputStreamFactory
);
getResponse
(
getLocalUrl
(
"/hello"
),
new
HttpComponentsClientHttpRequestFactory
(
getResponse
(
getLocalUrl
(
"/hello"
),
new
HttpComponentsClientHttpRequestFactory
(
HttpClientBuilder
.
create
().
setContentDecoderRegistry
(
contentDecoderMap
).
build
()));
HttpClientBuilder
.
create
().
setContentDecoderRegistry
(
contentDecoderMap
).
build
()));
assertThat
(
inputStreamFactory
.
wasCompressionUsed
()).
isTrue
();
assertThat
(
inputStreamFactory
.
wasCompressionUsed
()).
isTrue
();
...
@@ -975,8 +974,7 @@ public abstract class AbstractServletWebServerFactoryTests {
...
@@ -975,8 +974,7 @@ public abstract class AbstractServletWebServerFactoryTests {
HttpMethod
method
)
throws
Exception
{
HttpMethod
method
)
throws
Exception
{
String
testContent
=
setUpFactoryForCompression
(
contentSize
,
mimeTypes
,
excludedUserAgents
);
String
testContent
=
setUpFactoryForCompression
(
contentSize
,
mimeTypes
,
excludedUserAgents
);
TestGzipInputStreamFactory
inputStreamFactory
=
new
TestGzipInputStreamFactory
();
TestGzipInputStreamFactory
inputStreamFactory
=
new
TestGzipInputStreamFactory
();
Map
<
String
,
InputStreamFactory
>
contentDecoderMap
=
Collections
.
singletonMap
(
"gzip"
,
Map
<
String
,
InputStreamFactory
>
contentDecoderMap
=
Collections
.
singletonMap
(
"gzip"
,
inputStreamFactory
);
(
InputStreamFactory
)
inputStreamFactory
);
String
response
=
getResponse
(
getLocalUrl
(
"/test.txt"
),
method
,
String
response
=
getResponse
(
getLocalUrl
(
"/test.txt"
),
method
,
new
HttpComponentsClientHttpRequestFactory
(
HttpClientBuilder
.
create
().
setUserAgent
(
"testUserAgent"
)
new
HttpComponentsClientHttpRequestFactory
(
HttpClientBuilder
.
create
().
setUserAgent
(
"testUserAgent"
)
.
setContentDecoderRegistry
(
contentDecoderMap
).
build
()));
.
setContentDecoderRegistry
(
contentDecoderMap
).
build
()));
...
...
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