Skip to content

Commit fa651d2

Browse files
committed
remove the override restriction from ql/unused-field
1 parent f3ca6bb commit fa651d2

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

ql/ql/src/queries/performance/UnusedField.ql

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,6 @@ where
3131
access.getEnclosingPredicate() = p
3232
)
3333
) and
34-
(if clz = implClz then extraMsg = "." else extraMsg = " of any class between it and $@.") and
35-
// The `implClz` does not override `field` with a more specific type.
36-
not exists(FieldDecl override |
37-
override = implClz.getDeclaration().getAField() and
38-
override.getName() = field.getName() and
39-
override.hasAnnotation("override") and
40-
override.getVarDecl().getType() != field.getVarDecl().getType()
41-
)
34+
(if clz = implClz then extraMsg = "." else extraMsg = " of any class between it and $@.")
4235
select clz, "The field $@ declared in $@ is not used in the characteristic predicate" + extraMsg,
4336
field, field.getName(), clz, clz.getName(), implClz, implClz.getName()

0 commit comments

Comments
 (0)