diff options
Diffstat (limited to 'org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/IfStatement.java')
-rw-r--r-- | org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/IfStatement.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/IfStatement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/IfStatement.java index 56d12f79d..9eff87b2a 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/IfStatement.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/IfStatement.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2020 IBM Corporation and others. + * Copyright (c) 2000, 2021 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -288,7 +288,7 @@ private void resolveIfStatement(BlockScope scope) { } @Override public void resolve(BlockScope scope) { - if (this.condition.containsPatternVariable()) { + if (containsPatternVariable()) { this.condition.collectPatternVariablesToScope(null, scope); LocalVariableBinding[] patternVariablesInTrueScope = this.condition.getPatternVariablesWhenTrue(); LocalVariableBinding[] patternVariablesInFalseScope = this.condition.getPatternVariablesWhenFalse(); @@ -313,6 +313,11 @@ public void resolve(BlockScope scope) { } @Override +public boolean containsPatternVariable() { + return this.condition.containsPatternVariable(); +} + +@Override public void traverse(ASTVisitor visitor, BlockScope blockScope) { if (visitor.visit(this, blockScope)) { this.condition.traverse(visitor, blockScope); |