File tree 1 file changed +13
-3
lines changed
java/ql/lib/semmle/code/java
1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -987,6 +987,17 @@ private string getAPublicObjectMethodSignature() {
987
987
)
988
988
}
989
989
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
+
990
1001
private Method getAnAbstractMethod ( Interface interface ) {
991
1002
interface .inherits ( result ) and
992
1003
result .isAbstract ( ) and
@@ -995,9 +1006,8 @@ private Method getAnAbstractMethod(Interface interface) {
995
1006
// Make sure that there is no other non-abstract method
996
1007
// (e.g. `default`) which overrides the abstract one
997
1008
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 )
1001
1011
)
1002
1012
}
1003
1013
You can’t perform that action at this time.
0 commit comments