The '.' character is not allowed as a package name. (FELIX-3085)
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1163730 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 c43f141..e0639cb 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
@@ -355,6 +355,14 @@
throw new BundleException(
"Importing java.* packages not allowed: " + pkgName);
}
+ // The character "." has no meaning in the OSGi spec except
+ // when placed on the bundle class path. Some people, however,
+ // mistakenly think it means the default package when imported
+ // or exported. This is not correct. It is invalid.
+ else if (pkgName.equals("."))
+ {
+ throw new BundleException("Imporing '.' is invalid.");
+ }
// Make sure a package name was specified.
else if (pkgName.length() == 0)
{
@@ -741,6 +749,15 @@
"Exporting java.* packages not allowed: "
+ pkgName);
}
+ // The character "." has no meaning in the OSGi spec except
+ // when placed on the bundle class path. Some people, however,
+ // mistakenly think it means the default package when imported
+ // or exported. This is not correct. It is invalid.
+ else if (pkgName.equals("."))
+ {
+ throw new BundleException("Exporing '.' is invalid.");
+ }
+ // Make sure a package name was specified.
else if (pkgName.length() == 0)
{
throw new BundleException(