File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -533,9 +533,20 @@ class Method extends Function {
533533 * implement themselves.
534534 */
535535 predicate implements ( Method m ) {
536+ if this .isInterfaceMethod ( ) then this = m else implementsIncludingInterfaceMethods ( m )
537+ }
538+
539+ /**
540+ * Holds if this method implements the method `m`, that is, if `m` is a method
541+ * on an interface, and this is a method with the same name on a type that
542+ * implements that interface.
543+ *
544+ * Note that all methods implement themselves, and that unlike the predicate `implements`
545+ * this does allow interface methods to implement other interfaces.
546+ */
547+ predicate implementsIncludingInterfaceMethods ( Method m ) {
536548 this = m
537549 or
538- not this .isInterfaceMethod ( ) and
539550 exists ( Type t |
540551 this = t .getMethod ( m .getName ( ) ) and
541552 t .implements ( m .getReceiverType ( ) .getUnderlyingType ( ) )
Original file line number Diff line number Diff line change @@ -287,7 +287,7 @@ SourceOrSinkElement interpretElement(
287287 exists ( Method m | m .hasQualifiedName ( interpretPackage ( pkg ) , type , name ) |
288288 result .asEntity ( ) = m
289289 or
290- subtypes = true and result .asEntity ( ) .( Method ) .implements ( m )
290+ subtypes = true and result .asEntity ( ) .( Method ) .implementsIncludingInterfaceMethods ( m )
291291 )
292292 or
293293 type = "" and
You can’t perform that action at this time.
0 commit comments