Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4313584

invalid implementation of javax.text.rtf.StyledEditorKit.clone()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.2.2
    • 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)
      ======================================================================

            tprinzing Tim Prinzing (Inactive)
            kryansunw Kevin Ryan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: