FELIX-1621: OBR fails to take bundles into account that are already available in the framework

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@911482 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/LocalRepositoryImpl.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/LocalRepositoryImpl.java
index 093c6df..4614aba 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/LocalRepositoryImpl.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/LocalRepositoryImpl.java
@@ -201,7 +201,10 @@
 
             // Convert bundle manifest header attributes to resource properties.
             convertAttributesToProperties(dict);
-            
+
+            // Convert properties to bundle capability
+            convertAttributesToBundleCapability();
+
             // Convert import package declarations into requirements.
             convertImportPackageToRequirement(dict);
 
@@ -330,6 +333,18 @@
             }
         }
 
+        private void convertAttributesToBundleCapability()
+        {
+            CapabilityImpl cap = new CapabilityImpl();
+            cap.setName("bundle");
+            if (getPresentationName() != null) {
+                cap.addP(Resource.PRESENTATION_NAME, getPresentationName());
+            }
+            cap.addP(Resource.SYMBOLIC_NAME, getSymbolicName());
+            cap.addP(Resource.VERSION, getVersion());
+            addCapability(cap);
+        }
+
         private void convertImportPackageToRequirement(Dictionary dict)
             throws InvalidSyntaxException
         {