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

Incorrect attribution of method invocations of Object methods on interfaces

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 18
    • 18
    • tools
    • None
    • b18

    Description

      Consider code like:
      ---
      interface I {
           public String toString();
      }
      interface J extends I {}

      I i = null;
      i.toString(); //attributed as I.toString();
      J j = null;
      j.toString(); //attributed as j.toString();
      ---

      This does not seem quite right - the method is inherited in "J" from "I", not from Object.

      Moreover, calling `Elements.getAllMembers()` will return "toString" from "I" in the result, but calling `Trees.isAccessible(..., "toString", "I");` will return false, because it will appear that the method is implemented in j.l.Object.

      Attachments

        Issue Links

          Activity

            People

              jlahoda Jan Lahoda
              jlahoda Jan Lahoda
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: