spring-boot/spring-boot-tools
Andy Wilkinson 313b6f6451 Simplify exception handling and reporting in the launcher
Following changes to LaunchedURLClassLoader made in 87fe0b2a, it is
no longer necessary for the launcher to load MainMethodRunner via
reflection as both the app class loader that the launcher URL class
loader share the same MainMethodRunner class.

This commit takes advantage of this by updating Launcher to instantiate
MainMethodRunner directly rather than via reflection, removing one
source of possible exceptions in the launcher.

As the MainMethodRunner is now loaded directly and its class is shared
between the two class loaders, there’s no longer a need for it to
implement Runnable. This allows it to throw Exception from its run
method, rather than having to wrap any Exception in a RuntimeException.

Lastly, rather than catching any exception thrown from the launch,
Launcher and its subclasses have been updated to allow this exception
to be thrown from the main method. This allows the Exception to reach
the JVM, to be processed by our registered uncaught exception handler,
and to trigger the JVM’s standard processing for exiting due to a
failure. This removes the need for the Launcher itself to call
System.exit(1) and ensures that the exception is only output to the
console if it hasn’t been registered as a logged exception.

Closes gh-5358
2016-03-31 09:42:11 +01:00
..
spring-boot-antlib Next Development Version 2016-02-26 01:06:16 -08:00
spring-boot-configuration-metadata Merge branch '1.3.x' 2016-03-08 09:51:57 -08:00
spring-boot-configuration-processor Next Development Version 2016-02-26 01:06:16 -08:00
spring-boot-gradle-plugin Rename the default BuildInfo task to bootBuildInfo 2016-03-29 11:35:38 +01:00
spring-boot-loader Simplify exception handling and reporting in the launcher 2016-03-31 09:42:11 +01:00
spring-boot-loader-tools Add a BuildInfo task for generating build.properties with Gradle 2016-03-24 08:59:55 +00:00
spring-boot-maven-plugin Add a BuildInfo task for generating build.properties with Gradle 2016-03-24 08:59:55 +00:00
pom.xml Next Development Version 2016-02-26 01:06:16 -08:00