Buggy code:
public class DeltaProcessor { protected JavaElementDelta fCurrentDelta ; protected Hashtable fJavaProjectsToUpdate = null ; protected Vector fRootsRemoved = null ; protected boolean fProcessChildren = true ; protected IndexManager indexManager = ( ENABLE_INDEXING ) ? new IndexManager ( ) : null ; protected void addClasspathEntry ( JavaProject project , IClasspathEntry after , IClasspathEntry newEntry ) { } protected void addToParentInfo ( Openable child ) { } protected void basicElementAdded ( Openable element , IResourceDelta delta ) { } public static void checkProjectPropertyFileUpdate ( IResourceDelta delta , IJavaElement parent ) { } protected void clearState ( ) { } protected static void close ( Openable element ) { } protected void closeAffectedElements ( IResourceDelta delta ) { } protected void contentChanged ( Openable element , IResourceDelta delta ) { } protected Openable [ ] createElements ( IResource resource ) { if ( resource == null ) return null ; String extension = resource . getFileExtension ( ) ; extension = ( extension == null ) ? null : extension . toLowerCase ( ) ; if ( ( "jar" . equals ( extension ) ) || ( "zip" . equals ( extension ) ) ) { IJavaProject [ ] projects = null ; try { projects = JavaModelManager . getJavaModel ( resource . getWorkspace ( ) ) . getJavaProjects ( ) ; } catch ( JavaModelException e ) { return null ; } Vector jars = new Vector ( ) ; for ( int i = 0 , length = projects . length ; i < length ; i ++ ) { IJavaProject project = projects [ i ] ; IPath resourcePath = resource . getFullPath ( ) ; try { <START_BUG> IClasspathEntry [ ] entries = project . getExpandedClasspath ( true ) ; <END_BUG> for ( int j = 0 , length2 = entries . length ; j < length2 ; j ++ ) { IClasspathEntry entry = entries [ j ] ; IPath rootPath = entry . getPath ( ) ; if ( rootPath . equals ( resourcePath ) ) { jars . add ( project . getPackageFragmentRoot ( ( ( IFile ) ( resource ) ) ) ) ; } } } catch ( JavaModelException e ) { } } int size = jars . size ( ) ; if ( size == 0 ) return null ; Openable [ ] result = new Openable [ size ] ; jars . copyInto ( result ) ; return result ; } else { Openable element = ( ( Openable ) ( JavaCore . create ( resource ) ) ) ; if ( element == null ) { return null ; } else { return new Openable [ ] { element } ; } } } 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 ) { } protected boolean isOnClasspath ( IJavaElement element ) { } protected boolean isOpen ( IResource resource ) { } protected IClasspathEntry newClasspathEntry ( IJavaProject project , IClasspathEntry oldEntry , IPath to ) { } protected void nonJavaResourcesChanged ( Openable element , IResourceDelta delta ) throws JavaModelException { } protected void processRemovedRoots ( ) { } public IJavaElementDelta [ ] processResourceDelta ( IResourceDelta changes ) { } protected void removeClasspathEntry ( JavaProject project , IClasspathEntry entry ) { } protected void removeFromParentInfo ( Openable child ) { } protected void resetNonJavaResourcesForPackageFragmentRoots ( JavaProject project ) throws JavaModelException { } protected void rootRemoved ( IPackageFragmentRoot root ) { } protected void traverseDelta ( IResourceDelta delta , Openable parentElement ) { } protected void updateClasspaths ( boolean saveClasspath ) { } protected void updateIndex ( Openable element , IResourceDelta delta ) { } protected void updateProject ( IJavaProject project ) { } }

Fix:
IClasspathEntry [ ] entries = ( ( JavaProject ) ( project ) ) . getExpandedClasspath ( true ) ;