6968584: Thread should not be Cloneable
Reviewed-by: dholmes
diff --git a/src/share/classes/java/lang/Thread.java b/src/share/classes/java/lang/Thread.java
index c379ec5..c3592cf 100644
--- a/src/share/classes/java/lang/Thread.java
+++ b/src/share/classes/java/lang/Thread.java
@@ -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