From e3e3e5ef70c537d7ba7c5193796280c239649593 Mon Sep 17 00:00:00 2001 From: Andrew Gvozdev Date: Mon, 25 Jan 2010 14:57:54 +0000 Subject: [PATCH] cosmetics: generics --- .../model/util/CSettingEntryFactory.java | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) 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 d1243eb4298..b82fe3530f1 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 @@ -22,19 +22,20 @@ import org.eclipse.core.runtime.IPath; public class CSettingEntryFactory { private static final HashSet EMPTY_SET = new HashSet(0); - private KindBasedStore fStore = new KindBasedStore(false); + private KindBasedStore> fStore = new KindBasedStore>(false); - private HashMap getNameMap(int kind, boolean create){ - HashMap map = (HashMap)fStore.get(kind); + private HashMap> getNameMap(int kind, boolean create, HashMap type){ + @SuppressWarnings("unchecked") + HashMap> map = (HashMap>) fStore.get(kind); if(map == null && create){ - map = new HashMap(); + map = new HashMap>(); fStore.put(kind, map); } return map; } - private HashMap getValueMap(String name, boolean create){ - HashMap nameMap = getNameMap(ICSettingEntry.MACRO, create); + private HashMap getValueMap(String name, boolean create, HashMap type){ + HashMap> nameMap = getNameMap(ICSettingEntry.MACRO, create, (HashMap)null); if(nameMap != null){ return getMap(nameMap, name, create); } @@ -44,21 +45,21 @@ public class CSettingEntryFactory { private HashMap getFlagMap(int kind, String name, String value, IPath[] exclusionPatters, boolean create){ switch(kind){ case ICSettingEntry.MACRO: - HashMap valueMap = getValueMap(name, create); + HashMap> valueMap = getValueMap(name, create, (HashMap>)null); if(valueMap != null){ return getMap(valueMap, name, create); } return null; case ICSettingEntry.SOURCE_PATH: case ICSettingEntry.OUTPUT_PATH: - HashMap excPatternMap = getExclusionPatternsMap(kind, name, create); + HashMap, HashMap> excPatternMap = getExclusionPatternsMap(kind, name, create); if(excPatternMap != null){ HashSet setKey = exclusionPatters == null || exclusionPatters.length == 0 ? EMPTY_SET : new HashSet(Arrays.asList(exclusionPatters)); return getMap(excPatternMap, setKey, create); } return null; default: - HashMap nameMap = getNameMap(kind, create); + HashMap> nameMap = getNameMap(kind, create, (HashMap)null); if(nameMap != null){ return getMap(nameMap, name, create); } @@ -66,18 +67,18 @@ public class CSettingEntryFactory { } } - private HashMap getExclusionPatternsMap(int kind, String name, boolean create){ - HashMap nameMap = getNameMap(kind, create); + private HashMap, HashMap> getExclusionPatternsMap(int kind, String name, boolean create){ + HashMap, HashMap>> nameMap = getNameMap(kind, create, (HashMap, HashMap>)null); if(nameMap != null){ return getMap(nameMap, name, create); } return null; } - private static HashMap getMap(HashMap container, Object key, boolean create){ - HashMap map = (HashMap)container.get(key); + private static HashMap getMap(HashMap> container, Key key, boolean create){ + HashMap map = container.get(key); if(map == null && create){ - map = new HashMap(); + map = new HashMap(); container.put(key, map); } return map;