How to Stop a Java Thread Without Using Thread.stop()? (opens in new tab)
Note that since Java 20, Thread.stop() has been neutered: rather than abruptly killing the thread, it now always throws UnsupportedOperationException, and will be eventually removed.…
Read the original article