File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
org.eclipse.jdt.core.javac/src/org/eclipse/jdt/core/dom Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -1074,7 +1074,9 @@ private AbstractTypeDeclaration findSurroundingTypeDeclaration(ASTNode parent) {
10741074 private VariableDeclaration convertVariableDeclarationForLambda (JCVariableDecl javac ) {
10751075 if (javac .getType () == null && javac .getStartPosition () == javac .getPreferredPosition () /* check no "var" */ ) {
10761076 return createVariableDeclarationFragment (javac );
1077- } else if (javac .getType () != null && javac .getType ().getPreferredPosition () == Position .NOPOS ) { // "virtual" node added for analysis, not part of AST
1077+ } else if (javac .getType () != null &&
1078+ (javac .getType ().getPreferredPosition () == Position .NOPOS
1079+ || javac .getType ().getEndPosition (javacCompilationUnit .endPositions ) == Position .NOPOS )) { // "virtual" node added for analysis, not part of AST
10781080 return createVariableDeclarationFragment (javac );
10791081 } else {
10801082 return convertVariableDeclaration (javac );
You can’t perform that action at this time.
0 commit comments