List of usage examples for org.eclipse.jdt.core.dom VariableDeclarationStatement setSourceRange
public final void setSourceRange(int startPosition, int length)
From source file:org.eclipse.jdt.core.dom.ASTConverter.java
License:Open Source License
protected VariableDeclarationStatement convertToVariableDeclarationStatement( org.eclipse.jdt.internal.compiler.ast.LocalDeclaration localDeclaration) { final VariableDeclarationFragment variableDeclarationFragment = convertToVariableDeclarationFragment( localDeclaration);//from ww w .ja va 2 s. c om final VariableDeclarationStatement variableDeclarationStatement = new VariableDeclarationStatement( this.ast); variableDeclarationStatement.fragments().add(variableDeclarationFragment); if (this.resolveBindings) { recordNodes(variableDeclarationFragment, localDeclaration); } variableDeclarationStatement.setSourceRange(localDeclaration.declarationSourceStart, localDeclaration.declarationSourceEnd - localDeclaration.declarationSourceStart + 1); Type type = convertType(localDeclaration.type); setTypeForVariableDeclarationStatement(variableDeclarationStatement, type, variableDeclarationFragment.getExtraDimensions()); if (localDeclaration.modifiersSourceStart != -1) { setModifiers(variableDeclarationStatement, localDeclaration); } return variableDeclarationStatement; }