Details
-
Bug
-
Resolution: Fixed
-
P4
-
6
-
b108
-
generic
-
generic, solaris_8
-
Verified
Description
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.
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.
Attachments
Issue Links
- duplicates
-
JDK-5047858 (reflect) Class.getMethod() can't find String[].clone()
- Closed
- relates to
-
JDK-4508592 (reflect spec) Class.getMethods() returns non-empty array for array classes
- Resolved
-
JDK-5047859 (reflect) Class.getField can't find String[].length
- Closed