Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorMikhail Sennikovsky2007-08-31 09:48:53 +0000
committerMikhail Sennikovsky2007-08-31 09:48:53 +0000
commit30da93f08210cfb194c539312376bedd6671a188 (patch)
tree0692e8a57d318c17526cc0b6ceb08f8e6d2292a0 /build
parent573b065d338f91d27924ec2f217f8f4a0c79a1d8 (diff)
downloadorg.eclipse.cdt-30da93f08210cfb194c539312376bedd6671a188.tar.gz
org.eclipse.cdt-30da93f08210cfb194c539312376bedd6671a188.tar.xz
org.eclipse.cdt-30da93f08210cfb194c539312376bedd6671a188.zip
Fix for [Bug 199222] An internal error occurred during: "CDT Startup"
Diffstat (limited to 'build')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PropertyManager.java62
1 files changed, 34 insertions, 28 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PropertyManager.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PropertyManager.java
index 4f10d4b1760..feb56ada7a8 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PropertyManager.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PropertyManager.java
@@ -187,21 +187,23 @@ public class PropertyManager {
}
protected Properties getPropsFromData(Map data, IBuildObject bo){
- Object oVal = data.get(bo.getId());
- Properties props = null;
- if(oVal instanceof String){
- props = stringToProps((String)oVal);
- data.put(bo.getId(), props);
- } else if (oVal instanceof Properties){
- props = (Properties)oVal;
- }
-
- if(props == null){
- props = new Properties();
- data.put(bo.getId(), props);
- }
+ synchronized (data) {
+ Object oVal = data.get(bo.getId());
+ Properties props = null;
+ if(oVal instanceof String){
+ props = stringToProps((String)oVal);
+ data.put(bo.getId(), props);
+ } else if (oVal instanceof Properties){
+ props = (Properties)oVal;
+ }
+
+ if(props == null){
+ props = new Properties();
+ data.put(bo.getId(), props);
+ }
- return props;
+ return props;
+ }
}
@@ -214,21 +216,25 @@ public class PropertyManager {
protected Properties mapToProps(Map map){
Properties props = null;
- if(map != null && map.size() > 0){
- props = new Properties();
- for(Iterator iter = map.entrySet().iterator(); iter.hasNext();){
- Map.Entry entry = (Map.Entry)iter.next();
- String key = (String)entry.getKey();
- String value = null;
- Object oVal = entry.getValue();
- if(oVal instanceof Properties){
- value = propsToString((Properties)oVal);
- } else if (oVal instanceof String){
- value = (String)oVal;
+ if(map != null){
+ synchronized(map){
+ if(map.size() > 0){
+ props = new Properties();
+ for(Iterator iter = map.entrySet().iterator(); iter.hasNext();){
+ Map.Entry entry = (Map.Entry)iter.next();
+ String key = (String)entry.getKey();
+ String value = null;
+ Object oVal = entry.getValue();
+ if(oVal instanceof Properties){
+ value = propsToString((Properties)oVal);
+ } else if (oVal instanceof String){
+ value = (String)oVal;
+ }
+
+ if(key != null && value != null)
+ props.setProperty(key, value);
+ }
}
-
- if(key != null && value != null)
- props.setProperty(key, value);
}
}

Back to the top