Skip to content

Commit b48e31d

Browse files
committed
Polish
1 parent 4895b15 commit b48e31d

File tree

2 files changed

+22
-25
lines changed

2 files changed

+22
-25
lines changed

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,6 @@ private Class<?> deduceMainApplicationClass() {
263263
* @return a running {@link ApplicationContext}
264264
*/
265265
public ConfigurableApplicationContext run(String... args) {
266-
267266
StopWatch stopWatch = new StopWatch();
268267
stopWatch.start();
269268
ConfigurableApplicationContext context = null;
@@ -481,12 +480,10 @@ protected void printBanner(Environment environment) {
481480
this.mainApplicationClass, System.out);
482481
return;
483482
}
484-
485483
if (this.banner != null) {
486484
this.banner.printBanner(environment, this.mainApplicationClass, System.out);
487485
return;
488486
}
489-
490487
printBanner();
491488
}
492489

spring-boot/src/main/java/org/springframework/boot/context/embedded/undertow/UndertowEmbeddedServletContainer.java

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2014 the original author or authors.
2+
* Copyright 2012-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -49,10 +49,10 @@ public class UndertowEmbeddedServletContainer implements EmbeddedServletContaine
4949
private static final Log logger = LogFactory
5050
.getLog(UndertowEmbeddedServletContainer.class);
5151

52-
private final DeploymentManager manager;
53-
5452
private final Builder builder;
5553

54+
private final DeploymentManager manager;
55+
5656
private final String contextPath;
5757

5858
private final int port;
@@ -86,6 +86,25 @@ public synchronized void start() throws EmbeddedServletContainerException {
8686
+ getPortsDescription());
8787
}
8888

89+
private Undertow createUndertowServer() {
90+
try {
91+
HttpHandler servletHandler = this.manager.start();
92+
this.builder.setHandler(getContextHandler(servletHandler));
93+
return this.builder.build();
94+
}
95+
catch (ServletException ex) {
96+
throw new EmbeddedServletContainerException(
97+
"Unable to start embdedded Undertow", ex);
98+
}
99+
}
100+
101+
private HttpHandler getContextHandler(HttpHandler servletHandler) {
102+
if (StringUtils.isEmpty(this.contextPath)) {
103+
return servletHandler;
104+
}
105+
return Handlers.path().addPrefixPath(this.contextPath, servletHandler);
106+
}
107+
89108
@SuppressWarnings("rawtypes")
90109
private String getPortsDescription() {
91110
try {
@@ -111,25 +130,6 @@ private String getPortsDescription() {
111130
return String.valueOf(this.port);
112131
}
113132

114-
private Undertow createUndertowServer() {
115-
try {
116-
HttpHandler servletHandler = this.manager.start();
117-
this.builder.setHandler(getContextHandler(servletHandler));
118-
return this.builder.build();
119-
}
120-
catch (ServletException ex) {
121-
throw new EmbeddedServletContainerException(
122-
"Unable to start embdedded Undertow", ex);
123-
}
124-
}
125-
126-
private HttpHandler getContextHandler(HttpHandler servletHandler) {
127-
if (StringUtils.isEmpty(this.contextPath)) {
128-
return servletHandler;
129-
}
130-
return Handlers.path().addPrefixPath(this.contextPath, servletHandler);
131-
}
132-
133133
@Override
134134
public synchronized void stop() throws EmbeddedServletContainerException {
135135
if (this.started) {

0 commit comments

Comments
 (0)