felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r1149247 - /felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/ManifestParser.java
Date Thu, 21 Jul 2011 16:08:35 GMT
Author: rickhall
Date: Thu Jul 21 16:08:32 2011
New Revision: 1149247

URL: http://svn.apache.org/viewvc?rev=1149247&view=rev
Log:
Bundle/host capabilities and host requirement can now have attributes
and directives. (FELIX-2950)

Modified:
    felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/ManifestParser.java

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/ManifestParser.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/ManifestParser.java?rev=1149247&r1=1149246&r2=1149247&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/ManifestParser.java
(original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/ManifestParser.java
Thu Jul 21 16:08:32 2011
@@ -127,7 +127,7 @@ public class ManifestParser
                     hostAttrs.put(BundleRevision.HOST_NAMESPACE, value);
                     capList.add(new BundleCapabilityImpl(
                         owner, BundleRevision.HOST_NAMESPACE,
-                        Collections.EMPTY_MAP,
+                        bundleCap.getDirectives(),
                         hostAttrs));
                 }
             }
@@ -138,6 +138,8 @@ public class ManifestParser
             // attach this information to the bundle or host capabilities
             // because fragments don't have those capabilities, but fragments
             // can be singletons too.
+// TODO: OSGi R4.4 - Eventually we will have an identity capability from OBR
+//       that we can use instead of this custom singleton capability.
             if (isSingleton(bundleCap))
             {
                 Map<String, Object> singletonAttrs =
@@ -1321,21 +1323,10 @@ public class ManifestParser
                             + headerMap.get(Constants.FRAGMENT_HOST));
                 }
 
-                // Strip all attributes other than bundle-version.
-                for (Iterator<Entry<String, Object>> it =
-                        clauses.get(0).m_attrs.entrySet().iterator();
-                    it.hasNext(); )
-                {
-                    Entry<String, Object> entry = it.next();
-                    if (!entry.getKey().equals(Constants.BUNDLE_VERSION_ATTRIBUTE))
-                    {
-                        it.remove();
-                    }
-                }
-
                 // If the bundle-version attribute is specified, then convert
                 // it to the proper type.
                 Object value = clauses.get(0).m_attrs.get(Constants.BUNDLE_VERSION_ATTRIBUTE);
+                value = (value == null) ? "0.0.0" : value;
                 if (value != null)
                 {
                     clauses.get(0).m_attrs.put(



Mime
View raw message