RFR: 8368226: Remove Thread.stop
Alan Bateman
alanb at openjdk.org
Mon Sep 22 12:09:05 UTC 2025
On Mon, 22 Sep 2025 11:31:10 GMT, Mikhail Yankelevich <myankelevich at openjdk.org> wrote:
>> 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.
>
> test/jdk/sun/security/krb5/auto/KDC.java line 1651:
>
>> 1649: thread1.interrupt();
>> 1650: thread2.interrupt();
>> 1651: thread3.interrupt();
>
> I don't this won't work in this test. The full change in in the pr here https://github.com/openjdk/jdk/pull/26247.
>
> There should be no conflict as far as I can see, so just noting it here
I created JDK-8360979 a few months ago to get KDC fixed. The above is, as I said, temporary and would be good to get JDK-8360979 reviewed/integrated before this. removal. Right now, the successful execution of the Kerberos and DTLS tests do no rely on this, the cleanup has been throwing UOE for several years and has not been noticed.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27419#discussion_r2367993000
More information about the security-dev
mailing list