Buggy code:
public class DeltaProcessor { static final int IGNORE = 0 ; static final int SOURCE = 1 ; static final int BINARY = 2 ; protected JavaElementDelta fCurrentDelta ; protected IndexManager indexManager = new IndexManager ( ) ; Map roots ; Map otherRoots ; Openable currentElement ; int currentEventType ; HashSet projectsToUpdate = new HashSet ( ) ; static final IJavaElementDelta [ ] NO_DELTA = new IJavaElementDelta [ 0 ] ; public static boolean VERBOSE = false ; void addDependentsToProjectsToUpdate ( IPath projectPath ) { } void addToProjectsToUpdateWithDependents ( IProject project ) { } protected void addToParentInfo ( Openable child ) { } public void performPreBuildCheck ( IResourceDelta delta , IJavaElement parent ) { } protected static void close ( Openable element ) { } private void cloneCurrentDelta ( IJavaProject project , IPackageFragmentRoot root ) { } protected void contentChanged ( Openable element , IResourceDelta delta ) { } protected Openable createElement ( IResource resource , int elementType , IJavaProject project ) { } protected void elementAdded ( Openable element , IResourceDelta delta ) { } protected void elementRemoved ( Openable element , IResourceDelta delta ) { } protected IJavaElementDelta [ ] filterRealDeltas ( IJavaElementDelta [ ] deltas ) { } protected boolean hasJavaNature ( IResource resource ) { } private JavaModelException newInvalidElementType ( ) { } protected void nonJavaResourcesChanged ( Openable element , IResourceDelta delta ) throws JavaModelException { } private void popUntilPrefixOf ( IPath path ) { } public IJavaElementDelta [ ] processResourceDelta ( IResourceDelta changes , int eventType ) { } private boolean updateCurrentDeltaAndIndex ( IResourceDelta delta , int elementType , IJavaProject project ) throws JavaModelException { } protected void removeFromParentInfo ( Openable child ) { } protected boolean traverseDelta ( IResourceDelta delta , int elementType , IJavaProject currentProject , IPath currentOutput , int outputTraverseMode ) { } private int elementType ( IResource res , int kind , int flags , int parentType , boolean isPkgFragmentRoot ) { } private void initializeRoots ( IJavaModel model ) { this . roots = new HashMap ( ) ; this . otherRoots = new HashMap ( ) ; IJavaProject [ ] projects ; try { <START_BUG> projects = model . getJavaProjects ( ) ; <END_BUG> } catch ( JavaModelException e ) { return ; } for ( int i = 0 , length = projects . length ; i < length ; i ++ ) { IJavaProject project = projects [ i ] ; IClasspathEntry [ ] classpath ; try { classpath = project . getResolvedClasspath ( true ) ; } 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 ( ( this . roots . get ( path ) ) == null ) { this . roots . put ( path , project ) ; } else { HashSet set = ( ( HashSet ) ( this . otherRoots . get ( path ) ) ) ; if ( set == null ) { set = new HashSet ( ) ; this . otherRoots . put ( path , set ) ; } set . add ( project ) ; } } } } private boolean isOnClasspath ( IPath path ) { } protected void updateIndex ( Openable element , IResourceDelta delta ) { } private void updateRootIndex ( IPackageFragmentRoot root , IPackageFragment pkg , IResourceDelta delta ) { } }

Fix:
projects = ( ( JavaModel ) ( model ) ) . getOldJavaProjectsList ( ) ;