Re: Thread.dispatchUncaughtException possible NPE?

2022-01-17 Thread Remi Forax
- Original Message - > From: "Andrey Turbanov" > To: "core-libs-dev" > Sent: Monday, January 17, 2022 10:37:04 AM > Subject: Thread.dispatchUncaughtException possible NPE? > Hello. Hello Andrey, > I see that Thread.dispatchUncaughtException calls

Thread.dispatchUncaughtException possible NPE?

2022-01-17 Thread Andrey Turbanov
Hello. I see that Thread.dispatchUncaughtException calls getUncaughtExceptionHandler() which reads volatile field twice: https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/lang/Thread.java#L1978 private volatile UncaughtExceptionHandler uncaughtExceptionHandler; public Un