A DESCRIPTION OF THE REQUEST :
The clone() method in class java.lang.Object should be deprecated, as well as the java.lang.Cloneable interface.
JUSTIFICATION :
Bug http://bugs.java.com/bugdatabase/view_bug.do?bug_id=4220218 was filed back in 1999 during the days of Java 1.2. When it was closed in 2001, the following was entered as the reason:
"I am in complete agreement that CloneNotSupportedException should have been unchecked. Whether it makes sense to change it now is less clear. The clone facility suffers from serious design flaws. It was proposed that these flaws be fixed as part of [Java 1.4], but the proposal was ultimately rejected as too disruptive. At this point, the clone facility is of very limited utility, so it is not clear that it is worth putting band aids on it. The best policy is generally not to use it."
Therefore, this should be deprecated along with the Cloneable interface.
The clone() method in class java.lang.Object should be deprecated, as well as the java.lang.Cloneable interface.
JUSTIFICATION :
Bug http://bugs.java.com/bugdatabase/view_bug.do?bug_id=4220218 was filed back in 1999 during the days of Java 1.2. When it was closed in 2001, the following was entered as the reason:
"I am in complete agreement that CloneNotSupportedException should have been unchecked. Whether it makes sense to change it now is less clear. The clone facility suffers from serious design flaws. It was proposed that these flaws be fixed as part of [Java 1.4], but the proposal was ultimately rejected as too disruptive. At this point, the clone facility is of very limited utility, so it is not clear that it is worth putting band aids on it. The best policy is generally not to use it."
Therefore, this should be deprecated along with the Cloneable interface.
- duplicates
-
JDK-4220218 Please make CloneNotSupportedException unchecked
-
- Closed
-