Skip to content

Commit

Permalink
Remove mention of ThreadDeath, which is unused and deprecated in jdk20
Browse files Browse the repository at this point in the history
From jdk20 Thread.stop() throws UnsupportedOperationException.

Related to #16213

Signed-off-by: Peter Shipton <Peter_Shipton@ca.ibm.com>
  • Loading branch information
pshipton committed Nov 23, 2022
1 parent e0259a6 commit 35e15d0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions jcl/src/java.base/share/classes/java/lang/J9VMInternals.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 <code>notifyAll()</code> so that <code>join</code> can work properly.
* However, it has to be done when the Thread is "thought of" as being dead by other
* observer Threads (<code>isAlive()</code> has to return false for the Thread
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down

0 comments on commit 35e15d0

Please sign in to comment.