# HG changeset patch # User chegar # Date 1282570522 -3600 # Node ID 6d91c1ceac26a8b942f07b6f79931992696c725c # Parent a02eddc607b7474abb359ca32023e8f9ec73f83c 6968584: Thread should not be Cloneable Reviewed-by: dholmes diff -r a02eddc607b7 -r 6d91c1ceac26 jdk/src/share/classes/java/lang/Thread.java --- a/jdk/src/share/classes/java/lang/Thread.java Fri Aug 20 08:49:48 2010 -0700 +++ b/jdk/src/share/classes/java/lang/Thread.java Mon Aug 23 14:35:22 2010 +0100 @@ -414,6 +414,18 @@ } /** + * Throws CloneNotSupportedException as a Thread can not be meaningfully + * cloned. Construct a new Thread instead. + * + * @throws CloneNotSupportedException + * always + */ + @Override + protected Object clone() throws CloneNotSupportedException { + throw new CloneNotSupportedException(); + } + + /** * Allocates a new {@code Thread} object. This constructor has the same * effect as {@linkplain #Thread(ThreadGroup,Runnable,String) Thread} * {@code (null, null, gname)}, where {@code gname} is a newly generated