Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVioleta Georgieva2012-11-26 12:02:36 +0000
committerVioleta Georgieva2012-11-26 12:02:36 +0000
commitc7b7187d609fc64c6d98441c9a1d9f6839bf01c3 (patch)
tree5bd36d7e6555a2093fc9018cb66c8e93ef7c0290
parent873e46f8e3821be7d732638fcea0f2b792973b73 (diff)
downloadorg.eclipse.gemini.naming-c7b7187d609fc64c6d98441c9a1d9f6839bf01c3.tar.gz
org.eclipse.gemini.naming-c7b7187d609fc64c6d98441c9a1d9f6839bf01c3.tar.xz
org.eclipse.gemini.naming-c7b7187d609fc64c6d98441c9a1d9f6839bf01c3.zip
bug 394969: Fixed ConcurrentModificationException thrown during closing context managers.
-rw-r--r--framework/src/main/java/org/eclipse/gemini/naming/ContextManagerServiceFactoryImpl.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/framework/src/main/java/org/eclipse/gemini/naming/ContextManagerServiceFactoryImpl.java b/framework/src/main/java/org/eclipse/gemini/naming/ContextManagerServiceFactoryImpl.java
index 34b6813..443679e 100644
--- a/framework/src/main/java/org/eclipse/gemini/naming/ContextManagerServiceFactoryImpl.java
+++ b/framework/src/main/java/org/eclipse/gemini/naming/ContextManagerServiceFactoryImpl.java
@@ -56,10 +56,14 @@ class ContextManagerServiceFactoryImpl implements ServiceFactory {
protected void closeAll() {
synchronized(m_mapOfManagers) {
- Iterator iterator = m_mapOfManagers.keySet().iterator();
+ Iterator iterator = m_mapOfManagers.entrySet().iterator();
while(iterator.hasNext()) {
- Bundle bundleKey = (Bundle)iterator.next();
- closeContextManager(bundleKey);
+ Map.Entry currentMapEntry = (Map.Entry) iterator.next();
+ Object currentMapEntryValue = currentMapEntry.getValue();
+ if (currentMapEntryValue != null){
+ ((CloseableContextManager)currentMapEntryValue).close();
+ iterator.remove();
+ }
}
}
}

Back to the top