protected VariableDeclarationStatement convertToVariableDeclarationStatement(org.eclipse.jdt.internal.compiler.ast.LocalDeclaration localDeclaration) {
final VariableDeclarationFragment variableDeclarationFragment = convertToVariableDeclarationFragment(localDeclaration);
final VariableDeclarationStatement variableDeclarationStatement = new VariableDeclarationStatement(this.ast);
variableDeclarationStatement.fragments().add(variableDeclarationFragment);
variableDeclarationStatement.setSourceRange(localDeclaration.declarationSourceStart, localDeclaration.declarationSourceEnd - localDeclaration.declarationSourceStart + 1);
Type type = convertType(localDeclaration.type);
setTypeForVariableDeclarationStatement(variableDeclarationStatement, type, variableDeclarationFragment.getExtraDimensions());
if (this.resolveBindings) {
recordNodes(variableDeclarationFragment, localDeclaration);
if (this.ast.apiLevel() >= AST.JLS10_INTERNAL && type.isVar()) {
SimpleName varName = (SimpleName) ((SimpleType) type).getName();
varName.setVar(true);
recordNodes(varName, localDeclaration);
}
}
if (localDeclaration.modifiersSourceStart != -1) {
setModifiers(variableDeclarationStatement, localDeclaration);
}
return variableDeclarationStatement;
}