You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by ri...@apache.org on 2011/08/31 20:16:53 UTC

svn commit: r1163730 - /felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/ManifestParser.java

Author: rickhall
Date: Wed Aug 31 18:16:52 2011
New Revision: 1163730

URL: http://svn.apache.org/viewvc?rev=1163730&view=rev
Log:
The '.' character is not allowed as a package name. (FELIX-3085)

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=1163730&r1=1163729&r2=1163730&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 Wed Aug 31 18:16:52 2011
@@ -355,6 +355,14 @@ public class ManifestParser
                         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 @@ public class ManifestParser
                         "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(