You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 30, 2019. It is now read-only.
Repository navigation
This repository was archived by the owner on Jan 30, 2019. It is now read-only.
Most (all?) clone methods are not properly written. Consider the following
example:
public class MyHTMLIndexerKit extends HTMLIndexerKit {}
(new MyHTMLIndexKit().clone() instanceof MyHTMLIndexerKit) == false
If I override the clone method (correctly by calling super):
public class MyHTMLIndexerKit extends HTMLIndexerKit {
public void clone() throws CloneNotSupportedException {
//causes a ClassCastException
MyHTMLIndexKit clone = null;
try
{ clone = (MyHTMLIndexerKit) super.clone(); }
catch (CloneNotSupportedException neverThrown)
{ //does nothing }
return clone;
}
}
Since clone is not properly implemented by HTMLIndexerKit, I can never properly
implement in a subclass.
So far, of all of the clone methods that I have inspected, none of them are
correctly implemented. They simply are returning a new instance of the class.
Activity
glassfishrobot commentedon Sep 19, 2008
Reported by kschaefe
glassfishrobot commentedon Sep 19, 2008
Was assigned to javahelp-issues
glassfishrobot commentedon Apr 26, 2017
This issue was imported from java.net JIRA JAVAHELP-25