Buggy code:
public class DOMBuilder extends AbstractDOMBuilder implements IDocumentElementRequestor { protected boolean fBuildingSingleMember = false ; protected boolean fFinishedSingleMember = false ; protected ArrayList fFields ; Map options = JavaCore . getOptions ( ) ; public DOMBuilder ( ) { } public void acceptImport ( int declarationStart , int declarationEnd , int [ ] javaDocPositions , char [ ] name , int nameStart , boolean onDemand , int modifiers ) { int [ ] sourceRange = new int [ ] { declarationStart , declarationEnd } ; int [ ] nameRange = new int [ ] { nameStart , declarationEnd - 1 } ; <START_BUG> String importName = new String ( CharOperation . subarray ( fDocument , nameRange [ 0 ] , ( ( nameRange [ 1 ] ) + 1 ) ) ) ; <END_BUG> fNode = new DOMImport ( fDocument , sourceRange , importName , nameRange , onDemand , modifiers ) ; addChild ( fNode ) ; if ( fBuildingSingleMember ) { fFinishedSingleMember = true ; } } public void acceptInitializer ( int declarationStart , int declarationEnd , int [ ] javaDocPositions , int modifiers , int modifiersStart , int bodyStart , int bodyEnd ) { } public void acceptPackage ( int declarationStart , int declarationEnd , int [ ] javaDocPositions , char [ ] name , int nameStartPosition ) { } public void acceptProblem ( IProblem problem ) { } protected void addChild ( IDOMNode child ) { } public IDOMCompilationUnit createCompilationUnit ( ) { } public IDOMCompilationUnit createCompilationUnit ( ICompilationUnit compilationUnit ) { } public IDOMField createField ( char [ ] sourceCode ) { } public IDOMField [ ] createFields ( char [ ] sourceCode ) { } public IDOMImport createImport ( ) { } public IDOMImport createImport ( char [ ] sourceCode ) { } public IDOMInitializer createInitializer ( char [ ] sourceCode ) { } public IDOMMethod createMethod ( char [ ] sourceCode ) { } public IDOMPackage createPackage ( ) { } public IDOMPackage createPackage ( char [ ] sourceCode ) { } public IDOMType createType ( char [ ] sourceCode ) { } protected void enterAbstractMethod ( int declarationStart , int [ ] javaDocPositions , int modifiers , int modifiersStart , char [ ] returnType , int returnTypeStart , int returnTypeEnd , int returnTypeDimensionCount , char [ ] name , int nameStart , int nameEnd , char [ ] [ ] parameterTypes , int [ ] parameterTypeStarts , int [ ] parameterTypeEnds , char [ ] [ ] parameterNames , int [ ] parameterNameStarts , int [ ] parameterNameEnds , int parametersEnd , int extendedReturnTypeDimensionCount , int extendedReturnTypeDimensionEnd , char [ ] [ ] exceptionTypes , int [ ] exceptionTypeStarts , int [ ] exceptionTypeEnds , int bodyStart , boolean isConstructor ) { } public void enterClass ( int declarationStart , int [ ] javaDocPositions , int modifiers , int modifiersStart , int keywordStart , char [ ] name , int nameStart , int nameEnd , char [ ] superclass , int superclassStart , int superclassEnd , char [ ] [ ] superinterfaces , int [ ] superinterfaceStarts , int [ ] superinterfaceEnds , int bodyStart ) { } public void enterConstructor ( int declarationStart , int [ ] javaDocPositions , int modifiers , int modifiersStart , char [ ] name , int nameStart , int nameEnd , char [ ] [ ] parameterTypes , int [ ] parameterTypeStarts , int [ ] parameterTypeEnds , char [ ] [ ] parameterNames , int [ ] parameterNameStarts , int [ ] parameterNameEnds , int parametersEnd , char [ ] [ ] exceptionTypes , int [ ] exceptionTypeStarts , int [ ] exceptionTypeEnds , int bodyStart ) { } public void enterField ( int declarationStart , int [ ] javaDocPositions , int modifiers , int modifiersStart , char [ ] type , int typeStart , int typeEnd , int typeDimensionCount , char [ ] name , int nameStart , int nameEnd , int extendedTypeDimensionCount , int extendedTypeDimensionEnd ) { } public void enterInterface ( int declarationStart , int [ ] javaDocPositions , int modifiers , int modifiersStart , int keywordStart , char [ ] name , int nameStart , int nameEnd , char [ ] [ ] superinterfaces , int [ ] superinterfaceStarts , int [ ] superinterfaceEnds , int bodyStart ) { } public void enterMethod ( int declarationStart , int [ ] javaDocPositions , int modifiers , int modifiersStart , char [ ] returnType , int returnTypeStart , int returnTypeEnd , int returnTypeDimensionCount , char [ ] name , int nameStart , int nameEnd , char [ ] [ ] parameterTypes , int [ ] parameterTypeStarts , int [ ] parameterTypeEnds , char [ ] [ ] parameterNames , int [ ] parameterNameStarts , int [ ] parameterNameEnds , int parametersEnd , int extendedReturnTypeDimensionCount , int extendedReturnTypeDimensionEnd , char [ ] [ ] exceptionTypes , int [ ] exceptionTypeStarts , int [ ] exceptionTypeEnds , int bodyStart ) { } protected void enterType ( int declarationStart , int [ ] javaDocPositions , int modifiers , int modifiersStart , int keywordStart , char [ ] name , int nameStart , int nameEnd , char [ ] superclass , int superclassStart , int superclassEnd , char [ ] [ ] superinterfaces , int [ ] superinterfaceStarts , int [ ] superinterfaceEnds , int bodyStart , boolean isClass ) { } protected void exitAbstractMethod ( int bodyEnd , int declarationEnd ) { } public void exitClass ( int bodyEnd , int declarationEnd ) { } public void exitConstructor ( int bodyEnd , int declarationEnd ) { } public void exitField ( int bodyEnd , int declarationEnd ) { } public void exitInterface ( int bodyEnd , int declarationEnd ) { } public void exitMethod ( int bodyEnd , int declarationEnd ) { } protected DocumentElementParser getParser ( Map settings ) { } protected void initializeBuild ( char [ ] sourceCode , boolean buildingCompilationUnit , boolean buildingType , boolean singleMember ) { } }

Fix:
String importName = new String ( fDocument , nameRange [ 0 ] , ( ( ( nameRange [ 1 ] ) + 1 ) - ( nameRange [ 0 ] ) ) ) ;