Buggy code:
public class IncrementalImageBuilder extends AbstractImageBuilder { protected IProject fNewProject ; protected IImageContext fImageContext ; protected Hashtable fSourceDeltas ; protected IDelta fImageDelta = null ; protected IImageContext fContextOfLastDelta = null ; protected Vector fAddedPkgOrZips ; protected Vector fRemovedPkgOrZips ; protected Vector fChangedPkgOrZips ; protected Vector fAddedPackageHandles ; protected Vector fRemovedPackageHandles ; protected Vector fChangedPackageHandles ; protected Hashtable fAffectedPackages ; protected Vector fAddedClasses ; protected Vector fRemovedClasses ; protected Vector fChangedClasses ; protected Vector fChangedZips ; protected Hashtable fBuilderTypeTable ; protected IncrementalImageBuilder ( StateImpl oldState , IProject newProject , IImageContext context ) { } protected void addChangedFileNamesFromChangedPackage ( IResourceDelta pkgDelta , Hashtable table ) { } protected void addNewClasses ( ) { } protected void addSourceElement ( SourceEntry newEntry ) { } public void applySourceDelta ( Hashtable deltas ) { } public void applySourceDelta ( IResourceDelta projectDelta ) { } protected void changedSourceElement ( SourceEntry newEntry ) { } protected void cleanUp ( ) { } protected void cleanupUnusedNamespaceNodes ( ) { } protected boolean compareVisibilityAndGender ( TypeStructureEntry tsEntry , IType type ) throws JavaModelException { } protected void compiling ( CompilerCompilationUnit unit ) { } protected void computeAllClasses ( ) { } protected void computeAllPackages ( ) { } protected void computeAllPackages ( IResourceDelta delta , IPackageFragmentRoot [ ] oldRoots , IPackageFragmentRoot [ ] newRoots ) { int status = delta . getKind ( ) ; IPath path = delta . getFullPath ( ) ; IResource rootResource = null ; switch ( delta . getKind ( ) ) { case IResourceDelta . ADDED : for ( int i = 0 ; i < ( newRoots . length ) ; i ++ ) { rootResource = null ; try { rootResource = newRoots [ i ] . getUnderlyingResource ( ) ; } catch ( JavaModelException e ) { } if ( ( rootResource != null ) && ( rootResource . getFullPath ( ) . isPrefixOf ( path ) ) ) { fAddedPkgOrZips . addElement ( path ) ; break ; } } break ; case IResourceDelta . REMOVED : for ( int i = 0 ; i < ( oldRoots . length ) ; i ++ ) { rootResource = null ; try { rootResource = oldRoots [ i ] . getUnderlyingResource ( ) ; } catch ( JavaModelException e ) { } if ( ( rootResource != null ) && ( rootResource . getFullPath ( ) . isPrefixOf ( path ) ) ) { fRemovedPkgOrZips . addElement ( path ) ; break ; } } break ; case IResourceDelta . CHANGED : boolean found = false ; for ( int i = 0 ; i < ( newRoots . length ) ; i ++ ) { rootResource = null ; try { rootResource = newRoots [ i ] . getUnderlyingResource ( ) ; } catch ( JavaModelException e ) { } if ( ( rootResource != null ) && ( rootResource . getFullPath ( ) . isPrefixOf ( path ) ) ) { found = true ; break ; } } if ( ! found ) { for ( int i = 0 ; i < ( oldRoots . length ) ; i ++ ) { rootResource = null ; try { <START_BUG> oldRoots [ i ] . getUnderlyingResource ( ) ; <END_BUG> } catch ( JavaModelException e ) { } if ( ( rootResource != null ) && ( rootResource . getFullPath ( ) . isPrefixOf ( path ) ) ) { found = true ; break ; } } } if ( found ) { if ( ( ! ( fNewState . isZipElement ( path ) ) ) || ( ( ( delta . getFlags ( ) ) & ( IResourceDelta . CONTENT ) ) != 0 ) ) { fChangedPkgOrZips . addElement ( delta ) ; } } break ; } IResourceDelta [ ] children = delta . getAffectedChildren ( ) ; for ( int i = 0 ; i < ( children . length ) ; ++ i ) { String extension = children [ i ] . getFullPath ( ) . getFileExtension ( ) ; if ( ( ( extension == null ) || ( extension . equalsIgnoreCase ( "zip" ) ) ) || ( extension . equalsIgnoreCase ( "jar" ) ) ) { computeAllPackages ( children [ i ] , oldRoots , newRoots ) ; } } } protected void computeNamespaceChanges ( ) { } protected void computeNamespaceChanges ( Hashtable oldTSEntries , String parentTypeName , IType type , Vector vTypeNames ) throws JavaModelException { } protected void computeNamespaceChanges ( PackageElement element , Vector vTypeNames ) { } protected void computeNamespaceChanges ( IPackage pkg ) { } protected void computePackagePrefixChanges ( ) { } protected Hashtable computePackagePrefixes ( PackageMap packageMap ) { } static void dump ( IResourceDelta delta ) { } protected Enumeration getAffectedPackages ( ) { } protected BuilderType getBuilderType ( TypeStructureEntry oldEntry , TypeStructureEntry newEntry ) { } protected BuilderType getBuilderType ( org . eclipse . jdt . internal . core . builder . IType type ) { } public IDelta getImageDelta ( IImageContext imageContext ) { } protected Dictionary getSourceChanges ( IPackage pkgHandle ) { } protected boolean hasPackageMapChanges ( ) { } protected boolean hasSourceEntryChanges ( IPackage pkgHandle ) { } protected void issueIndictments ( Object element , IndictmentSet indicts , boolean transitive ) { } protected void issueIndictments ( DependencyGraph graph , Object element , IndictmentSet indicts , boolean transitive , Hashtable seen ) { } protected void markDependentsAsNeedingCompile ( Object element ) { } protected void markDependentsOfChangedZips ( ) { } protected void markOverlappingTypesAsNeedingCompile ( IPackage pkg ) { } protected void maybeForce ( IPackage pkg ) { } protected void propagatePrincipalStructureByPackageTable ( ) { } protected void recomputeSourceEntriesForChangedPackages ( ) { } protected void removeOldClasses ( ) { } protected void removeSourceElement ( SourceEntry entry ) { } protected void saveBinaryTypes ( PackageElement element ) { } protected void sort ( PackageElement [ ] compileArray ) { } public String toString ( ) { }

Fix:
rootResource = oldRoots [ i ] . getUnderlyingResource ( ) ;