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

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 9
    • core-svc

      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.

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

              Created:
              Updated: