-
Bug
-
Resolution: Unresolved
-
P4
-
None
-
1.4.0
-
Fix Understood
-
generic
-
generic
Name: bsC130419 Date: 07/13/2001
java version "1.4.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b65)
Java HotSpot(TM) Client VM (build 1.4.0-beta-b65, mixed mode)
The documentation for java.lang.Class.getMethod(String, Class[]), getMethods(),
getDeclaredMethod(String, Class[]), and getDeclaredMethods() are inaccurate
with regards to interfaces. According to JLS 9.2, ALL interfaces have
implicitly declared public methods, corresponding to the ones in Object, unless
they are redeclared explicitly in the interface hierarchy. Therefore, the
documentation for these reflective methods needs to clarify that Method objects
are returned only if the interface method is explicitly declared, and that
implicitly declared methods are not returned.
I propose adding this text to each of the 4 methods I listed:
"Public methods declared or inherited in an interface that are defined
implicitly, as mentioned in JLS 9.2, are not visible by reflection."
(Review ID: 128069)
======================================================================
- relates to
-
JDK-4651775 (reflect spec) Class.get(Declared)+{Method,Constructor} does not define "match"
-
- Open
-
-
JDK-4287725 (reflect) Allow subclasses of stated argument types in Class.getMethod()
-
- Open
-