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

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Duplicate
    • Priority: P4
    • None
    • Affects Version/s: 1.2.2
    • Component/s: 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)
      ======================================================================

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: