diff --git a/java/ql/lib/semmle/code/java/controlflow/Guards.qll b/java/ql/lib/semmle/code/java/controlflow/Guards.qll index 94052d289db..c3e915b287b 100644 --- a/java/ql/lib/semmle/code/java/controlflow/Guards.qll +++ b/java/ql/lib/semmle/code/java/controlflow/Guards.qll @@ -213,13 +213,13 @@ class Guard extends ExprParent { or exists(PatternCase pc | this = pc | pc.getSelectorExpr() = testedExpr and - testedType = pc.getPattern().getType() + testedType = pc.getUniquePattern().getType() ) ) and ( if exists(RecordPatternExpr rpe | - rpe = [this.(InstanceOfExpr).getPattern(), this.(PatternCase).getPattern()] + rpe = [this.(InstanceOfExpr).getPattern(), this.(PatternCase).getAPattern()] | not rpe.isUnrestricted() )