### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: model/org/eclipse/jdt/core/JavaCore.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java,v retrieving revision 1.586 diff -u -r1.586 JavaCore.java --- model/org/eclipse/jdt/core/JavaCore.java 11 Oct 2007 11:32:48 -0000 1.586 +++ model/org/eclipse/jdt/core/JavaCore.java 11 Oct 2007 14:25:07 -0000 @@ -82,7 +82,9 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.Hashtable; +import java.util.List; import java.util.Map; +import java.util.Vector; import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IFile; @@ -3373,6 +3375,7 @@ if (monitor != null) monitor.subTask(Messages.javamodel_resetting_source_attachment_properties); final IJavaProject[] projects = manager.getJavaModel().getJavaProjects(); + List storedPaths = new Vector(); for (int i = 0, length = projects.length; i < length; i++) { IClasspathEntry[] classpath; try { @@ -3384,8 +3387,13 @@ if (classpath != null) { for (int j = 0, length2 = classpath.length; j < length2; j++) { IClasspathEntry entry = classpath[j]; - if (entry.getSourceAttachmentPath() != null) - Util.setSourceAttachmentProperty(entry.getPath(), null); + if (entry.getSourceAttachmentPath() != null) { + IPath aPath = entry.getPath(); + if (! storedPaths.contains(aPath)) { + Util.setSourceAttachmentProperty(aPath, null); + storedPaths.add(aPath); + } + } // else source might have been attached by IPackageFragmentRoot#attachSource(...), we keep it } } @@ -3396,7 +3404,7 @@ monitor.subTask(Messages.javamodel_initializing_delta_state); manager.deltaState.rootsAreStale = true; // in case it was already initialized before we cleaned up the source attachment proprties manager.deltaState.initializeRoots(true/*initAfteLoad*/); - + // dummy query for waiting until the indexes are ready if (monitor != null) monitor.subTask(Messages.javamodel_configuring_searchengine);