Bug 9513 - fix delta traversal for nested source roots + remove previous fix in CModelManager
--- a/cdt/cdt_6_0_x/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelManager.java Thu Aug 20 15:14:59 2009 -0500
+++ b/cdt/cdt_6_0_x/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelManager.java Mon Aug 24 10:17:24 2009 -0500
@@ -269,7 +269,7 @@
for (int i = 0; i < children.length; ++i) {
if (children[i] instanceof ISourceRoot) {
ISourceRoot root = (ISourceRoot)children[i];
- if (root.isOnSourceEntry(folder) || isParentOfSourceRoot(root, folder)) {
+ if (root.isOnSourceEntry(folder)) {
// Get the container
IPath path = folder.getFullPath();
path = path.removeFirstSegments(root.getPath().segmentCount());
@@ -1277,19 +1277,4 @@
CCoreInternals.getPDOMManager().preCloseProject(create(project));
}
- /**
- * For nested source roots, checks whether or not a source root is a parent of a given folder
- * @param root - The source root to check against
- * @param folder - Folder to check whether or not the given root is a child
- * @return true is the IFolder is a parent of the ISourceRoot
- */
- public boolean isParentOfSourceRoot(ISourceRoot root, IFolder folder) {
- if (CCorePlugin.showSourceRootsAtTopOfProject()){
- // not nested source roots so no need to check
- return false;
- }
-
- return folder.getFullPath().isPrefixOf(root.getPath());
- }
-
}
--- a/cdt/cdt_6_0_x/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/DeltaProcessor.java Thu Aug 20 15:14:59 2009 -0500
+++ b/cdt/cdt_6_0_x/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/DeltaProcessor.java Mon Aug 24 10:17:24 2009 -0500
@@ -457,11 +457,11 @@
ICElement current = createElement(resource);
updateChildren = updateCurrentDeltaAndIndex(current, delta);
if (current == null) {
- nonCResourcesChanged(parent, delta);
- // no corresponding ICElement - we are done
- return;
+ if (parent != null)
+ nonCResourcesChanged(parent, delta);
} else if (current instanceof ISourceRoot) {
- nonCResourcesChanged(parent, delta);
+ if (parent != null)
+ nonCResourcesChanged(parent, delta);
} else if (current instanceof ICProject) {
ICProject cprj = (ICProject)current;
CModel cModel = CModelManager.getDefault().getCModel();