1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

bug 319512: Missing type arguments on managedbuilder.core

This commit is contained in:
Andrew Gvozdev 2011-01-03 20:10:46 +00:00
parent e9ef2d126f
commit 49910542d3

View file

@ -15,8 +15,8 @@ import java.io.ByteArrayOutputStream;
import java.io.IOException; import java.io.IOException;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties; import java.util.Properties;
import org.eclipse.cdt.managedbuilder.core.IBuildObject; import org.eclipse.cdt.managedbuilder.core.IBuildObject;
@ -54,9 +54,9 @@ public class PropertyManager {
private static class LoaddedInfo { private static class LoaddedInfo {
private final IProject fProject; private final IProject fProject;
private final String fCfgId; private final String fCfgId;
private final Map fCfgPropertyMap; private final Map<String, Properties> fCfgPropertyMap;
LoaddedInfo(IProject project, String cfgId, Map cfgPropertyMap){ LoaddedInfo(IProject project, String cfgId, Map<String, Properties> cfgPropertyMap){
fProject = project; fProject = project;
fCfgId = cfgId; fCfgId = cfgId;
fCfgPropertyMap = cfgPropertyMap; fCfgPropertyMap = cfgPropertyMap;
@ -74,7 +74,7 @@ public class PropertyManager {
return fCfgId; return fCfgId;
} }
public Map getProperties(){ public Map<String, Properties> getProperties(){
return fCfgPropertyMap; return fCfgPropertyMap;
} }
@ -130,7 +130,7 @@ public class PropertyManager {
private synchronized void setLoaddedInfo(LoaddedInfo info){ private synchronized void setLoaddedInfo(LoaddedInfo info){
fLoaddedInfo = info; fLoaddedInfo = info;
} }
protected Map getLoaddedData(IConfiguration cfg){ protected Map<String, Properties> getLoaddedData(IConfiguration cfg){
LoaddedInfo info = getLoaddedInfo(); LoaddedInfo info = getLoaddedInfo();
if(info == null) if(info == null)
return null; return null;
@ -181,12 +181,11 @@ public class PropertyManager {
} }
protected Properties loadProperties(IConfiguration cfg, IBuildObject bo){ protected Properties loadProperties(IConfiguration cfg, IBuildObject bo){
Map map = getData(cfg); Map<String, Properties> map = getData(cfg);
return getPropsFromData(map, bo); return getPropsFromData(map, bo);
} }
protected Properties getPropsFromData(Map data, IBuildObject bo){ protected Properties getPropsFromData(Map<String, Properties> data, IBuildObject bo){
synchronized (data) { synchronized (data) {
Object oVal = data.get(bo.getId()); Object oVal = data.get(bo.getId());
Properties props = null; Properties props = null;
@ -208,28 +207,23 @@ public class PropertyManager {
protected void storeData(IConfiguration cfg){ protected void storeData(IConfiguration cfg){
Map map = getLoaddedData(cfg); Map<String, Properties> map = getLoaddedData(cfg);
if(map != null) if(map != null)
storeData(cfg, map); storeData(cfg, map);
} }
protected Properties mapToProps(Map map){ protected Properties mapToProps(Map<String, Properties> map){
Properties props = null; Properties props = null;
if(map != null){ if(map != null){
synchronized(map){ synchronized(map){
if(map.size() > 0){ if(map.size() > 0){
props = new Properties(); props = new Properties();
for(Iterator iter = map.entrySet().iterator(); iter.hasNext();){ for (Entry<String, Properties> entry : map.entrySet()) {
Map.Entry entry = (Map.Entry)iter.next(); String key = entry.getKey();
String key = (String)entry.getKey();
String value = null; String value = null;
Object oVal = entry.getValue(); Properties oVal = entry.getValue();
if(oVal instanceof Properties){ value = propsToString(oVal);
value = propsToString((Properties)oVal);
} else if (oVal instanceof String){
value = (String)oVal;
}
if(key != null && value != null) if(key != null && value != null)
props.setProperty(key, value); props.setProperty(key, value);
@ -283,7 +277,7 @@ public class PropertyManager {
return props; return props;
} }
protected void storeData(IConfiguration cfg, Map map){ protected void storeData(IConfiguration cfg, Map<String, Properties> map){
String str = null; String str = null;
Properties props = mapToProps(map); Properties props = mapToProps(map);
@ -341,8 +335,8 @@ public class PropertyManager {
} }
protected Map getData(IConfiguration cfg){ protected Map<String, Properties> getData(IConfiguration cfg){
Map map = getLoaddedData(cfg); Map<String, Properties> map = getLoaddedData(cfg);
if(map == null){ if(map == null){
map = loadData(cfg); map = loadData(cfg);
@ -353,8 +347,8 @@ public class PropertyManager {
return map; return map;
} }
protected Map loadData(IConfiguration cfg){ protected Map<String, Properties> loadData(IConfiguration cfg){
Map map = null; Map<String, Properties> map = null;
String str = loadString(cfg); String str = loadString(cfg);
Properties props = stringToProps(str); Properties props = stringToProps(str);
@ -362,12 +356,12 @@ public class PropertyManager {
map = propsToMap(props); map = propsToMap(props);
if(map == null) if(map == null)
map = new HashMap(); map = new HashMap<String, Properties>();
return map; return map;
} }
protected Map propsToMap(Properties props){ protected Map<String, Properties> propsToMap(Properties props){
if(props != null) if(props != null)
return new HashMap(props); return new HashMap(props);
return null; return null;
@ -388,7 +382,7 @@ public class PropertyManager {
return cfg; return cfg;
} }
protected void setLoaddedData(IConfiguration cfg, Map data){ protected void setLoaddedData(IConfiguration cfg, Map<String, Properties> data){
if(cfg.getOwner() == null) if(cfg.getOwner() == null)
return; return;