Time to put a stop to Thread.stop?

Remi Forax forax at univ-mlv.fr
Fri May 24 17:27:58 UTC 2013


On 05/24/2013 03:18 PM, Alan Bateman wrote:
>
> 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.

looks good, thumb up.

Rémi




More information about the core-libs-dev mailing list