Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2018-04-21 13:05:32 +0000
committerStephan Herrmann2018-04-21 15:26:07 +0000
commit345e42a611307a2681fbe3027e3d89a313222e16 (patch)
treefd9c47575f0042513a034128652a569c8dd832d0 /org.eclipse.jdt.core/codeassist
parentea689a4af26390201617f298fb17b50a48435f21 (diff)
downloadeclipse.jdt.core-345e42a611307a2681fbe3027e3d89a313222e16.tar.gz
eclipse.jdt.core-345e42a611307a2681fbe3027e3d89a313222e16.tar.xz
eclipse.jdt.core-345e42a611307a2681fbe3027e3d89a313222e16.zip
Bug 533884 - [10] var type in an enhanced for loop is not resolvedI20180421-1500
properly - recovery for the block of a ForeachStatement Change-Id: I0fb553f21eaf48ca02e3b003849a0cf6f59873b0
Diffstat (limited to 'org.eclipse.jdt.core/codeassist')
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java
index d6ff6c7bc5..afc4777be5 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java
@@ -231,9 +231,6 @@ public RecoveredElement buildInitialRecoveryState(){
ASTNode node = null, lastNode = null;
for (int i = 0; i <= this.astPtr; i++, lastNode = node) {
node = this.astStack[i];
- if(node instanceof ForeachStatement && ((ForeachStatement)node).action == null) {
- node = ((ForeachStatement)node).elementVariable;
- }
/* check for intermediate block creation, so recovery can properly close them afterwards */
int nodeStart = node.sourceStart;
for (int j = blockIndex; j <= this.realBlockPtr; j++){
@@ -334,6 +331,9 @@ public RecoveredElement buildInitialRecoveryState(){
element.add(stmt, 0);
this.lastCheckPoint = stmt.sourceEnd + 1;
this.isOrphanCompletionNode = false;
+ } else if ((stmt instanceof ForeachStatement) && ((ForeachStatement) stmt).action == null) {
+ element = element.add(stmt, 0);
+ this.lastCheckPoint = stmt.sourceEnd + 1;
}
}
continue;

Back to the top