Skip to content

Commit e59487a

Browse files
committed
Don't regard cases with multiple patterns as conducting a type test
1 parent c7cb885 commit e59487a

File tree

1 file changed

+2
-2
lines changed
  • java/ql/lib/semmle/code/java/controlflow

1 file changed

+2
-2
lines changed

java/ql/lib/semmle/code/java/controlflow/Guards.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,13 +213,13 @@ class Guard extends ExprParent {
213213
or
214214
exists(PatternCase pc | this = pc |
215215
pc.getSelectorExpr() = testedExpr and
216-
testedType = pc.getPattern().getType()
216+
testedType = pc.getUniquePattern().getType()
217217
)
218218
) and
219219
(
220220
if
221221
exists(RecordPatternExpr rpe |
222-
rpe = [this.(InstanceOfExpr).getPattern(), this.(PatternCase).getPattern()]
222+
rpe = [this.(InstanceOfExpr).getPattern(), this.(PatternCase).getAPattern()]
223223
|
224224
not rpe.isUnrestricted()
225225
)

0 commit comments

Comments
 (0)