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.
---
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
- csr for
-
JDK-8272715 Incorrect attribution of method invocations of Object methods on interfaces
- Closed
- relates to
-
JDK-8282080 Lambda deserialization fails for Object method references on interfaces
- Closed
-
JDK-8293890 javac creates an Element whose getEnclosingElement() does not enclose it
- Open