summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Salinas2012-03-20 16:31:02 (EDT)
committerVivian Kong2012-03-20 16:31:02 (EDT)
commit48e2f643ac98a6db82ae237542fd009dae245e5a (patch)
tree77fa1eaf3697664ec7390dd98a3d677af9e50966
parent4fc35b218588ff007292fd36a03d96b32d21ea0b (diff)
downloadorg.eclipse.cdt-48e2f643ac98a6db82ae237542fd009dae245e5a.zip
org.eclipse.cdt-48e2f643ac98a6db82ae237542fd009dae245e5a.tar.gz
org.eclipse.cdt-48e2f643ac98a6db82ae237542fd009dae245e5a.tar.bz2
Bug 374442 - Refresh resource by build configuration - fix JUnit Tests
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/RefreshScopeManager.java25
1 files changed, 24 insertions, 1 deletions
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/RefreshScopeManager.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/RefreshScopeManager.java
index 559e3cf..d8941f9 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/RefreshScopeManager.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/RefreshScopeManager.java
@@ -485,12 +485,35 @@ public class RefreshScopeManager {
String configName = child.getAttribute(CONFIGURATION_ELEMENT_NAME);
loadResourceData(workspaceRoot, project, configName, child.getChildren());
}
- }
+ }
+ // else there are no children, and this is a "new" project.
+ // so initialize it.
+ if (children.length == 0) {
+ initializeConfigMap(project);
+ }
}
}
}
}
+ private void initializeConfigMap(IProject project) {
+ getProjectToConfigurationToResourcesMap();
+ HashMap<String,HashMap<IResource, List<RefreshExclusion>>> configMap = fProjToConfToResToExcluMap.get(project);
+ if (configMap == null) {
+ configMap = new HashMap<String,HashMap<IResource, List<RefreshExclusion>>>();
+ CProjectDescriptionManager descriptionManager = CProjectDescriptionManager.getInstance();
+ ICProjectDescription projectDescription = descriptionManager.getProjectDescription(project, false);
+ ICConfigurationDescription cfgDescs[] = projectDescription.getConfigurations();
+ for (ICConfigurationDescription cfgDesc : cfgDescs) {
+ String configName = cfgDesc.getName();
+ HashMap<IResource, List<RefreshExclusion>> resourceMap = new HashMap<IResource, List<RefreshExclusion>>();
+ resourceMap.put(project, new LinkedList<RefreshExclusion>());
+ configMap.put(configName, resourceMap);
+ }
+ fProjToConfToResToExcluMap.put(project,configMap);
+ }
+ }
+
/**
* @since 5.4
*/