Fixed a bug that would cause an unresolvable bundle to be marked as resolved
in certain recursive situations.


git-svn-id: https://svn.apache.org/repos/asf/incubator/felix/trunk@464647 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/framework/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicyCore.java b/framework/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicyCore.java
index d3f496a..f5e282c 100755
--- a/framework/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicyCore.java
+++ b/framework/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicyCore.java
@@ -820,6 +820,12 @@
             // resolve exception unless the import is optional.
             if ((candidates.length == 0) && !imports[impIdx].isOptional())
             {
+                // Since we are not able to resolve the module, we must
+                // remove the module from the resolve map so that subsequent
+                // resolves do not think that the module is resolvable due
+                // to the cycle check at the beginning of this method.
+                resolverMap.remove(module);
+                
                 // If we have received an exception while trying to populate
                 // the resolver map, rethrow that exception since it might
                 // be useful. NOTE: This is not necessarily the "only"