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

JDI: ReferenceType.allMethods() and visibleMethods() should not return private or other non-inherited methods

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 9
    • Fix Version/s: tbd
    • Component/s: core-svc
    • Labels:

      Description

      The specification for ReferenceType.allMethods() states:

      Returns a list containing each Method declared in this type, and its superclasses, implemented interfaces, and/or superinterfaces. All declared and inherited methods are included, regardless of whether they are hidden or overridden.

      ---

      The first sentence covers all methods, but the second then seems to constrain things to only "declared and inherited methods". This interpretation is consistent with:

      visibleMethods() : Returns a list containing each Method declared or inherited by this type. Methods from superclasses or superinterfaces that have been hidden or overridden are not included.

      The difference between allMethods and visibleMethods should only be the set of "hidden or overridden" methods.

      Private methods and static interface methods are not inherited and so should not be returned by allMethods() (and certainly not visibleMethods()). Yet they are.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              dholmes David Holmes
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: