Uploaded image for project: 'UIMA'
  1. UIMA
  2. UIMA-149

Cloning may fail for subclasses of ResultSpecification

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 2.1
    • None
    • None

    Description

      Findbugs found this problem, and says: clone method does not call super.clone()

      This non-final class defines a clone() method that does not call super.clone(). If this class ("A") is extended by a subclass ("B"), and the subclass B calls super.clone(), then it is likely that B's clone() method will return an object of type A, which violates the standard contract for clone().

      If all clone() methods call super.clone(), then they are guaranteed to use Object.clone(), which always returns an object of the correct type.

      Solution could be to mark this class "final" if we don't want users to extend it.

      Attachments

        Activity

          People

            alally Adam P. Lally
            schor Marshall Schor
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: