Skip to content

Commit 9e5395f

Browse files
committed
Merge pull request #14184 from izeye:polish-20180823-2nd
* pr/14184: Polish
2 parents be00c1d + fb71174 commit 9e5395f

File tree

6 files changed

+21
-21
lines changed

6 files changed

+21
-21
lines changed

spring-boot-project/spring-boot-docs/src/main/asciidoc/deployment.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,7 @@ application.
847847

848848
[[deployment-whats-next]]
849849
== What to Read Next
850-
Check out the https://www.cloudfoundry.com/[Cloud Foundry],
850+
Check out the https://www.cloudfoundry.org/[Cloud Foundry],
851851
https://www.heroku.com/[Heroku], https://www.openshift.com[OpenShift], and
852852
https://boxfuse.com[Boxfuse] web sites for more information about the kinds of features
853853
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2000,7 +2000,7 @@ converters. You can also override default converters in the same way.
20002000
==== Custom JSON Serializers and Deserializers
20012001
If you use Jackson to serialize and deserialize JSON data, you might want to write your
20022002
own `JsonSerializer` and `JsonDeserializer` classes. Custom serializers are usually
2003-
http://wiki.fasterxml.com/JacksonHowToCustomDeserializers[registered with Jackson through
2003+
https://github.com/FasterXML/jackson-docs/wiki/JacksonHowToCustomSerializers[registered with Jackson through
20042004
a module], but Spring Boot provides an alternative `@JsonComponent` annotation that makes
20052005
it easier to directly register Spring Beans.
20062006

spring-boot-project/spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,7 @@ authors.
982982
The `spring-boot-devtools` module includes an embedded LiveReload server that can be used
983983
to trigger a browser refresh when a resource is changed. LiveReload browser extensions
984984
are freely available for Chrome, Firefox and Safari from
985-
https://livereload.com/extensions/[livereload.com].
985+
http://livereload.com/extensions/[livereload.com].
986986

987987
If you do not want to start the LiveReload server when your application runs, you can set
988988
the `spring.devtools.livereload.enabled` property to `false`.

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/EnvironmentConverter.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,8 @@ private void removePropertySources(MutablePropertySources propertySources,
125125
names.add(propertySource.getName());
126126
}
127127
for (String name : names) {
128-
if (!isServletEnvironment) {
129-
propertySources.remove(name);
130-
}
131-
else if (!SERVLET_ENVIRONMENT_SOURCE_NAMES.contains(name)) {
128+
if (!isServletEnvironment
129+
|| !SERVLET_ENVIRONMENT_SOURCE_NAMES.contains(name)) {
132130
propertySources.remove(name);
133131
}
134132
}

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -372,13 +372,14 @@ private ConfigurableEnvironment prepareEnvironment(
372372
}
373373

374374
private Class<? extends StandardEnvironment> deduceEnvironmentClass() {
375-
if (this.webApplicationType == WebApplicationType.SERVLET) {
375+
switch (this.webApplicationType) {
376+
case SERVLET:
376377
return StandardServletEnvironment.class;
377-
}
378-
if (this.webApplicationType == WebApplicationType.REACTIVE) {
378+
case REACTIVE:
379379
return StandardReactiveWebEnvironment.class;
380+
default:
381+
return StandardEnvironment.class;
380382
}
381-
return StandardEnvironment.class;
382383
}
383384

384385
private void prepareContext(ConfigurableApplicationContext context,
@@ -472,13 +473,14 @@ private ConfigurableEnvironment getOrCreateEnvironment() {
472473
if (this.environment != null) {
473474
return this.environment;
474475
}
475-
if (this.webApplicationType == WebApplicationType.SERVLET) {
476+
switch (this.webApplicationType) {
477+
case SERVLET:
476478
return new StandardServletEnvironment();
477-
}
478-
if (this.webApplicationType == WebApplicationType.REACTIVE) {
479+
case REACTIVE:
479480
return new StandardReactiveWebEnvironment();
481+
default:
482+
return new StandardEnvironment();
480483
}
481-
return new StandardEnvironment();
482484
}
483485

484486
/**

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,29 +1122,29 @@ public void nonWebApplicationConfiguredViaAPropertyHasTheCorrectTypeOfContextAnd
11221122
public void webApplicationConfiguredViaAPropertyHasTheCorrectTypeOfContextAndEnvironment() {
11231123
ConfigurableApplicationContext context = new SpringApplication(
11241124
ExampleWebConfig.class).run("--spring.main.web-application-type=servlet");
1125-
assertThat(context).isInstanceOfAny(WebApplicationContext.class);
1125+
assertThat(context).isInstanceOf(WebApplicationContext.class);
11261126
assertThat(context.getEnvironment())
1127-
.isInstanceOfAny(StandardServletEnvironment.class);
1127+
.isInstanceOf(StandardServletEnvironment.class);
11281128
}
11291129

11301130
@Test
11311131
public void reactiveApplicationConfiguredViaAPropertyHasTheCorrectTypeOfContextAndEnvironment() {
11321132
ConfigurableApplicationContext context = new SpringApplication(
11331133
ExampleReactiveWebConfig.class)
11341134
.run("--spring.main.web-application-type=reactive");
1135-
assertThat(context).isInstanceOfAny(ReactiveWebApplicationContext.class);
1135+
assertThat(context).isInstanceOf(ReactiveWebApplicationContext.class);
11361136
assertThat(context.getEnvironment())
1137-
.isInstanceOfAny(StandardReactiveWebEnvironment.class);
1137+
.isInstanceOf(StandardReactiveWebEnvironment.class);
11381138
}
11391139

11401140
@Test
11411141
public void environmentIsConvertedIfTypeDoesNotMatch() {
11421142
ConfigurableApplicationContext context = new SpringApplication(
11431143
ExampleReactiveWebConfig.class)
11441144
.run("--spring.profiles.active=withwebapplicationtype");
1145-
assertThat(context).isInstanceOfAny(ReactiveWebApplicationContext.class);
1145+
assertThat(context).isInstanceOf(ReactiveWebApplicationContext.class);
11461146
assertThat(context.getEnvironment())
1147-
.isInstanceOfAny(StandardReactiveWebEnvironment.class);
1147+
.isInstanceOf(StandardReactiveWebEnvironment.class);
11481148
}
11491149

11501150
@Test

0 commit comments

Comments
 (0)