-
Type:
Bug
-
Resolution: Fixed
-
Priority:
P4
-
Affects Version/s: 1.2.2
-
Component/s: client-libs
-
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)
======================================================================