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 2194e88bdff..3c03fd5d3dd 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 @@ -566,9 +566,10 @@ protected boolean triggerRecoveryUponLambdaClosure(Statement statement, boolean } else { statementEnd = statement.sourceEnd; } + boolean insideType = false; for (int i = this.elementPtr; i >= 0; --i) { if (this.elementKindStack[i] == K_TYPE_DELIMITER) - return false; + insideType = true; if (this.elementKindStack[i] != K_LAMBDA_EXPRESSION_DELIMITER) continue; LambdaExpression expression = (LambdaExpression) this.elementObjectInfoStack[i]; @@ -659,7 +660,7 @@ protected boolean triggerRecoveryUponLambdaClosure(Statement statement, boolean } } } - if (this.snapShotPtr > -1) + if (this.snapShotPtr > -1 && !insideType) popSnapShot(); return lambdaClosed; }