commit | c7fbf78c83de393d8c783af7530f2f7b28c305b9 | [log] [tgz] |
---|---|---|
author | Marcel Offermans <marrs@apache.org> | Wed May 18 14:34:33 2011 +0000 |
committer | Marcel Offermans <marrs@apache.org> | Wed May 18 14:34:33 2011 +0000 |
tree | 59e27e0b7302de6c67ff1472c43c7ccf8fb9a1a4 | |
parent | dd87a06caa4e0119f2c388426fe788a129acaa39 [diff] |
FELIX-2955 Fixed the bug by making sure that only dependency managers that still have a valid bundle context are returned. git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1124285 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/DependencyManager.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/DependencyManager.java index 9567714..5b16edf 100644 --- a/dependencymanager/core/src/main/java/org/apache/felix/dm/DependencyManager.java +++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/DependencyManager.java
@@ -112,11 +112,15 @@ WeakReference reference = (WeakReference) iterator.next(); DependencyManager manager = (DependencyManager) reference.get(); if (manager != null) { - result.add(manager); + try { + manager.getBundleContext().getBundle(); + result.add(manager); + continue; + } + catch (IllegalStateException e) { + } } - else { - iterator.remove(); - } + iterator.remove(); } } return result;