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

Doc bug in Constructor.newInstance

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.4.0
    • docs
    • beta3
    • generic
    • generic



      Name: bsC130419 Date: 07/12/2001


      java version "1.4.0-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b65)
      Java HotSpot(TM) Client VM (build 1.4.0-beta-b65, mixed mode)

      The documentation for java.lang.reflect.Constructor.newInstance is flawed:

      "...A new instance of the constructor's declaring class is created, and its
      fields are initialized to their default initial values.

      For each actual parameter in the supplied initargs array:
      ...
      The constructor's declaring class is initialized if it has not already been
      initialized. A new instance of the constructor's declaring class is created,
      and its fields are initialized to their default initial values."

      Following this specification literally would create two new objects, and would
      create the first object BEFORE evaluating the parameters to the constructor or
      before initializing the class, which is contrary to the runtime behavior
      specified in the JLS.

      The first paragraph quoted above is therefore spurious, and should be deleted.
      (Review ID: 127934)
      ======================================================================

            shommel Scott Hommel (Inactive)
            bstrathesunw Bill Strathearn (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: