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

(reflect) Class.getConstructor(Class[]) should allow subclasses

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.2.2
    • core-libs



      Name: krT82822 Date: 12/26/99


      An earlier bug report (filed as an Ease of Use issue) noted:

      >Class.getConstructor(Class[]) fails to find a constructor (throws
      >NoSuchMethodException) if an arg type is a subclass of the actual arg type.
      >
      >EX: SomeClass(Person who) // <-- constructor
      >is not found if Class.getConstructor() is given a Class[] = {PersonSubClass}

      getConstructor should return the constructor that will accept the argument types
      you pass it, even if the types are not EXACT matches (i.e., even if they're
      subclasses of the types expected)

      ------------------------------

      (see also 4017835)
      (Review ID: 99337)
      ======================================================================

            iris Iris Clark
            kryansunw Kevin Ryan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: