[bundlerepository] fix the NO_LOCAL_RESOURCES flag

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@919179 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResolverImpl.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResolverImpl.java
index d4e19e3..fc9d2da 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResolverImpl.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResolverImpl.java
@@ -208,10 +208,16 @@
 
         // Clean up the resulting data structures.
         m_requiredSet.removeAll(m_addedSet);
-        m_requiredSet.removeAll(Arrays.asList(locals));
+        if ((flags & NO_LOCAL_RESOURCES) == 0)
+        {
+            m_requiredSet.removeAll(Arrays.asList(locals));
+        }
         m_optionalSet.removeAll(m_addedSet);
         m_optionalSet.removeAll(m_requiredSet);
-        m_optionalSet.removeAll(Arrays.asList(locals));
+        if ((flags & NO_LOCAL_RESOURCES) == 0)
+        {
+            m_optionalSet.removeAll(Arrays.asList(locals));
+        }
 
         // Return final result.
         return result;