summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorPolina Genova2012-11-26 07:02:36 (EST)
committer Violeta Georgieva2012-11-26 12:18:09 (EST)
commitd77c60f7d9c8d5d40ed0c74ae85c4924f6b258dc (patch)
tree7faff5b07f5b08306523be99dadd5f744d03f1b9
parent508f87508ffd1d92eef744b773842f284a4044b3 (diff)
downloadorg.eclipse.gemini.naming-d77c60f7d9c8d5d40ed0c74ae85c4924f6b258dc.zip
org.eclipse.gemini.naming-d77c60f7d9c8d5d40ed0c74ae85c4924f6b258dc.tar.gz
org.eclipse.gemini.naming-d77c60f7d9c8d5d40ed0c74ae85c4924f6b258dc.tar.bz2
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();
+ }
}
}
}