Java: Fix overrides to not be transitive.#7132
Conversation
atorralba
left a comment
There was a problem hiding this comment.
So, this is now expected to only return the directly (i.e. first) overridden method in the hierarchy, instead of all the methods with the same signature in all supertypes, and because of that it allows to skip intermediate types that don't declare a method with that signature, right?
If I understood that correctly, it LGTM. Some test expectations need fixing, though:
FAILED: ql/java/ql/test/library-tests/overrides/ConstructedOverrides2.ql
FAILED: ql/java/ql/test/query-tests/dead-code/DeadMethod/DeadMethod.qlref
It already allowed that. The following equation holds |
|
Yes, I was just trying to write down what I understood about the block after the
🤔 Isn't it |
Yes, you're right. I wrote that a bit too quickly. |
|
The queries |
|
Timings look good now. |
The
Method.overrides(Method)relation was accidentally transitive. This has been a minor bit of technical debt for a long time, but isn't expected to have much impact as uses are mostly of the transitive forma.overrides*(b)and the qldoc has been claiming that only direct overrides were being included.