RFR: 8368226: Remove Thread.stop [v3]
Alan Bateman
alanb at openjdk.org
Wed Sep 24 09:49:20 UTC 2025
> The no-arg Thread.stop has been deprecated since JDK 1.2, deprecated for removal since JDK 18, and re-specified to throw UOE unconditionally since JDK 20. It is time to finally remove the method. Its more evil sibling Thread.stop(Throwable) was removed in JDK 11.
>
> Code that uses Thread.stop will no longer compile. Code using this method that was compiled to older releases will throw NoSuchMethodError instead of UnsupportedOperationException.
>
> Most of the tests using Thread.stop have already been fixed in advance of this PR. However, the tests for Kerberos and DTLS use the KDC server as infrastructure and don't compile because it uses Thread.stop and swallows the UOE. This is tracked by JDK-8360979. It is temporarily changed to use Thread.interrupt to avoid excluding many of tests in these areas. If JDK-8360979 is fixed then no change to KDC is needed.
Alan Bateman has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:
- Use {@code .. } for stop method
- Merge branch 'master' into JDK-8368226
- Merge branch 'master' into JDK-8368226
- Update copyright date
- Initial commit
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/27419/files
- new: https://git.openjdk.org/jdk/pull/27419/files/32fddb23..7a2e47fa
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=27419&range=02
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=27419&range=01-02
Stats: 3467 lines in 167 files changed: 1691 ins; 1276 del; 500 mod
Patch: https://git.openjdk.org/jdk/pull/27419.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/27419/head:pull/27419
PR: https://git.openjdk.org/jdk/pull/27419
More information about the security-dev
mailing list