Buggy code:
public class CompilationUnitStructureRequestor extends ReferenceInfoAdapter implements ISourceElementRequestor { protected ICompilationUnit unit ; protected CompilationUnitElementInfo unitInfo ; protected JavaElementInfo importContainerInfo = null ; protected Map newElements ; protected Stack infoStack ; protected Stack handleStack ; protected char [ ] sourceFileName = null ; protected char [ ] packageName = null ; protected int referenceCount = 0 ; protected boolean hasSyntaxErrors = false ; protected Parser parser ; protected static String [ ] NO_STRINGS = new String [ 0 ] ; protected static byte [ ] NO_BYTES = new byte [ ] { } ; protected HashtableOfObject fieldRefCache ; protected HashtableOfObject messageRefCache ; protected HashtableOfObject typeRefCache ; protected HashtableOfObject unknownRefCache ; protected CompilationUnitStructureRequestor ( ICompilationUnit unit , CompilationUnitElementInfo unitInfo , Map newElements ) throws JavaModelException { } 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 ) { } static String [ ] convertTypeNamesToSigs ( char [ ] [ ] typeNames ) { } public void enterClass ( int declarationStart , int modifiers , char [ ] name , int nameSourceStart , int nameSourceEnd , char [ ] superclass , char [ ] [ ] superinterfaces ) { } public void enterCompilationUnit ( ) { } public void enterConstructor ( int declarationStart , int modifiers , char [ ] name , int nameSourceStart , int nameSourceEnd , char [ ] [ ] parameterTypes , char [ ] [ ] parameterNames , char [ ] [ ] exceptionTypes ) { } public void enterField ( int declarationStart , int modifiers , char [ ] type , char [ ] name , int nameSourceStart , int nameSourceEnd ) { } public void enterInitializer ( int declarationSourceStart , int modifiers ) { } public void enterInterface ( int declarationStart , int modifiers , char [ ] name , int nameSourceStart , int nameSourceEnd , char [ ] [ ] superinterfaces ) { } public void enterMethod ( int declarationStart , int modifiers , char [ ] returnType , char [ ] name , int nameSourceStart , int nameSourceEnd , char [ ] [ ] parameterTypes , char [ ] [ ] parameterNames , char [ ] [ ] exceptionTypes ) { } protected void enterMethod ( int declarationStart , int modifiers , char [ ] returnType , char [ ] name , int nameSourceStart , int nameSourceEnd , char [ ] [ ] parameterTypes , char [ ] [ ] parameterNames , char [ ] [ ] exceptionTypes , boolean isConstructor ) { } protected void enterType ( int declarationStart , int modifiers , char [ ] name , int nameSourceStart , int nameSourceEnd , char [ ] superclass , char [ ] [ ] superinterfaces ) { } public void exitClass ( 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 exitInterface ( int declarationEnd ) { } protected void exitMember ( int declarationEnd ) { } public void exitMethod ( int declarationEnd ) { } protected void resolveDuplicates ( IJavaElement handle ) { while ( newElements . containsKey ( handle ) ) { JavaElement h = ( ( JavaElement ) ( handle ) ) ; <START_BUG> h . setOccurrenceCount ( ( ( h . getOccurrenceCount ( ) ) + 1 ) ) ; <END_BUG> } } }

Fix:
( h . occurrenceCount ) ++ ;