From d7c915bbaa692828c49bafbe126ae05c88f345a4 Mon Sep 17 00:00:00 2001 From: Mikhail Sennikovsky Date: Fri, 10 Aug 2007 16:00:42 +0000 Subject: [PATCH] Fix for [Bug 197486] [Project Model] cannot set exclusion filter on ICSourceEntry for old-style projects --- .../cdt/core/model/tests/CPathEntryTest.java | 2 +- .../cdt/internal/core/model/PathEntryManager.java | 4 ++-- .../model/PathEntryConfigurationDataProvider.java | 14 +++++++------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/CPathEntryTest.java b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/CPathEntryTest.java index e06d50fabf6..96c11bbc2c5 100644 --- a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/CPathEntryTest.java +++ b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/CPathEntryTest.java @@ -228,7 +228,7 @@ public class CPathEntryTest extends BaseTestCase { } - public void _testSetExclusionFilter_Bug197486() throws Exception { + public void testSetExclusionFilter_Bug197486() throws Exception { ICProject testProject = null; try { testProject = CProjectHelper.createCProject("cpathtest", "none", IPDOMManager.ID_NO_INDEXER); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryManager.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryManager.java index 423daf47691..e7fa2eea3bb 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryManager.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryManager.java @@ -412,12 +412,12 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange return null; } - public PathEntryResolveInfo getResolveInfo(ICProject cproject) throws CModelException{ + public PathEntryResolveInfo getResolveInfo(ICProject cproject, boolean useCache) throws CModelException{ PathEntryResolveInfo info = (PathEntryResolveInfo)resolvedInfoMap.get(cproject); if(info == null){ getResolvedPathEntries(cproject); info = (PathEntryResolveInfo)resolvedInfoMap.get(cproject); - } else if(!getResolveInfoValidState(cproject)){ + } else if(!useCache || !getResolveInfoValidState(cproject)){ Object[] resolved = getResolvedPathEntries(cproject, false, false); if(resolved != null) info = (PathEntryResolveInfo)resolved[1]; diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/PathEntryConfigurationDataProvider.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/PathEntryConfigurationDataProvider.java index 4d5ba841b8f..02a30832c7b 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/PathEntryConfigurationDataProvider.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/PathEntryConfigurationDataProvider.java @@ -236,7 +236,7 @@ public class PathEntryConfigurationDataProvider extends throws CoreException { //TODO: check external/reference info here as well. if(!fFactory.isModified(base)){ - return createData(des, base, false); + return createData(des, base, false, true); } @@ -257,13 +257,13 @@ public class PathEntryConfigurationDataProvider extends IPathEntry[] newEntries = (IPathEntry[])list.toArray(new IPathEntry[list.size()]); PathEntryManager.getDefault().setRawPathEntries(cproject, newEntries, new NullProgressMonitor()); - return createData(des, base, false); + return createData(des, base, false, false); } - private CConfigurationData createData(ICConfigurationDescription des, CConfigurationData fallbackData, boolean modifiedFlag) throws CoreException { + private CConfigurationData createData(ICConfigurationDescription des, CConfigurationData fallbackData, boolean modifiedFlag, boolean useCache) throws CoreException { CConfigurationData dataToReturn; try { - dataToReturn = createData(des); + dataToReturn = createData(des, useCache); } catch (Exception e){ if(fallbackData != null) dataToReturn = fallbackData; @@ -288,11 +288,11 @@ public class PathEntryConfigurationDataProvider extends return copy; } - private CfgData createData(ICConfigurationDescription des) throws CoreException{ + private CfgData createData(ICConfigurationDescription des, boolean useCache) throws CoreException{ IProject project = des.getProjectDescription().getProject(); CModelManager manager = CModelManager.getDefault(); ICProject cproject = manager.create(project); - PathEntryResolveInfo rInfo = PathEntryManager.getDefault().getResolveInfo(cproject); + PathEntryResolveInfo rInfo = PathEntryManager.getDefault().getResolveInfo(cproject, useCache); CfgData data = new CfgData(des.getId(), des.getName()); data.initEmptyData(); @@ -350,7 +350,7 @@ public class PathEntryConfigurationDataProvider extends public CConfigurationData loadConfiguration(ICConfigurationDescription des, IProgressMonitor monitor) throws CoreException { - return createData(des, null, false); + return createData(des, null, false, true); } public void removeConfiguration(ICConfigurationDescription des,