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

(reflect) Class.get{Declared}Method{s} does not return clone() for array types

XMLWordPrintable

    • b108
    • generic
    • generic, solaris_8
    • Verified

      From jdn@sfbay:

      Since 1.2 we apparently also return Cloneable and Serializable
      if getInterfaces() is called on an array. This is documented
      explicitly in the new 1.5 getGenericInterfaces() but is ignored
      by the documentation for getInterfaces().

      If we have come this far in supporting reflection on arrays
      then we should probably go ahead and fix the only remaining
      inconsistency that I know of and have getMethods(), getMethod(String),
      getDeclaredMethods() and getDeclaredMethod(String) return a public
      overridden clone() method as per the JVMS 2nd Edition section 2.15.
      This will then make reflection on arrays fully consistent with their
      bytecode execution behavior.

            jfranck Joel Borggrén-Franck (Inactive)
            iris Iris Clark
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: