This commit is contained in:
Phillip Webb 2017-03-16 14:44:22 -07:00
parent 91fe040586
commit 102da8b3c6
3 changed files with 9 additions and 7 deletions

View File

@ -140,8 +140,8 @@ import org.springframework.web.context.support.StandardServletEnvironment;
* Configuration properties are also bound to the {@link SpringApplication}. This makes it
* possible to set {@link SpringApplication} properties dynamically, like the sources
* ("spring.main.sources" - a CSV list) the flag to indicate a web environment
* ("spring.main.web_environment=true") or the flag to switch off the banner
* ("spring.main.show_banner=false").
* ("spring.main.web-application-type=none") or the flag to switch off the banner
* ("spring.main.banner-mode=off").
*
* @author Phillip Webb
* @author Dave Syer
@ -340,7 +340,8 @@ public class SpringApplication {
bindToSpringApplication(environment);
Banner printedBanner = printBanner(environment);
context = createApplicationContext();
exceptionReporters = getSpringFactoriesInstances(SpringBootExceptionReporter.class,
exceptionReporters = getSpringFactoriesInstances(
SpringBootExceptionReporter.class,
new Class[] { ConfigurableApplicationContext.class }, context);
prepareContext(context, environment, listeners, applicationArguments,
printedBanner);
@ -854,7 +855,8 @@ public class SpringApplication {
private void handleRunFailure(ConfigurableApplicationContext context,
SpringApplicationRunListeners listeners,
Collection<SpringBootExceptionReporter> exceptionReporters, Throwable exception) {
Collection<SpringBootExceptionReporter> exceptionReporters,
Throwable exception) {
try {
try {
handleExitCode(context, exception);

View File

@ -59,10 +59,10 @@ public abstract class AbstractFailureAnalyzer<T extends Throwable>
}
@SuppressWarnings("unchecked")
protected final <E extends Throwable> T findCause(Throwable failure, Class<E> type) {
protected final <E extends Throwable> E findCause(Throwable failure, Class<E> type) {
while (failure != null) {
if (type.isInstance(failure)) {
return (T) failure;
return (E) failure;
}
failure = failure.getCause();
}

View File

@ -33,7 +33,7 @@ import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
/**
* Utility that can be used to {@link MutablePropertySources} using
* Utility that can be used update {@link MutablePropertySources} using
* {@link PropertySourceLoader}s.
*
* @author Phillip Webb