Skip to content

Commit c3493d6

Browse files
QL: Add check for predicates with an override annotation
1 parent d474a76 commit c3493d6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

ql/src/queries/performance/ClassPredicateDoesntMentionThis.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,6 @@ where
8181
not usesThis(pred) and
8282
not isTrivialImplementation(pred) and
8383
not isSingleton(pred.getDeclaringType()) and
84-
not exists(ClassPredicate other | pred.overrides(other) or other.overrides(pred))
84+
not exists(ClassPredicate other | pred.overrides(other) or other.overrides(pred)) and
85+
not pred.isOverride()
8586
select pred, "This predicate could be a classless predicate, as it doesn't depend on `this`."

0 commit comments

Comments
 (0)