Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Arthanareeswaran2019-01-29 10:18:43 +0000
committerJay Arthanareeswaran2019-01-29 10:19:12 +0000
commitc7ec8a255fd31106dd76f769daecdf116a3095c0 (patch)
treedbbc462e6fa739cb626c9f6579dd9ba9c630aff4 /org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SwitchExpression.java
parent60010dfa88a963a8b16209676ac7277e5606027e (diff)
downloadeclipse.jdt.core-c7ec8a255fd31106dd76f769daecdf116a3095c0.tar.gz
eclipse.jdt.core-c7ec8a255fd31106dd76f769daecdf116a3095c0.tar.xz
eclipse.jdt.core-c7ec8a255fd31106dd76f769daecdf116a3095c0.zip
Bug 542560 - [12][completion] Code completion Support for Switch
Expressions Change-Id: Id0101c52abbeb80bb04e32daaacbb532f9192102 Signed-off-by: Jay Arthanareeswaran <jarthana@in.ibm.com>
Diffstat (limited to 'org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SwitchExpression.java')
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SwitchExpression.java5
1 files changed, 5 insertions, 0 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 88e75f2a52..0b9830cb55 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
@@ -54,6 +54,7 @@ public class SwitchExpression extends SwitchStatement implements IPolyExpression
private int nullStatus = FlowInfo.UNKNOWN;
public List<Expression> resultExpressions;
+ public boolean resolveAll;
/* package */ List<Integer> resultExpressionNullStatus;
private static Map<TypeBinding, TypeBinding[]> type_map;
@@ -389,6 +390,10 @@ public class SwitchExpression extends SwitchStatement implements IPolyExpression
this.finalValueResultExpressionTypes[i] = this.originalValueResultExpressionTypes[i] =
resultExpr.resolveTypeExpecting(upperScope, this.expectedType);
}
+ // This is a kludge and only way completion can tell this node to resolve all
+ // resultExpressions. Ideal solution is to remove all other expressions except
+ // the one that contain the completion node.
+ if (this.resolveAll) continue;
if (resultExpr.resolvedType == null || !resultExpr.resolvedType.isValidBinding())
return this.resolvedType = null;
}

Back to the top