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.
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.
Environment
Operating System: All Platform: All
Affected Versions
[current]