An unresolvable module should have its candidates removed from the candidates
map to avoid faulty wirings to it. (FELIX-978)


git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@751767 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/framework/src/main/java/org/apache/felix/framework/searchpolicy/Resolver.java b/framework/src/main/java/org/apache/felix/framework/searchpolicy/Resolver.java
index ff59a11..c61aae8 100644
--- a/framework/src/main/java/org/apache/felix/framework/searchpolicy/Resolver.java
+++ b/framework/src/main/java/org/apache/felix/framework/searchpolicy/Resolver.java
@@ -515,6 +515,11 @@
                 // resolve exception unless the import is optional.
                 if ((candidates.length == 0) && !reqs[reqIdx].isOptional())
                 {
+                    // Since the target module cannot resolve, remove its
+                    // candidates set list from the candidates map, since
+                    // it is invalid.
+                    candidatesMap.remove(targetModule);
+
                     // If we have received an exception while trying to populate
                     // the candidates map, rethrow that exception since it might
                     // be useful. NOTE: This is not necessarily the "only"