Lines 382-387
Link Here
|
382 |
&& stmts[index - 1] instanceof org.eclipse.jdt.internal.compiler.ast.LocalDeclaration) { |
382 |
&& stmts[index - 1] instanceof org.eclipse.jdt.internal.compiler.ast.LocalDeclaration) { |
383 |
org.eclipse.jdt.internal.compiler.ast.LocalDeclaration local1 = (org.eclipse.jdt.internal.compiler.ast.LocalDeclaration) stmts[index - 1]; |
383 |
org.eclipse.jdt.internal.compiler.ast.LocalDeclaration local1 = (org.eclipse.jdt.internal.compiler.ast.LocalDeclaration) stmts[index - 1]; |
384 |
org.eclipse.jdt.internal.compiler.ast.LocalDeclaration local2 = (org.eclipse.jdt.internal.compiler.ast.LocalDeclaration) stmts[index]; |
384 |
org.eclipse.jdt.internal.compiler.ast.LocalDeclaration local2 = (org.eclipse.jdt.internal.compiler.ast.LocalDeclaration) stmts[index]; |
|
|
385 |
if (local2.name == RecoveryScanner.FAKE_IDENTIFIER) // workaround for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=199668 |
386 |
return; |
385 |
if (local1.declarationSourceStart == local2.declarationSourceStart) { |
387 |
if (local1.declarationSourceStart == local2.declarationSourceStart) { |
386 |
// we have a multiple local declarations |
388 |
// we have a multiple local declarations |
387 |
// We retrieve the existing VariableDeclarationStatement to add the new VariableDeclarationFragment |
389 |
// We retrieve the existing VariableDeclarationStatement to add the new VariableDeclarationFragment |
Lines 1737-1746
Link Here
|
1737 |
if (initializations != null) { |
1739 |
if (initializations != null) { |
1738 |
// we know that we have at least one initialization |
1740 |
// we know that we have at least one initialization |
1739 |
if (initializations[0] instanceof org.eclipse.jdt.internal.compiler.ast.LocalDeclaration) { |
1741 |
if (initializations[0] instanceof org.eclipse.jdt.internal.compiler.ast.LocalDeclaration) { |
1740 |
VariableDeclarationExpression variableDeclarationExpression = convertToVariableDeclarationExpression((org.eclipse.jdt.internal.compiler.ast.LocalDeclaration) initializations[0]); |
1742 |
org.eclipse.jdt.internal.compiler.ast.LocalDeclaration initialization = (org.eclipse.jdt.internal.compiler.ast.LocalDeclaration) initializations[0]; |
|
|
1743 |
if (initialization.name == RecoveryScanner.FAKE_IDENTIFIER) { // workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=199668) |
1744 |
return null; |
1745 |
} |
1746 |
VariableDeclarationExpression variableDeclarationExpression = convertToVariableDeclarationExpression(initialization); |
1741 |
int initializationsLength = initializations.length; |
1747 |
int initializationsLength = initializations.length; |
1742 |
for (int i = 1; i < initializationsLength; i++) { |
1748 |
for (int i = 1; i < initializationsLength; i++) { |
1743 |
variableDeclarationExpression.fragments().add(convertToVariableDeclarationFragment((org.eclipse.jdt.internal.compiler.ast.LocalDeclaration)initializations[i])); |
1749 |
initialization = (org.eclipse.jdt.internal.compiler.ast.LocalDeclaration)initializations[i]; |
|
|
1750 |
if (initialization.name != RecoveryScanner.FAKE_IDENTIFIER) { // workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=199668) |
1751 |
variableDeclarationExpression.fragments().add(convertToVariableDeclarationFragment(initialization)); |
1752 |
} |
1744 |
} |
1753 |
} |
1745 |
if (initializationsLength != 1) { |
1754 |
if (initializationsLength != 1) { |
1746 |
int start = variableDeclarationExpression.getStartPosition(); |
1755 |
int start = variableDeclarationExpression.getStartPosition(); |
Lines 2371-2377
Link Here
|
2371 |
return convert((ForeachStatement) statement); |
2380 |
return convert((ForeachStatement) statement); |
2372 |
} |
2381 |
} |
2373 |
if (statement instanceof org.eclipse.jdt.internal.compiler.ast.LocalDeclaration) { |
2382 |
if (statement instanceof org.eclipse.jdt.internal.compiler.ast.LocalDeclaration) { |
2374 |
return convertToVariableDeclarationStatement((org.eclipse.jdt.internal.compiler.ast.LocalDeclaration)statement); |
2383 |
org.eclipse.jdt.internal.compiler.ast.LocalDeclaration localDeclaration = (org.eclipse.jdt.internal.compiler.ast.LocalDeclaration)statement; |
|
|
2384 |
if (localDeclaration.name == RecoveryScanner.FAKE_IDENTIFIER) // workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=199668 |
2385 |
return null; |
2386 |
return convertToVariableDeclarationStatement(localDeclaration); |
2375 |
} |
2387 |
} |
2376 |
if (statement instanceof org.eclipse.jdt.internal.compiler.ast.AssertStatement) { |
2388 |
if (statement instanceof org.eclipse.jdt.internal.compiler.ast.AssertStatement) { |
2377 |
return convert((org.eclipse.jdt.internal.compiler.ast.AssertStatement) statement); |
2389 |
return convert((org.eclipse.jdt.internal.compiler.ast.AssertStatement) statement); |