Time to put a stop to Thread.stop?
Alan Bateman
Alan.Bateman at oracle.com
Fri May 24 13:18:37 UTC 2013
Thanks to everyone for the discussions and suggestions on this topic. I
would like to proceed with the original proposal to change
stop(Throwable) to throw UOE unconditionally. This means so special
casing for ThreadDeath or the current thread. The no-arg Thread.stop()
is not impacted.
I think it's reasonable to say that this method is not widely used.
Mandy did a static analysis of thousands of unique artifacts in maven
and we found only a tiny number of usages. Other corpora were searched
too. A number of people mailed me privately to report sightings, in
almost all cases the usages were completely broken and never worked
(incorrect assumption that Thread.stop would wake-up threads blocked in
I/O in at least two cases).
Clearly this change is significant and will need to documented in
compatibility notes and migration documentation.
The webrev with the proposed changes is here. As I mentioned in one of
the replies, there are 4 j.u.c tests that need to be updated so I've
changed these tests to use Unsafe.throwException.
http://cr.openjdk.java.net/~alanb/7059085/webrev/
-Alan.
More information about the core-libs-dev
mailing list