-
Bug
-
Resolution: Fixed
-
P4
-
1.2.2
-
merlin
-
generic
-
generic
Name: krT82822 Date: 02/17/2000
java version "1.2.2"
HotSpot VM (1.0.1, mixed mode, build g)
The clone()-Method of class StyledEditorKit (package javax.swing.text.rtf) is
not implemented correctly:
public Object clone() {
return new StyledEditorKit();
}
Instead of calling super.clone(), a new instance of StyledEditorKit is created.
As a consequence, no ever [other?] existing subclass of StyledEditorKit can use
super.clone() for cloning the Object because the return type will always be a
"StyledEditorKit". This is problematic, if super.clone() does some important
initialisations on the cloned object.
Instead, the clone()-method should look like:
public Object clone() {
super.clone();
}
(Review ID: 100623)
======================================================================