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

make type of Class.getDeclaredConstructors() generic

XMLWordPrintable

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

      A DESCRIPTION OF THE REQUEST :
      while for method

      public Constructor<T> getConstructor(Class<?>... parameterTypes)

      is "generizised" giving the return type the most possible information,
      this is not true for
      public Constructor<?>[] getConstructors().

      i think analogously to getConstructor it should be

      public Constructor<T>[] getConstructors().


      JUSTIFICATION :
      justification as for genierics in general: avoids casts
      also since java 5 awarning is given at compile time when casting
      no warnings means clean code and no fear of runtime cast exceptions.


      CUSTOMER SUBMITTED WORKAROUND :
      casting

            Unassigned Unassigned
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: