Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManoj Palat2019-04-26 08:22:59 +0000
committerManoj Palat2019-04-26 08:22:59 +0000
commit8d7a3b6518962ae563556185a4be8fc8517bf0f4 (patch)
treedaaede7cf5697e160c236dbf66fa5758bf8de489
parenta8d59be0a1fe090c489c1eb9fda14a27bfb7fb74 (diff)
downloadeclipse.jdt.core-8d7a3b6518962ae563556185a4be8fc8517bf0f4.tar.gz
eclipse.jdt.core-8d7a3b6518962ae563556185a4be8fc8517bf0f4.tar.xz
eclipse.jdt.core-8d7a3b6518962ae563556185a4be8fc8517bf0f4.zip
Bug 545716 - [12] expression switch doesn't consider that having all
cases of an enum is enough to be exhaustive - minor commit for method name as per bug 545716 comment 9 Change-Id: I20216be5cc924dcae6e6f3d6ed1c59f5602d8c8d
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SwitchExpression.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java4
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);

Back to the top