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

java.lang.Object.clone() spec typos

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.2.0
    • docs
    • sparc
    • solaris_2.5



      Name: ksC84122 Date: 12/29/98


      JavaDoc for java.lang.Object.clone() states ( Object.java 1.47 98/10/01):
      "...The precise meaning of "copy" may depend on the class of the object. The general
      intent is that, for any object x, the expression:
                x.clone() != x
           will be true, and that the expression:
                x.close.getClass() == x.getClass()
           will be true, but these are not absolute requirements. While it is typically the case that:
                x.close.equals(x)
           will be true, this is not an absolute requirement..."

      "x.close.getClass() == x.getClass()" needs to be replaced with "x.clone().getClass() == x.getClass()"
      "x.close.equals(x)" needs to be replaced with "x.clone().equals(x)"

      ======================================================================

            asommere Alan Sommerer (Inactive)
            ksoshals Kirill Soshalskiy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: