Buggy code:
private boolean areRootPathsComputed ; public SourceMapper ( ) { } public SourceMapper ( IPath sourcePath , String rootPath , Map options ) { } public void acceptImport ( int declarationStart , int declarationEnd , char [ ] name , boolean onDemand , int modifiers ) { } public void acceptLineSeparatorPositions ( int [ ] positions ) { } public void acceptPackage ( int declarationStart , int declarationEnd , char [ ] name ) { } public void acceptProblem ( IProblem problem ) { } public void close ( ) { } private String [ ] convertTypeNamesToSigs ( char [ ] [ ] typeNames ) { } private void computeAllRootPaths ( IPackageFragmentRoot root ) { } private void computeRootPath ( File directory , HashSet firstLevelPackageNames , boolean hasDefaultPackage ) { } private void computeRootPath ( IContainer container , HashSet firstLevelPackageNames , boolean hasDefaultPackage ) { } public void enterType ( ISourceElementRequestor . TypeInfo typeInfo ) { } public void enterCompilationUnit ( ) { } public void enterConstructor ( ISourceElementRequestor . MethodInfo methodInfo ) { } public void enterField ( ISourceElementRequestor . FieldInfo fieldInfo ) { } public void enterInitializer ( int declarationSourceStart , int modifiers ) { } public void enterMethod ( ISourceElementRequestor . MethodInfo methodInfo ) { } private void enterAbstractMethod ( ISourceElementRequestor . MethodInfo methodInfo ) { } public void exitType ( int declarationEnd ) { } public void exitCompilationUnit ( int declarationEnd ) { } public void exitConstructor ( int declarationEnd ) { } public void exitField ( int initializationStart , int declarationEnd , int declarationSourceEnd ) { } public void exitInitializer ( int declarationEnd ) { } public void exitMethod ( int declarationEnd , int defaultValueStart , int defaultValueEnd ) { } private void exitAbstractMethod ( int declarationEnd ) { } public char [ ] findSource ( IType type ) { } public char [ ] findSource ( IType type , String simpleSourceFileName ) { } private char [ ] getSourceForRootPath ( String currentRootPath , String name ) { } public char [ ] findSource ( String fullName ) { } public SourceRange getNameRange ( IJavaElement element ) { } public char [ ] [ ] getMethodParameterNames ( IMethod method ) { } public SourceRange getSourceRange ( IJavaElement element ) { } protected IType getType ( String typeName ) { } protected IJavaElement [ ] getUnqualifiedMethodHandle ( IMethod method , boolean noDollar ) { } public void mapSource ( IType type , char [ ] contents ) { } public synchronized ISourceRange mapSource ( IType type , char [ ] contents , IJavaElement elementToFind ) { this . binaryType = ( ( BinaryType ) ( type ) ) ; if ( ( this . fSourceRanges . get ( type ) ) != null ) return elementToFind != null ? this . getNameRange ( elementToFind ) : null ; this . importsTable . remove ( this . binaryType ) ; this . importsCounterTable . remove ( this . binaryType ) ; this . searchedElement = elementToFind ; this . types = new IType [ 1 ] ; this . typeDeclarationStarts = new int [ 1 ] ; this . typeNameRanges = new SourceRange [ 1 ] ; this . typeDepth = - 1 ; this . fMemberDeclarationStart = new int [ 1 ] ; this . fMemberName = new String [ 1 ] ; this . fMemberNameRange = new SourceRange [ 1 ] ; this . fMethodParameterTypes = new char [ 1 ] [ ] [ ] ; this . fMethodParameterNames = new char [ 1 ] [ ] [ ] ; this . anonymousCounter = 0 ; HashMap oldSourceRanges = ( ( HashMap ) ( fSourceRanges . clone ( ) ) ) ; try { IProblemFactory factory = new DefaultProblemFactory ( ) ; SourceElementParser parser = null ; boolean isAnonymousClass = false ; char [ ] fullName = null ; this . anonymousClassName = 0 ; IBinaryType info = null ; try { info = ( ( IBinaryType ) ( this . binaryType . getElementInfo ( ) ) ) ; isAnonymousClass = info . isAnonymous ( ) ; fullName = info . getName ( ) ; } catch ( JavaModelException e ) { } if ( isAnonymousClass ) { String eltName = this . binaryType . getParent ( ) . getElementName ( ) ; eltName = eltName . substring ( ( ( eltName . lastIndexOf ( '$' ) ) + 1 ) , eltName . length ( ) ) ; try { this . anonymousClassName = Integer . parseInt ( eltName ) ; } catch ( NumberFormatException e ) { } } boolean doFullParse = hasToRetrieveSourceRangesForLocalClass ( fullName ) ; <START_BUG> parser = new SourceElementParser ( this , factory , new CompilerOptions ( this . options ) , doFullParse ) ; <END_BUG> IJavaElement javaElement = this . binaryType . getCompilationUnit ( ) ; if ( javaElement == null ) javaElement = this . binaryType . getParent ( ) ; parser . parseCompilationUnit ( new BasicCompilationUnit ( contents , null , this . binaryType . sourceFileName ( info ) , javaElement ) , doFullParse ) ; if ( elementToFind != null ) { ISourceRange range = this . getNameRange ( elementToFind ) ; return range ; } else { return null ; } } finally { if ( elementToFind != null ) { fSourceRanges = oldSourceRanges ; } this . binaryType = null ; this . searchedElement = null ; this . types = null ; this . typeDeclarationStarts = null ; this . typeNameRanges = null ; this . typeDepth = - 1 ; } } private char [ ] readSource ( ZipEntry entry , ZipFile zip ) { } protected void setMethodParameterNames ( IMethod method , char [ ] [ ] parameterNames ) { } protected void setSourceRange ( IJavaElement element , SourceRange sourceRange , SourceRange nameRange ) { } public char [ ] [ ] getImports ( BinaryType type ) { } private boolean hasToRetrieveSourceRangesForLocalClass ( char [ ] eltName ) { } }

Fix:
parser = new SourceElementParser ( this , factory , new CompilerOptions ( this . options ) , doFullParse , true ) ;