Buggy code:
public class DeltaProcessingState implements IResourceChangeListener { public IElementChangedListener [ ] elementChangedListeners = new IElementChangedListener [ 5 ] ; public int [ ] elementChangedListenerMasks = new int [ 5 ] ; public int elementChangedListenerCount = 0 ; public IResourceChangeListener [ ] preResourceChangeListeners = new IResourceChangeListener [ 1 ] ; public int preResourceChangeListenerCount = 0 ; private ThreadLocal deltaProcessors = new ThreadLocal ( ) ; public HashMap roots = new HashMap ( ) ; public HashMap otherRoots = new HashMap ( ) ; public HashMap oldRoots = new HashMap ( ) ; public HashMap oldOtherRoots = new HashMap ( ) ; public HashMap sourceAttachments = new HashMap ( ) ; public boolean rootsAreStale = true ; private Set initializingThreads = Collections . synchronizedSet ( new HashSet ( ) ) ; public Hashtable externalTimeStamps = new Hashtable ( ) ; public HashMap projectUpdates = new HashMap ( ) ; public static class ProjectUpdateInfo { JavaProject project ; IClasspathEntry [ ] oldResolvedPath ; IClasspathEntry [ ] newResolvedPath ; IClasspathEntry [ ] newRawPath ; public void updateProjectReferencesIfNecessary ( ) throws JavaModelException { } } public IJavaProject [ ] modelProjectsCache ; public void addElementChangedListener ( IElementChangedListener listener , int eventMask ) { } public void addPreResourceChangedListener ( IResourceChangeListener listener ) { } public DeltaProcessor getDeltaProcessor ( ) { } public void performClasspathResourceChange ( JavaProject project , IClasspathEntry [ ] oldResolvedPath , IClasspathEntry [ ] newResolvedPath , IClasspathEntry [ ] newRawPath , boolean canChangeResources ) throws JavaModelException { } public void initializeRoots ( ) { HashMap newRoots = null ; HashMap newOtherRoots = null ; HashMap newSourceAttachments = null ; if ( this . rootsAreStale ) { Thread currentThread = Thread . currentThread ( ) ; boolean addedCurrentThread = false ; try { if ( ! ( this . initializingThreads . add ( currentThread ) ) ) return ; addedCurrentThread = true ; newRoots = new HashMap ( ) ; newOtherRoots = new HashMap ( ) ; newSourceAttachments = new HashMap ( ) ; IJavaModel model = JavaModelManager . getJavaModelManager ( ) . getJavaModel ( ) ; IJavaProject [ ] projects ; try { projects = model . getJavaProjects ( ) ; } catch ( JavaModelException e ) { return ; } for ( int i = 0 , length = projects . length ; i < length ; i ++ ) { JavaProject project = ( ( JavaProject ) ( projects [ i ] ) ) ; IClasspathEntry [ ] classpath ; try { <START_BUG> classpath = project . getResolvedClasspath ( true ) ; <END_BUG> } catch ( JavaModelException e ) { continue ; } for ( int j = 0 , classpathLength = classpath . length ; j < classpathLength ; j ++ ) { IClasspathEntry entry = classpath [ j ] ; if ( ( entry . getEntryKind ( ) ) == ( IClasspathEntry . CPE_PROJECT ) ) continue ; IPath path = entry . getPath ( ) ; if ( ( newRoots . get ( path ) ) == null ) { newRoots . put ( path , new DeltaProcessor . RootInfo ( project , path , ( ( ClasspathEntry ) ( entry ) ) . fullInclusionPatternChars ( ) , ( ( ClasspathEntry ) ( entry ) ) . fullExclusionPatternChars ( ) , entry . getEntryKind ( ) ) ) ; } else { ArrayList rootList = ( ( ArrayList ) ( newOtherRoots . get ( path ) ) ) ; if ( rootList == null ) { rootList = new ArrayList ( ) ; newOtherRoots . put ( path , rootList ) ; } rootList . add ( new DeltaProcessor . RootInfo ( project , path , ( ( ClasspathEntry ) ( entry ) ) . fullInclusionPatternChars ( ) , ( ( ClasspathEntry ) ( entry ) ) . fullExclusionPatternChars ( ) , entry . getEntryKind ( ) ) ) ; } if ( ( entry . getEntryKind ( ) ) != ( IClasspathEntry . CPE_LIBRARY ) ) continue ; QualifiedName qName = new QualifiedName ( JavaCore . PLUGIN_ID , ( "sourceattachment:<seq2seq4repair_space>" + ( path . toOSString ( ) ) ) ) ; String propertyString = null ; try { propertyString = ResourcesPlugin . getWorkspace ( ) . getRoot ( ) . getPersistentProperty ( qName ) ; } catch ( CoreException e ) { continue ; } IPath sourceAttachmentPath ; if ( propertyString != null ) { int index = propertyString . lastIndexOf ( PackageFragmentRoot . ATTACHMENT_PROPERTY_DELIMITER ) ; sourceAttachmentPath = ( index < 0 ) ? new Path ( propertyString ) : new Path ( propertyString . substring ( 0 , index ) ) ; } else { sourceAttachmentPath = entry . getSourceAttachmentPath ( ) ; } if ( sourceAttachmentPath != null ) { newSourceAttachments . put ( sourceAttachmentPath , path ) ; } } } } finally { if ( addedCurrentThread ) { this . initializingThreads . remove ( currentThread ) ; } } } synchronized ( this ) { this . oldRoots = this . roots ; this . oldOtherRoots = this . otherRoots ; if ( ( this . rootsAreStale ) && ( newRoots != null ) ) { this . roots = newRoots ; this . otherRoots = newOtherRoots ; this . sourceAttachments = newSourceAttachments ; this . rootsAreStale = false ; } } } public synchronized void recordProjectUpdate ( DeltaProcessingState . ProjectUpdateInfo newInfo ) { } public synchronized DeltaProcessingState . ProjectUpdateInfo [ ] removeAllProjectUpdates ( ) { } public void removeElementChangedListener ( IElementChangedListener listener ) { } public void removePreResourceChangedListener ( IResourceChangeListener listener ) { } public void resourceChanged ( final IResourceChangeEvent event ) { } public synchronized void updateRoots ( IPath containerPath , IResourceDelta containerDelta , DeltaProcessor deltaProcessor ) { } }

Fix:
classpath = project . getResolvedClasspath ( true , false , false ) ;