[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r11745: fixed two concurrent modification bugs when removing (templa (puppetor/trunk/src/de/uniba/wiai/lspi/puppetor/impl)



Author: kloesing
Date: 2007-10-02 05:58:32 -0400 (Tue, 02 Oct 2007)
New Revision: 11745

Modified:
   puppetor/trunk/src/de/uniba/wiai/lspi/puppetor/impl/NetworkImpl.java
   puppetor/trunk/src/de/uniba/wiai/lspi/puppetor/impl/ProxyNodeImpl.java
Log:
fixed two concurrent modification bugs when removing (template) configurations

Modified: puppetor/trunk/src/de/uniba/wiai/lspi/puppetor/impl/NetworkImpl.java
===================================================================
--- puppetor/trunk/src/de/uniba/wiai/lspi/puppetor/impl/NetworkImpl.java	2007-10-02 09:33:39 UTC (rev 11744)
+++ puppetor/trunk/src/de/uniba/wiai/lspi/puppetor/impl/NetworkImpl.java	2007-10-02 09:58:32 UTC (rev 11745)
@@ -1072,13 +1072,15 @@
 
 		// iterate over existing template configuration strings and remove all
 		// configuration strings that have the given configuration key
+		List<String> configurationStringsToRemove = new ArrayList<String>(); 
 		for (String currentConfigurationString : templateConfig) {
 			String currentConfigurationKey = currentConfigurationString
 					.substring(0, currentConfigurationString.indexOf(" "));
 			if (currentConfigurationKey.equals(templateConfigurationKey)) {
-				templateConfig.remove(currentConfigurationString);
+				configurationStringsToRemove.add(currentConfigurationString);
 			}
 		}
+		templateConfig.removeAll(configurationStringsToRemove);
 
 		// log exiting
 		logger

Modified: puppetor/trunk/src/de/uniba/wiai/lspi/puppetor/impl/ProxyNodeImpl.java
===================================================================
--- puppetor/trunk/src/de/uniba/wiai/lspi/puppetor/impl/ProxyNodeImpl.java	2007-10-02 09:33:39 UTC (rev 11744)
+++ puppetor/trunk/src/de/uniba/wiai/lspi/puppetor/impl/ProxyNodeImpl.java	2007-10-02 09:58:32 UTC (rev 11745)
@@ -330,13 +330,15 @@
 
 		// iterate over existing configuration strings and remove all
 		// configuration strings that have the given configuration key
+		List<String> configurationStringsToRemove = new ArrayList<String>();
 		for (String currentConfigurationString : this.configuration) {
 			String currentConfigurationKey = currentConfigurationString
 					.substring(0, currentConfigurationString.indexOf(" "));
 			if (currentConfigurationKey.equals(configurationKey)) {
-				this.configuration.remove(currentConfigurationString);
+				configurationStringsToRemove.add(currentConfigurationString);
 			}
 		}
+		this.configuration.removeAll(configurationStringsToRemove);
 
 		// log exiting
 		this.logger.exiting(this.getClass().getName(), "deleteConfiguration");