From 35e15d01f535dcaebe4bad86fd1042a371d955a1 Mon Sep 17 00:00:00 2001 From: Peter Shipton Date: Wed, 16 Nov 2022 22:01:36 -0500 Subject: [PATCH] Remove mention of ThreadDeath, which is unused and deprecated in jdk20 From jdk20 Thread.stop() throws UnsupportedOperationException. Related to https://github.com/eclipse-openj9/openj9/issues/16213 Signed-off-by: Peter Shipton --- .../java.base/share/classes/java/lang/J9VMInternals.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/jcl/src/java.base/share/classes/java/lang/J9VMInternals.java b/jcl/src/java.base/share/classes/java/lang/J9VMInternals.java index edc1957fd52..fc7e8e23028 100644 --- a/jcl/src/java.base/share/classes/java/lang/J9VMInternals.java +++ b/jcl/src/java.base/share/classes/java/lang/J9VMInternals.java @@ -338,7 +338,11 @@ private static Throwable copyThrowable(Throwable throwable, HashMap hashMapThrow } /** - * Private method to be called by the VM after a Threads dies and throws ThreadDeath +/*[IF JAVA_SPEC_VERSION < 20] + * Private method to be called by the VM after a Threads dies and throws ThreadDeath. +/*[ELSE] + * Private method to be called by the VM after a Threads dies. +/*[ENDIF] * It has to notifyAll() so that join can work properly. * However, it has to be done when the Thread is "thought of" as being dead by other * observer Threads (isAlive() has to return false for the Thread @@ -641,7 +645,6 @@ public static String formatNoSuchMethod(String methodSig, Class clazz1, Strin "{0} (loaded from {1} by {2}) called from {3} (loaded from {4} by {5}).", //$NON-NLS-1$ args); } catch (Exception | VirtualMachineError e) { - // don't catch ThreadDeath if ((null == callingClassInfo) || (null == calledClassInfo)) { return methodSig; } @@ -650,7 +653,6 @@ public static String formatNoSuchMethod(String methodSig, Class clazz1, Strin return methodSig + "(loaded from " + callingClassInfo[0] + " by " + callingClassInfo[1] + ") called from " + clazz2.toString() + " (loaded from " + calledClassInfo[0] + " by " + calledClassInfo[1] + ")"; } catch (Exception | VirtualMachineError e2) { - // don't catch ThreadDeath /* if something fails, fall back to old message */ return methodSig; }