Buggy code:
public class DeltaProcessor { static final IClasspathEntry [ ] UNKNOWN_CLASSPATH = new IClasspathEntry [ ] { } ; protected JavaElementDelta fCurrentDelta ; protected Hashtable fJavaProjectsToUpdate = null ; protected boolean fProcessChildren = true ; protected IndexManager indexManager = ( ENABLE_INDEXING ) ? new IndexManager ( ) : null ; 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 = ( ( JavaProject ) ( 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 isOpen ( IResource resource ) { } protected void nonJavaResourcesChanged ( Openable element , IResourceDelta delta ) throws JavaModelException { } public IJavaElementDelta [ ] processResourceDelta ( IResourceDelta changes ) { } private void updateCurrentDeltaAndIndex ( Openable element , IResourceDelta delta ) { } protected void removeFromParentInfo ( Openable child ) { } protected void resetNonJavaResourcesForPackageFragmentRoots ( JavaProject project ) throws JavaModelException { } protected boolean traverseDelta ( IResourceDelta delta , IClasspathEntry [ ] classpath ) { } private boolean isOnClasspath ( IClasspathEntry [ ] classpath , IResource res ) { } protected void updateClasspaths ( boolean canChangeResource ) { } protected void updateIndex ( Openable element , IResourceDelta delta ) { } protected void updateProject ( IJavaProject project ) { } }

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