Enable helpful null pointer exceptions (#54853)
Now that JDK 14 is available, and we are bundling it, this commit enables us to run with helpful null pointer exceptions, which will be a great aid in debugging.
This commit is contained in:
parent
22be925f58
commit
f0ed21f5b6
|
@ -55,6 +55,8 @@ final class SystemJvmOptions {
|
||||||
* debugging.
|
* debugging.
|
||||||
*/
|
*/
|
||||||
"-XX:-OmitStackTraceInFastThrow",
|
"-XX:-OmitStackTraceInFastThrow",
|
||||||
|
// enable helpful NullPointerExceptions (https://openjdk.java.net/jeps/358), if they are supported
|
||||||
|
maybeShowCodeDetailsInExceptionMessages(),
|
||||||
// flags to configure Netty
|
// flags to configure Netty
|
||||||
"-Dio.netty.noUnsafe=true",
|
"-Dio.netty.noUnsafe=true",
|
||||||
"-Dio.netty.noKeySetOptimization=true",
|
"-Dio.netty.noKeySetOptimization=true",
|
||||||
|
@ -69,6 +71,14 @@ final class SystemJvmOptions {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static String maybeShowCodeDetailsInExceptionMessages() {
|
||||||
|
if (JavaVersion.majorVersion(JavaVersion.CURRENT) >= 14) {
|
||||||
|
return "-XX:+ShowCodeDetailsInExceptionMessages";
|
||||||
|
} else {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static String javaLocaleProviders() {
|
private static String javaLocaleProviders() {
|
||||||
/**
|
/**
|
||||||
* SPI setting is used to allow loading custom CalendarDataProvider
|
* SPI setting is used to allow loading custom CalendarDataProvider
|
||||||
|
|
Loading…
Reference in New Issue