JDK-4987375 : (reflect) Class.get{Declared}Method{s} does not return clone() for array types
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang:reflect
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: generic,solaris_8
  • CPU: generic
  • Submitted: 2004-02-03
  • Updated: 2017-05-16
  • Resolved: 2013-09-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8 b108Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
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.

Comments
The default approach to resolving this kind of issue is to make the specification match the long-standing implementation.
10-07-2013

EVALUATION The main issue with this bug is not filtering out the clone methods in HotSpot or the core libraries, but in evaluating the compatability impact of doing so given the long-standing behavior to the contrary. This bug has been targetted at Dolphin to allow that analysis to take place.
17-04-2006

EVALUATION Contribution-Forum:https://jdk-collaboration.dev.java.net/servlets/ProjectForumMessageView?messageID=12275&forumID=1463
27-03-2006

CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mustang
27-06-2004

EVALUATION The documenation should be updated as described. -- iag@sfbay 2004-02-02 The only documenation change is for getInterfaces(). The other methods to support clone() would require new behaviour. -- iag@sfbay 2004-02-02
02-02-2004