Don't allow generic capabilities or requirements to the osgi.wiring namespace. (FELIX-3618)
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1441207 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/framework/src/main/java/org/apache/felix/framework/util/manifestparser/ManifestParser.java b/framework/src/main/java/org/apache/felix/framework/util/manifestparser/ManifestParser.java
index 707c965..dc7819a 100644
--- a/framework/src/main/java/org/apache/felix/framework/util/manifestparser/ManifestParser.java
+++ b/framework/src/main/java/org/apache/felix/framework/util/manifestparser/ManifestParser.java
@@ -552,6 +552,13 @@
: new SimpleFilter(null, null, SimpleFilter.MATCH_ALL);
for (String path : clause.m_paths)
{
+ if (path.startsWith("osgi.wiring."))
+ {
+ throw new BundleException("Manifest cannot use Require-Capability for '"
+ + path
+ + "' namespace.");
+ }
+
// Create requirement and add to requirement list.
reqList.add(
new BundleRequirementImpl(
@@ -678,12 +685,20 @@
private static List<BundleCapability> convertProvideCapabilities(
List<ParsedHeaderClause> clauses, BundleRevision owner)
+ throws BundleException
{
List<BundleCapability> capList = new ArrayList();
for (ParsedHeaderClause clause : clauses)
{
for (String path : clause.m_paths)
{
+ if (path.startsWith("osgi.wiring."))
+ {
+ throw new BundleException("Manifest cannot use Provide-Capability for '"
+ + path
+ + "' namespace.");
+ }
+
// Create package capability and add to capability list.
capList.add(
new BundleCapabilityImpl(