File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
java/ql/lib/semmle/code/java Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -987,6 +987,17 @@ private string getAPublicObjectMethodSignature() {
987987 )
988988}
989989
990+ pragma [ nomagic]
991+ private predicate interfaceInheritsOverridingNonAbstractMethod ( Interface interface , Method m ) {
992+ interface .inherits ( m ) and
993+ not m .isAbstract ( ) and
994+ m .overrides ( _)
995+ }
996+
997+ bindingset [ m]
998+ pragma [ inline_late]
999+ private Method getAnOverridden ( Method m ) { m .overrides ( result ) }
1000+
9901001private Method getAnAbstractMethod ( Interface interface ) {
9911002 interface .inherits ( result ) and
9921003 result .isAbstract ( ) and
@@ -995,9 +1006,8 @@ private Method getAnAbstractMethod(Interface interface) {
9951006 // Make sure that there is no other non-abstract method
9961007 // (e.g. `default`) which overrides the abstract one
9971008 not exists ( Method m |
998- interface .inherits ( m ) and
999- not m .isAbstract ( ) and
1000- m .overrides ( result )
1009+ interfaceInheritsOverridingNonAbstractMethod ( interface , m ) and
1010+ result = getAnOverridden ( m )
10011011 )
10021012}
10031013
You can’t perform that action at this time.
0 commit comments