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
82280e34
Commit
82280e34
authored
Aug 24, 2018
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.0.x'
parents
833e39ee
9e5395f0
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
21 deletions
+21
-21
deployment.adoc
...roject/spring-boot-docs/src/main/asciidoc/deployment.adoc
+1
-1
spring-boot-features.adoc
...ing-boot-docs/src/main/asciidoc/spring-boot-features.adoc
+1
-1
using-spring-boot.adoc
...spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc
+1
-1
EnvironmentConverter.java
...n/java/org/springframework/boot/EnvironmentConverter.java
+2
-4
SpringApplication.java
...main/java/org/springframework/boot/SpringApplication.java
+10
-8
SpringApplicationTests.java
...java/org/springframework/boot/SpringApplicationTests.java
+6
-6
No files found.
spring-boot-project/spring-boot-docs/src/main/asciidoc/deployment.adoc
View file @
82280e34
...
@@ -876,7 +876,7 @@ application.
...
@@ -876,7 +876,7 @@ application.
[[deployment-whats-next]]
[[deployment-whats-next]]
== What to Read Next
== What to Read Next
Check out the https://www.cloudfoundry.
com
/[Cloud Foundry],
Check out the https://www.cloudfoundry.
org
/[Cloud Foundry],
https://www.heroku.com/[Heroku], https://www.openshift.com[OpenShift], and
https://www.heroku.com/[Heroku], https://www.openshift.com[OpenShift], and
https://boxfuse.com[Boxfuse] web sites for more information about the kinds of features
https://boxfuse.com[Boxfuse] web sites for more information about the kinds of features
that a PaaS can offer. These are just four of the most popular Java PaaS providers. Since
that a PaaS can offer. These are just four of the most popular Java PaaS providers. Since
...
...
spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
View file @
82280e34
...
@@ -2055,7 +2055,7 @@ converters. You can also override default converters in the same way.
...
@@ -2055,7 +2055,7 @@ converters. You can also override default converters in the same way.
==== Custom JSON Serializers and Deserializers
==== Custom JSON Serializers and Deserializers
If you use Jackson to serialize and deserialize JSON data, you might want to write your
If you use Jackson to serialize and deserialize JSON data, you might want to write your
own `JsonSerializer` and `JsonDeserializer` classes. Custom serializers are usually
own `JsonSerializer` and `JsonDeserializer` classes. Custom serializers are usually
http
://wiki.fasterxml.com/JacksonHowToCustomDes
erializers[registered with Jackson through
http
s://github.com/FasterXML/jackson-docs/wiki/JacksonHowToCustomS
erializers[registered with Jackson through
a module], but Spring Boot provides an alternative `@JsonComponent` annotation that makes
a module], but Spring Boot provides an alternative `@JsonComponent` annotation that makes
it easier to directly register Spring Beans.
it easier to directly register Spring Beans.
...
...
spring-boot-project/spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc
View file @
82280e34
...
@@ -989,7 +989,7 @@ authors.
...
@@ -989,7 +989,7 @@ authors.
The `spring-boot-devtools` module includes an embedded LiveReload server that can be used
The `spring-boot-devtools` module includes an embedded LiveReload server that can be used
to trigger a browser refresh when a resource is changed. LiveReload browser extensions
to trigger a browser refresh when a resource is changed. LiveReload browser extensions
are freely available for Chrome, Firefox and Safari from
are freely available for Chrome, Firefox and Safari from
http
s
://livereload.com/extensions/[livereload.com].
http://livereload.com/extensions/[livereload.com].
If you do not want to start the LiveReload server when your application runs, you can set
If you do not want to start the LiveReload server when your application runs, you can set
the `spring.devtools.livereload.enabled` property to `false`.
the `spring.devtools.livereload.enabled` property to `false`.
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/EnvironmentConverter.java
View file @
82280e34
...
@@ -125,10 +125,8 @@ final class EnvironmentConverter {
...
@@ -125,10 +125,8 @@ final class EnvironmentConverter {
names
.
add
(
propertySource
.
getName
());
names
.
add
(
propertySource
.
getName
());
}
}
for
(
String
name
:
names
)
{
for
(
String
name
:
names
)
{
if
(!
isServletEnvironment
)
{
if
(!
isServletEnvironment
propertySources
.
remove
(
name
);
||
!
SERVLET_ENVIRONMENT_SOURCE_NAMES
.
contains
(
name
))
{
}
else
if
(!
SERVLET_ENVIRONMENT_SOURCE_NAMES
.
contains
(
name
))
{
propertySources
.
remove
(
name
);
propertySources
.
remove
(
name
);
}
}
}
}
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java
View file @
82280e34
...
@@ -376,13 +376,14 @@ public class SpringApplication {
...
@@ -376,13 +376,14 @@ public class SpringApplication {
}
}
private
Class
<?
extends
StandardEnvironment
>
deduceEnvironmentClass
()
{
private
Class
<?
extends
StandardEnvironment
>
deduceEnvironmentClass
()
{
if
(
this
.
webApplicationType
==
WebApplicationType
.
SERVLET
)
{
switch
(
this
.
webApplicationType
)
{
case
SERVLET:
return
StandardServletEnvironment
.
class
;
return
StandardServletEnvironment
.
class
;
}
case
REACTIVE:
if
(
this
.
webApplicationType
==
WebApplicationType
.
REACTIVE
)
{
return
StandardReactiveWebEnvironment
.
class
;
return
StandardReactiveWebEnvironment
.
class
;
default
:
return
StandardEnvironment
.
class
;
}
}
return
StandardEnvironment
.
class
;
}
}
private
void
prepareContext
(
ConfigurableApplicationContext
context
,
private
void
prepareContext
(
ConfigurableApplicationContext
context
,
...
@@ -479,13 +480,14 @@ public class SpringApplication {
...
@@ -479,13 +480,14 @@ public class SpringApplication {
if
(
this
.
environment
!=
null
)
{
if
(
this
.
environment
!=
null
)
{
return
this
.
environment
;
return
this
.
environment
;
}
}
if
(
this
.
webApplicationType
==
WebApplicationType
.
SERVLET
)
{
switch
(
this
.
webApplicationType
)
{
case
SERVLET:
return
new
StandardServletEnvironment
();
return
new
StandardServletEnvironment
();
}
case
REACTIVE:
if
(
this
.
webApplicationType
==
WebApplicationType
.
REACTIVE
)
{
return
new
StandardReactiveWebEnvironment
();
return
new
StandardReactiveWebEnvironment
();
default
:
return
new
StandardEnvironment
();
}
}
return
new
StandardEnvironment
();
}
}
/**
/**
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java
View file @
82280e34
...
@@ -1124,9 +1124,9 @@ public class SpringApplicationTests {
...
@@ -1124,9 +1124,9 @@ public class SpringApplicationTests {
public
void
webApplicationConfiguredViaAPropertyHasTheCorrectTypeOfContextAndEnvironment
()
{
public
void
webApplicationConfiguredViaAPropertyHasTheCorrectTypeOfContextAndEnvironment
()
{
ConfigurableApplicationContext
context
=
new
SpringApplication
(
ConfigurableApplicationContext
context
=
new
SpringApplication
(
ExampleWebConfig
.
class
).
run
(
"--spring.main.web-application-type=servlet"
);
ExampleWebConfig
.
class
).
run
(
"--spring.main.web-application-type=servlet"
);
assertThat
(
context
).
isInstanceOf
Any
(
WebApplicationContext
.
class
);
assertThat
(
context
).
isInstanceOf
(
WebApplicationContext
.
class
);
assertThat
(
context
.
getEnvironment
())
assertThat
(
context
.
getEnvironment
())
.
isInstanceOf
Any
(
StandardServletEnvironment
.
class
);
.
isInstanceOf
(
StandardServletEnvironment
.
class
);
}
}
@Test
@Test
...
@@ -1134,9 +1134,9 @@ public class SpringApplicationTests {
...
@@ -1134,9 +1134,9 @@ public class SpringApplicationTests {
ConfigurableApplicationContext
context
=
new
SpringApplication
(
ConfigurableApplicationContext
context
=
new
SpringApplication
(
ExampleReactiveWebConfig
.
class
)
ExampleReactiveWebConfig
.
class
)
.
run
(
"--spring.main.web-application-type=reactive"
);
.
run
(
"--spring.main.web-application-type=reactive"
);
assertThat
(
context
).
isInstanceOf
Any
(
ReactiveWebApplicationContext
.
class
);
assertThat
(
context
).
isInstanceOf
(
ReactiveWebApplicationContext
.
class
);
assertThat
(
context
.
getEnvironment
())
assertThat
(
context
.
getEnvironment
())
.
isInstanceOf
Any
(
StandardReactiveWebEnvironment
.
class
);
.
isInstanceOf
(
StandardReactiveWebEnvironment
.
class
);
}
}
@Test
@Test
...
@@ -1144,9 +1144,9 @@ public class SpringApplicationTests {
...
@@ -1144,9 +1144,9 @@ public class SpringApplicationTests {
ConfigurableApplicationContext
context
=
new
SpringApplication
(
ConfigurableApplicationContext
context
=
new
SpringApplication
(
ExampleReactiveWebConfig
.
class
)
ExampleReactiveWebConfig
.
class
)
.
run
(
"--spring.profiles.active=withwebapplicationtype"
);
.
run
(
"--spring.profiles.active=withwebapplicationtype"
);
assertThat
(
context
).
isInstanceOf
Any
(
ReactiveWebApplicationContext
.
class
);
assertThat
(
context
).
isInstanceOf
(
ReactiveWebApplicationContext
.
class
);
assertThat
(
context
.
getEnvironment
())
assertThat
(
context
.
getEnvironment
())
.
isInstanceOf
Any
(
StandardReactiveWebEnvironment
.
class
);
.
isInstanceOf
(
StandardReactiveWebEnvironment
.
class
);
}
}
@Test
@Test
...
...
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