Buggy code:
public void checkExternalArchiveChanges ( IJavaElement [ ] elementsToRefresh , IProgressMonitor monitor ) throws JavaModelException { } private void checkProjectsBeingAddedOrRemoved ( IResourceDelta delta ) { } private void checkSourceAttachmentChange ( IResourceDelta delta , IResource res ) { } private void close ( Openable element ) { } private void contentChanged ( Openable element , IResourceDelta delta ) { } private Openable createElement ( IResource resource , int elementType , DeltaProcessor . RootInfo rootInfo ) { } private boolean createExternalArchiveDelta ( IProgressMonitor monitor ) throws JavaModelException { } private JavaElementDelta currentDelta ( ) { } private void deleting ( IProject project ) { } private void elementAdded ( Openable element , IResourceDelta delta , DeltaProcessor . RootInfo rootInfo ) { } private void elementRemoved ( Openable element , IResourceDelta delta , DeltaProcessor . RootInfo rootInfo ) { } private int elementType ( IResource res , int kind , int parentType , DeltaProcessor . RootInfo rootInfo ) { } public void flush ( ) { } private DeltaProcessor . RootInfo enclosingRootInfo ( IPath path , int kind ) { } public void fire ( IJavaElementDelta customDelta , int eventType ) { } private void firePreAutoBuildDelta ( IJavaElementDelta deltaToNotify , IElementChangedListener [ ] listeners , int [ ] listenerMask , int listenerCount ) { } private void firePostChangeDelta ( IJavaElementDelta deltaToNotify , IElementChangedListener [ ] listeners , int [ ] listenerMask , int listenerCount ) { } private void fireReconcileDelta ( IElementChangedListener [ ] listeners , int [ ] listenerMask , int listenerCount ) { } public void initializeRoots ( ) { this . oldRoots = ( ( this . roots ) == null ) ? new HashMap ( ) : this . roots ; this . oldOtherRoots = ( ( this . otherRoots ) == null ) ? new HashMap ( ) : this . otherRoots ; if ( ! ( rootsAreStale ) ) return ; this . roots = new HashMap ( ) ; this . otherRoots = new HashMap ( ) ; this . sourceAttachments = new HashMap ( ) ; IJavaModel model = this . manager . getJavaModel ( ) ; IJavaProject [ ] projects ; try { projects = model . getJavaProjects ( ) ; } 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 , new DeltaProcessor . RootInfo ( project , path , ( ( ClasspathEntry ) ( entry ) ) . fullExclusionPatternChars ( ) ) ) ; } else { ArrayList rootList = ( ( ArrayList ) ( this . otherRoots . get ( path ) ) ) ; if ( rootList == null ) { rootList = new ArrayList ( ) ; this . otherRoots . put ( path , rootList ) ; } rootList . add ( new DeltaProcessor . RootInfo ( project , path , ( ( ClasspathEntry ) ( entry ) ) . fullExclusionPatternChars ( ) ) ) ; } if ( ( entry . getEntryKind ( ) ) != ( IClasspathEntry . CPE_LIBRARY ) ) continue ; QualifiedName qName = new QualifiedName ( JavaCore . PLUGIN_ID , ( "sourceattachment:<seq2seq4repair_space>" + ( path . toOSString ( ) ) ) ) ; String propertyString = null ; try { propertyString = ResourcesPlugin . getWorkspace ( ) . getRoot ( ) . getPersistentProperty ( qName ) ; } catch ( CoreException e ) { continue ; } IPath sourceAttachmentPath ; if ( propertyString != null ) { <START_BUG> int index = propertyString . lastIndexOf ( JarPackageFragmentRoot . ATTACHMENT_PROPERTY_DELIMITER ) ; <END_BUG> sourceAttachmentPath = ( index < 0 ) ? new Path ( propertyString ) : new Path ( propertyString . substring ( 0 , index ) ) ; } else { sourceAttachmentPath = entry . getSourceAttachmentPath ( ) ; } if ( sourceAttachmentPath != null ) { this . sourceAttachments . put ( sourceAttachmentPath , path ) ; } } } this . rootsAreStale = false ; } private boolean isAffectedBy ( IResourceDelta rootDelta ) { } private boolean isResFilteredFromOutput ( DeltaProcessor . OutputsInfo info , IResource res , int elementType ) { } private void notifyListeners ( IJavaElementDelta deltaToNotify , int eventType , IElementChangedListener [ ] listeners , int [ ] listenerMask , int listenerCount ) { } private IJavaElementDelta mergeDeltas ( Collection deltas ) { } private void nonJavaResourcesChanged ( Openable element , IResourceDelta delta ) throws JavaModelException { } private ArrayList otherRootsInfo ( IPath path , int kind ) { } private DeltaProcessor . OutputsInfo outputsInfo ( DeltaProcessor . RootInfo rootInfo , IResource res ) { } private void performPreBuildCheck ( IResourceDelta delta , IJavaElement parent ) { } private void popUntilPrefixOf ( IPath path ) { } private IJavaElementDelta processResourceDelta ( IResourceDelta changes ) { } void reconcileClasspathFileUpdate ( IResourceDelta delta , JavaProject project ) { } void reconcilePreferenceFileUpdate ( IResourceDelta delta , IFile file , JavaProject project ) { } private void refreshNamelookups ( ) { } private void refreshPackageFragmentRoots ( ) { } public void registerJavaModelDelta ( IJavaElementDelta delta ) { } private void removeFromParentInfo ( Openable child ) { } public void resourceChanged ( IResourceChangeEvent event ) { } private DeltaProcessor . RootInfo rootInfo ( IPath path , int kind ) { } private void startDeltas ( ) { }

Fix:
int index = propertyString . lastIndexOf ( PackageFragmentRoot . ATTACHMENT_PROPERTY_DELIMITER ) ;