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 ; protected void addToParentInfo ( Openable child ) { } public static 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 elementClosed ( Openable element , IResourceDelta delta ) { } protected void elementOpened ( 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 ) { try { this . currentEventType = eventType ; <START_BUG> IJavaModel model = JavaModelManager . getJavaModel ( ResourcesPlugin . getWorkspace ( ) ) ; <END_BUG> if ( ! ( model . isOpen ( ) ) ) { try { model . open ( null ) ; } catch ( JavaModelException e ) { if ( DeltaProcessor . VERBOSE ) { e . printStackTrace ( ) ; } return DeltaProcessor . NO_DELTA ; } } this . initializeRoots ( model ) ; this . currentElement = null ; IResourceDelta [ ] deltas = changes . getAffectedChildren ( ) ; IJavaElementDelta [ ] translatedDeltas = new JavaElementDelta [ deltas . length ] ; for ( int i = 0 ; i < ( deltas . length ) ; i ++ ) { IResourceDelta delta = deltas [ i ] ; IResource res = delta . getResource ( ) ; fCurrentDelta = new JavaElementDelta ( model ) ; IJavaProject projectOfRoot = ( ( IJavaProject ) ( this . roots . get ( res . getFullPath ( ) ) ) ) ; boolean isPkgFragmentRoot = projectOfRoot != null ; int elementType = this . elementType ( res , delta . getKind ( ) , delta . getFlags ( ) , IJavaElement . JAVA_MODEL , isPkgFragmentRoot ) ; this . traverseDelta ( delta , elementType , projectOfRoot , null , DeltaProcessor . IGNORE ) ; translatedDeltas [ i ] = fCurrentDelta ; } Iterator iterator = this . projectsToUpdate . iterator ( ) ; while ( iterator . hasNext ( ) ) { JavaProject project = ( ( JavaProject ) ( iterator . next ( ) ) ) ; project . updatePackageFragmentRoots ( ) ; } return filterRealDeltas ( translatedDeltas ) ; } finally { this . projectsToUpdate = new HashSet ( ) ; } } 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 ) { } private boolean isOnClasspath ( IPath path ) { } protected void updateIndex ( Openable element , IResourceDelta delta ) { } private void updateRootIndex ( IPackageFragmentRoot root , IPackageFragment pkg , IResourceDelta delta ) { } }

Fix:
IJavaModel model = JavaModelManager . getJavaModelManager ( ) . getJavaModel ( ) ;