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

(reflect spec) Class.get{Declared}Method* does't explain absent implicit methods

XMLWordPrintable

    • 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)
      ======================================================================

            Unassigned Unassigned
            bstrathesunw Bill Strathearn (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: