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

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: 9
    • Component/s: 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.

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

              Created:
              Updated: