(reflect) Class<T>.getConstructors returns Constructor[], expect Constructor<T>[

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Duplicate
    • Priority: P3
    • 6
    • Affects Version/s: 5.0
    • Component/s: core-libs

      Name: jl125535 Date: 08/25/2004


      A DESCRIPTION OF THE REQUEST :
      The title says it all. It ruins the type safety of it. Strangely, getConstructor() does return Constructor<T>.

      JUSTIFICATION :
      Much code cannot run with it like this and I can think of no reason why the API should be phrased this way.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Return Constructor<T>[], not Constructor[].

      CUSTOMER SUBMITTED WORKAROUND :
      I have patched the source to java/lang/Class.java, it compiles and seems to test out OK. Unfortunately, code developed with the patched RT cannot be run on client's machines since they want to use virgin RTs.

      (Incident Review ID: 300776)
      ======================================================================

            Assignee:
            Joe Darcy
            Reporter:
            Jon Lee (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: