Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Gvozdev2012-01-19 16:39:56 -0500
committerAndrew Gvozdev2012-01-19 16:41:18 -0500
commitc7adafb18b44e3a7c823740329e97a7d3eebf978 (patch)
treec80d4ce4af691e1862cb57f4b7f518211d665ea8
parent533c75662e2f1e431c4a40feb44a6afc578e1b34 (diff)
downloadorg.eclipse.cdt-c7adafb18b44e3a7c823740329e97a7d3eebf978.tar.gz
org.eclipse.cdt-c7adafb18b44e3a7c823740329e97a7d3eebf978.tar.xz
org.eclipse.cdt-c7adafb18b44e3a7c823740329e97a7d3eebf978.zip
bug 284699: Added some annotations/comments
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/ExternalSettingsProviderTests.java95
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/TestExtSettingsProvider.java22
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/CSettingEntryFactory.java38
3 files changed, 80 insertions, 75 deletions
diff --git a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/ExternalSettingsProviderTests.java b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/ExternalSettingsProviderTests.java
index 99046b7692..98418e57d3 100644
--- a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/ExternalSettingsProviderTests.java
+++ b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/ExternalSettingsProviderTests.java
@@ -8,15 +8,16 @@
* Contributors:
* Intel Corporation - Initial API and implementation
* James Blackburn (Broadcom Corp.)
- * Christian Walther (Indel AG) - [335344] test for changing language IDs
- * Raphael Zulliger (Indel AG) - [284699][237771] test having macros with same
- * name but different values in same project
+ * Christian Walther (Indel AG) - bug 335344: test for changing language IDs
+ * Raphael Zulliger (Indel AG) - bug 284699: test having macros with same
+ * name but different values in same project
* configuration
*******************************************************************************/
package org.eclipse.cdt.core.settings.model;
import java.util.Arrays;
import java.util.HashMap;
+
import junit.framework.TestSuite;
import org.eclipse.cdt.core.dom.IPDOMManager;
@@ -33,11 +34,11 @@ import org.eclipse.core.runtime.Path;
public class ExternalSettingsProviderTests extends BaseTestCase{
private static final String PROJ_NAME_PREFIX = "espt_";
ICProject p1, p2, p3, p4, p5, p6;
-
+
public static TestSuite suite() {
return suite(ExternalSettingsProviderTests.class, "_");
}
-
+
@Override
protected void setUp() throws Exception {
p1 = CProjectHelper.createNewStileCProject(PROJ_NAME_PREFIX + "a", IPDOMManager.ID_NO_INDEXER);
@@ -47,7 +48,7 @@ public class ExternalSettingsProviderTests extends BaseTestCase{
p5 = CProjectHelper.createNewStileCProject(PROJ_NAME_PREFIX + "e", IPDOMManager.ID_NO_INDEXER);
p6 = CProjectHelper.createNewStileCProject(PROJ_NAME_PREFIX + "f", IPDOMManager.ID_NO_INDEXER);
}
-
+
/**
* Test adding a external setting provider to p1 -- the contributed paths should appear
* @throws Exception
@@ -56,7 +57,7 @@ public class ExternalSettingsProviderTests extends BaseTestCase{
TestExtSettingsProvider.setVariantNum(0);
CoreModel model = CoreModel.getDefault();
IProject project = p1.getProject();
-
+
ICProjectDescription des = model.getProjectDescription(project);
ICConfigurationDescription cfgDes = des.getConfigurations()[0];
ICLanguageSetting ls = cfgDes.getLanguageSettingForFile(new Path("a.c"), true);
@@ -87,44 +88,44 @@ public class ExternalSettingsProviderTests extends BaseTestCase{
new CSourceEntry(project.getFullPath().append("sp_b"), null, 0),
};
assertTrue(Arrays.equals(newExpectedSourceEntries, sourceEntries));
-
+
// insert entry into the mix; check that the new entry appears
ICLanguageSettingEntry[] newEntries = new ICLanguageSettingEntry[3];
newEntries[0] = expectedEntries[1];
newEntries[1] = new CIncludePathEntry("added", 0);
newEntries[2] = expectedEntries[0];
-
+
ls.setSettingEntries(ICSettingEntry.INCLUDE_PATH, newEntries);
entries = ls.getSettingEntries(ICSettingEntry.INCLUDE_PATH);
-
+
assertEquals(3, entries.length);
assertTrue(Arrays.equals(newEntries, entries));
-
+
newEntries = new ICLanguageSettingEntry[1];
newEntries[0] = expectedEntries[0];
ls.setSettingEntries(ICSettingEntry.INCLUDE_PATH, newEntries);
entries = ls.getSettingEntries(ICSettingEntry.INCLUDE_PATH);
-
+
assertEquals(1, entries.length);
assertTrue(Arrays.equals(newEntries, entries));
-
+
newEntries = new ICLanguageSettingEntry[0];
ls.setSettingEntries(ICSettingEntry.INCLUDE_PATH, newEntries);
entries = ls.getSettingEntries(ICSettingEntry.INCLUDE_PATH);
-
+
assertEquals(0, entries.length);
-
+
ls.setSettingEntries(ICSettingEntry.INCLUDE_PATH, (ICLanguageSettingEntry[])null);
entries = ls.getSettingEntries(ICSettingEntry.INCLUDE_PATH);
assertEquals(2, entries.length);
assertTrue(Arrays.equals(expectedEntries, entries));
}
-
+
public void testCreateCfg() throws Exception {
TestExtSettingsProvider.setVariantNum(0);
CoreModel model = CoreModel.getDefault();
IProject project = p2.getProject();
-
+
ICProjectDescription des = model.getProjectDescription(project);
ICConfigurationDescription cfgDes = des.getConfigurations()[0];
ICLanguageSetting ls = cfgDes.getLanguageSettingForFile(new Path("a.c"), true);
@@ -138,24 +139,24 @@ public class ExternalSettingsProviderTests extends BaseTestCase{
assertTrue(Arrays.equals(expectedSourceEntries, sourceEntries));
String[] extPIds = new String[]{CTestPlugin.PLUGIN_ID + ".testExtSettingsProvider"};
cfgDes.setExternalSettingsProviderIds(extPIds);
-
+
model.setProjectDescription(project, des);
-
+
des = model.getProjectDescription(project, false);
cfgDes = des.getConfigurations()[0];
assertEquals(extPIds.length, cfgDes.getExternalSettingsProviderIds().length);
assertTrue(Arrays.equals(extPIds, cfgDes.getExternalSettingsProviderIds()));
-
+
des = model.getProjectDescription(project);
cfgDes = des.getConfigurations()[0];
assertEquals(extPIds.length, cfgDes.getExternalSettingsProviderIds().length);
assertTrue(Arrays.equals(extPIds, cfgDes.getExternalSettingsProviderIds()));
-
+
String newCfgId = CDataUtil.genId(null);
ICConfigurationDescription cfgDes2 = des.createConfiguration(newCfgId, "cfg2", cfgDes);
assertEquals(extPIds.length, cfgDes2.getExternalSettingsProviderIds().length);
assertTrue(Arrays.equals(extPIds, cfgDes2.getExternalSettingsProviderIds()));
-
+
ls = cfgDes2.getLanguageSettingForFile(new Path("a.c"), true);
entries = ls.getSettingEntries(ICSettingEntry.INCLUDE_PATH);
ICLanguageSettingEntry[] expectedEntries = new ICLanguageSettingEntry[]{
@@ -165,14 +166,14 @@ public class ExternalSettingsProviderTests extends BaseTestCase{
assertTrue(Arrays.equals(expectedEntries, entries));
}
-
+
public void testProviderUpdate() throws Exception {
TestExtSettingsProvider.setVariantNum(0);
CoreModel model = CoreModel.getDefault();
ICProjectDescriptionManager mngr = model.getProjectDescriptionManager();
IProject project = p2.getProject();
-
+
ICProjectDescription des = model.getProjectDescription(project);
ICConfigurationDescription cfgDes = des.getConfigurations()[0];
ICLanguageSetting ls = cfgDes.getLanguageSettingForFile(new Path("a.c"), true);
@@ -186,7 +187,7 @@ public class ExternalSettingsProviderTests extends BaseTestCase{
assertTrue(Arrays.equals(expectedSourceEntries, sourceEntries));
String[] extPIds = new String[]{CTestPlugin.PLUGIN_ID + ".testExtSettingsProvider"};
cfgDes.setExternalSettingsProviderIds(extPIds);
-
+
ls = cfgDes.getLanguageSettingForFile(new Path("a.c"), true);
entries = ls.getSettingEntries(ICSettingEntry.INCLUDE_PATH);
@@ -197,19 +198,19 @@ public class ExternalSettingsProviderTests extends BaseTestCase{
assertTrue(Arrays.equals(expectedEntries, entries));
model.setProjectDescription(project, des);
-
+
des = model.getProjectDescription(project);
cfgDes = des.getConfigurations()[0];
ls = cfgDes.getLanguageSettingForFile(new Path("a.c"), true);
entries = ls.getSettingEntries(ICSettingEntry.INCLUDE_PATH);
assertTrue(Arrays.equals(expectedEntries, entries));
-
+
ICLanguageSettingEntry[] expectedEntries2 = new ICLanguageSettingEntry[]{
new CIncludePathEntry("ip_a2", 0),
new CIncludePathEntry("ip_b2", 0),
};
TestExtSettingsProvider.setVariantNum(1);
-
+
mngr.updateExternalSettingsProviders(extPIds, null);
des = model.getProjectDescription(project);
cfgDes = des.getConfigurations()[0];
@@ -217,14 +218,14 @@ public class ExternalSettingsProviderTests extends BaseTestCase{
entries = ls.getSettingEntries(ICSettingEntry.INCLUDE_PATH);
assertTrue(Arrays.equals(expectedEntries2, entries));
}
-
+
public void testRestoreDefaults() throws Exception {
TestExtSettingsProvider.setVariantNum(0);
CoreModel model = CoreModel.getDefault();
ICProjectDescriptionManager mngr = model.getProjectDescriptionManager();
IProject project = p4.getProject();
-
+
ICProjectDescription des = model.getProjectDescription(project);
ICConfigurationDescription cfgDes = des.getConfigurations()[0];
ICLanguageSetting ls = cfgDes.getLanguageSettingForFile(new Path("a.c"), true);
@@ -238,7 +239,7 @@ public class ExternalSettingsProviderTests extends BaseTestCase{
assertTrue(Arrays.equals(expectedSourceEntries, sourceEntries));
String[] extPIds = new String[]{CTestPlugin.PLUGIN_ID + ".testExtSettingsProvider"};
cfgDes.setExternalSettingsProviderIds(extPIds);
-
+
ls = cfgDes.getLanguageSettingForFile(new Path("a.c"), true);
entries = ls.getSettingEntries(ICSettingEntry.INCLUDE_PATH);
@@ -249,7 +250,7 @@ public class ExternalSettingsProviderTests extends BaseTestCase{
assertTrue(Arrays.equals(expectedEntries, entries));
model.setProjectDescription(project, des);
-
+
des = model.getProjectDescription(project);
cfgDes = des.getConfigurations()[0];
ls = cfgDes.getLanguageSettingForFile(new Path("a.c"), true);
@@ -263,7 +264,7 @@ public class ExternalSettingsProviderTests extends BaseTestCase{
cfgDes.setSourceEntries(null);
expectedSourceEntries = new ICSourceEntry[]{
new CSourceEntry(project.getFullPath().append("sp_a"), null, 0),
- new CSourceEntry(project.getFullPath().append("sp_b"), null, 0),
+ new CSourceEntry(project.getFullPath().append("sp_b"), null, 0),
};
sourceEntries = cfgDes.getSourceEntries();
assertEquals(2, sourceEntries.length);
@@ -329,7 +330,7 @@ public class ExternalSettingsProviderTests extends BaseTestCase{
assertTrue(Arrays.equals(cfgDes.getSourceEntries(), makeProjectRelativePath(project, provided)));
break;
default:
- fail("Unhandled entry_kind: " + kind);
+ fail("Unhandled entry_kind: " + kind);
}
}
}
@@ -345,11 +346,11 @@ public class ExternalSettingsProviderTests extends BaseTestCase{
for (int i = 0; i < input.length; i ++) {
switch (input[i].getKind()) {
case ICSettingEntry.OUTPUT_PATH:
- out[i] = new COutputEntry(project.getFullPath().append(input[i].getValue()),
+ out[i] = new COutputEntry(project.getFullPath().append(input[i].getValue()),
((ICOutputEntry)input[i]).getExclusionPatterns(), input[i].getFlags());
break;
case ICSettingEntry.SOURCE_PATH:
- out[i] = new CSourceEntry(project.getFullPath().append(input[i].getValue()),
+ out[i] = new CSourceEntry(project.getFullPath().append(input[i].getValue()),
((ICSourceEntry)input[i]).getExclusionPatterns(), input[i].getFlags());
break;
}
@@ -366,14 +367,14 @@ public class ExternalSettingsProviderTests extends BaseTestCase{
CoreModel model = CoreModel.getDefault();
ICProjectDescriptionManager mngr = model.getProjectDescriptionManager();
IProject project = p5.getProject();
-
+
// add external settings provider
ICProjectDescription des = model.getProjectDescription(project);
ICConfigurationDescription cfgDes = des.getConfigurations()[0];
String[] extPIds = new String[]{TestExtSettingsProvider.TEST_EXTERNAL_PROVIDER_ID};
cfgDes.setExternalSettingsProviderIds(extPIds);
model.setProjectDescription(project, des);
-
+
// read out the settings it caused
des = model.getProjectDescription(project, false);
cfgDes = des.getConfigurations()[0];
@@ -382,31 +383,31 @@ public class ExternalSettingsProviderTests extends BaseTestCase{
for (ICLanguageSetting s: root.getLanguageSettings()) {
languageSettingsById.put(s.getLanguageId(), s);
}
-
+
ICLanguageSetting ls;
ICLanguageSettingEntry[] entries;
ICLanguageSettingEntry[] expectedEntriesSet = new ICLanguageSettingEntry[]{
new CMacroEntry("m_c", "mv_c", 0)
};
ICLanguageSettingEntry[] expectedEntriesUnset = new ICLanguageSettingEntry[] {};
-
+
// setting should be present for assembly but not for C
ls = languageSettingsById.get("org.eclipse.cdt.core.assembly");
assertNotNull(ls);
entries = ls.getSettingEntries(ICSettingEntry.MACRO);
assertEquals(1, entries.length);
assertTrue(Arrays.equals(expectedEntriesSet, entries));
-
+
ls = languageSettingsById.get("org.eclipse.cdt.core.gcc");
assertNotNull(ls);
entries = ls.getSettingEntries(ICSettingEntry.MACRO);
assertEquals(0, entries.length);
assertTrue(Arrays.equals(expectedEntriesUnset, entries));
-
+
// update settings provider
TestExtSettingsProvider.setVariantNum(3);
mngr.updateExternalSettingsProviders(extPIds, null);
-
+
// read out the settings it caused
des = model.getProjectDescription(project, false);
cfgDes = des.getConfigurations()[0];
@@ -415,14 +416,14 @@ public class ExternalSettingsProviderTests extends BaseTestCase{
for (ICLanguageSetting s: root.getLanguageSettings()) {
languageSettingsById.put(s.getLanguageId(), s);
}
-
+
// setting should be present for both now
ls = languageSettingsById.get("org.eclipse.cdt.core.gcc");
assertNotNull(ls);
entries = ls.getSettingEntries(ICSettingEntry.MACRO);
assertEquals(1, entries.length);
assertTrue(Arrays.equals(expectedEntriesSet, entries));
-
+
ls = languageSettingsById.get("org.eclipse.cdt.core.assembly");
assertNotNull(ls);
entries = ls.getSettingEntries(ICSettingEntry.MACRO);
@@ -440,7 +441,7 @@ public class ExternalSettingsProviderTests extends BaseTestCase{
CoreModel model = CoreModel.getDefault();
ICProjectDescriptionManager mngr = model.getProjectDescriptionManager();
IProject project = p6.getProject();
-
+
// add external settings provider
ICProjectDescription des = model.getProjectDescription(project);
ICConfigurationDescription cfgDes = des.getConfigurations()[0];
@@ -448,7 +449,7 @@ public class ExternalSettingsProviderTests extends BaseTestCase{
cfgDes.setExternalSettingsProviderIds(extPIds);
ICFolderDescription root = cfgDes.getRootFolderDescription();
model.setProjectDescription(project, des);
-
+
// read out the settings it caused
des = model.getProjectDescription(project, false);
cfgDes = des.getConfigurations()[0];
diff --git a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/TestExtSettingsProvider.java b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/TestExtSettingsProvider.java
index e8f16b813b..36d5c3d5f8 100644
--- a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/TestExtSettingsProvider.java
+++ b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/TestExtSettingsProvider.java
@@ -7,9 +7,9 @@
*
* Contributors:
* Intel Corporation - Initial API and implementation
- * Christian Walther (Indel AG) - [335344] test for changing language IDs
- * Raphael Zulliger (Indel AG) - [284699][237771] test having macros with same
- * name but different values in same project
+ * Christian Walther (Indel AG) - bug 335344: test for changing language IDs
+ * Raphael Zulliger (Indel AG) - bug 284699: test having macros with same
+ * name but different values in same project
* configuration
*******************************************************************************/
package org.eclipse.cdt.core.settings.model;
@@ -19,7 +19,7 @@ import org.eclipse.cdt.core.testplugin.CTestPlugin;
import org.eclipse.core.resources.IProject;
public class TestExtSettingsProvider extends CExternalSettingProvider {
-
+
public static final String TEST_EXTERNAL_PROVIDER_ID = CTestPlugin.PLUGIN_ID + ".testExtSettingsProvider";
private static CExternalSetting[] SETTINGS_1 = new CExternalSetting[]{
@@ -42,7 +42,7 @@ public class TestExtSettingsProvider extends CExternalSettingProvider {
new COutputEntry("op_b", null, 0),
})
};
-
+
private static CExternalSetting[] SETTINGS_2 = new CExternalSetting[]{
new CExternalSetting(null, null, null, new ICSettingEntry[]{
new CIncludePathEntry("ip_a2", 0),
@@ -75,7 +75,7 @@ public class TestExtSettingsProvider extends CExternalSettingProvider {
}
)
};
-
+
private static CExternalSetting[] SETTINGS_4 = new CExternalSetting[]{
new CExternalSetting(
new String[]{
@@ -109,28 +109,28 @@ public class TestExtSettingsProvider extends CExternalSettingProvider {
}
)
};
-
+
public static final CExternalSetting[][] SETTINGS_VARIANTS = new CExternalSetting[][]{
- SETTINGS_1,
+ SETTINGS_1,
SETTINGS_2,
SETTINGS_3,
SETTINGS_4,
SETTINGS_5};
private static int variantNum;
-
+
@Override
public CExternalSetting[] getSettings(IProject project,
ICConfigurationDescription cfg) {
return SETTINGS_VARIANTS[variantNum].clone();
}
-
+
public static void setVariantNum(int num){
if(num < 0 || num >= SETTINGS_VARIANTS.length)
throw new IllegalArgumentException();
variantNum = num;
}
-
+
public static int getVariantNum(){
return variantNum;
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/CSettingEntryFactory.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/CSettingEntryFactory.java
index 2f9eabeef0..c611974c6e 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/CSettingEntryFactory.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/CSettingEntryFactory.java
@@ -7,7 +7,7 @@
*
* Contributors:
* Intel Corporation - Initial API and implementation
- * Raphael Zulliger (Indel AG) - [284699][237771] fixing issues when using same
+ * Raphael Zulliger (Indel AG) - bug 284699: fixing issues when using same
* macro names with different values
*******************************************************************************/
package org.eclipse.cdt.core.settings.model.util;
@@ -21,14 +21,18 @@ import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
import org.eclipse.cdt.core.settings.model.ICSettingEntry;
import org.eclipse.core.runtime.IPath;
+/**
+ * Cache of setting entries stored with multidimentional maps.
+ * See bug 284699 comment 7 for a possible insight into it.
+ */
public class CSettingEntryFactory {
private static final HashSet<IPath> EMPTY_SET = new HashSet<IPath>(0);
-
+
private KindBasedStore<HashMap<String, ?>> fStore = new KindBasedStore<HashMap<String, ?>>(false);
-
- private <K, V> HashMap<String, HashMap<K, V>> getNameMap(int kind, boolean create, HashMap<K, V> type){
+
+ private <K, V> HashMap<String, HashMap<K, V>> getNameMap(int kind, boolean create){
@SuppressWarnings("unchecked")
- HashMap<String, HashMap<K, V>> map = (HashMap<String, HashMap<K, V>>) fStore.get(kind);
+ HashMap<String/*name*/, HashMap<K, V>> map = (HashMap<String, HashMap<K, V>>) fStore.get(kind);
if(map == null && create){
map = new HashMap<String, HashMap<K, V>>();
fStore.put(kind, map);
@@ -36,18 +40,18 @@ public class CSettingEntryFactory {
return map;
}
- private <K, V> HashMap<K, V> getValueMap(String name, boolean create, HashMap<K, V> type){
- HashMap<String, HashMap<K, V>> nameMap = getNameMap(ICSettingEntry.MACRO, create, (HashMap<K, V>)null);
+ private HashMap<String, HashMap<Integer, ICSettingEntry>> getValueMap(String name, boolean create){
+ HashMap<String/*name*/, HashMap<String/*value*/, HashMap<Integer/*flags*/, ICSettingEntry>>> nameMap = getNameMap(ICSettingEntry.MACRO, create);
if(nameMap != null){
return getMap(nameMap, name, create);
}
return null;
}
- private HashMap<Integer, ICSettingEntry> getFlagMap(int kind, String name, String value, IPath[] exclusionPatters, boolean create){
+ private HashMap<Integer, ICSettingEntry> getFlagMap(int kind, String name, String value, IPath[] exclusionPatterns, boolean create){
switch(kind){
case ICSettingEntry.MACRO:
- HashMap<String, HashMap<Integer, ICSettingEntry>> valueMap = getValueMap(name, create, (HashMap<String, HashMap<Integer, ICSettingEntry>>)null);
+ HashMap<String, HashMap<Integer, ICSettingEntry>> valueMap = getValueMap(name, create);
if(valueMap != null){
return getMap(valueMap, value, create);
}
@@ -56,27 +60,27 @@ public class CSettingEntryFactory {
case ICSettingEntry.OUTPUT_PATH:
HashMap<HashSet<IPath>, HashMap<Integer, ICSettingEntry>> excPatternMap = getExclusionPatternsMap(kind, name, create);
if(excPatternMap != null){
- HashSet<IPath> setKey = exclusionPatters == null || exclusionPatters.length == 0 ? EMPTY_SET : new HashSet<IPath>(Arrays.asList(exclusionPatters));
+ HashSet<IPath> setKey = exclusionPatterns == null || exclusionPatterns.length == 0 ? EMPTY_SET : new HashSet<IPath>(Arrays.asList(exclusionPatterns));
return getMap(excPatternMap, setKey, create);
}
return null;
default:
- HashMap<String, HashMap<Integer, ICSettingEntry>> nameMap = getNameMap(kind, create, (HashMap<Integer, ICSettingEntry>)null);
+ HashMap<String, HashMap<Integer, ICSettingEntry>> nameMap = getNameMap(kind, create);
if(nameMap != null){
return getMap(nameMap, name, create);
}
return null;
}
}
-
+
private HashMap<HashSet<IPath>, HashMap<Integer, ICSettingEntry>> getExclusionPatternsMap(int kind, String name, boolean create){
- HashMap<String, HashMap<HashSet<IPath>, HashMap<Integer, ICSettingEntry>>> nameMap = getNameMap(kind, create, (HashMap<HashSet<IPath>, HashMap<Integer, ICSettingEntry>>)null);
+ HashMap<String/*name*/, HashMap<HashSet<IPath>/*exclusionPatterns*/, HashMap<Integer/*flags*/, ICSettingEntry>>> nameMap = getNameMap(kind, create);
if(nameMap != null){
return getMap(nameMap, name, create);
}
return null;
}
-
+
private static <Key, K, V> HashMap<K, V> getMap(HashMap<Key, HashMap<K, V>> container, Key key, boolean create){
HashMap<K, V> map = container.get(key);
if(map == null && create){
@@ -92,10 +96,10 @@ public class CSettingEntryFactory {
case ICSettingEntry.SOURCE_PATH:
return getEntry(entry.getKind(), entry.getName(), null, ((ICExclusionPatternPathEntry)entry).getExclusionPatterns(), entry.getFlags(), entry, true);
default:
- return getLanguageSettingEntry((ICLanguageSettingEntry)entry);
+ return getLanguageSettingEntry((ICLanguageSettingEntry)entry);
}
}
-
+
public ICLanguageSettingEntry getLanguageSettingEntry(ICLanguageSettingEntry lEntry){
return (ICLanguageSettingEntry)getEntry(lEntry.getKind(), lEntry.getName(), lEntry.getValue(), null, lEntry.getFlags(), lEntry, true);
}
@@ -117,7 +121,7 @@ public class CSettingEntryFactory {
}
return null;
}
-
+
public void clear(){
fStore.clear();
}

Back to the top