diff options
2 files changed, 3 insertions, 3 deletions
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SwitchExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SwitchExpression.java index 4f91f26fee..78c8e64d20 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SwitchExpression.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SwitchExpression.java @@ -164,7 +164,7 @@ public class SwitchExpression extends SwitchStatement implements IPolyExpression } } @Override - protected boolean checkNullDefaultFlow() { // JLS 12 16.1.8 + protected boolean needToCheckFlowInAbsenceOfDefaultBranch() { // JLS 12 16.1.8 return !this.switchLabeledRules; } @Override diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java index eebcfca755..b3203a4767 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java @@ -112,7 +112,7 @@ public class SwitchStatement extends Expression { protected void completeNormallyCheck(BlockScope blockScope) { // do nothing } - protected boolean checkNullDefaultFlow() { + protected boolean needToCheckFlowInAbsenceOfDefaultBranch() { return true; } @Override @@ -178,7 +178,7 @@ public class SwitchStatement extends Expression { this.synthetic = sourceTypeBinding.addSyntheticMethodForSwitchEnum(resolvedTypeBinding, this); } // if no default case, then record it may jump over the block directly to the end - if (this.defaultCase == null && checkNullDefaultFlow()) { + if (this.defaultCase == null && needToCheckFlowInAbsenceOfDefaultBranch()) { // only retain the potential initializations flowInfo.addPotentialInitializationsFrom(caseInits.mergedWith(switchContext.initsOnBreak)); this.mergedInitStateIndex = currentScope.methodScope().recordInitializationStates(flowInfo); |