Verify that package name is not empty for imports and exports. (FELIX-897)


git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@737064 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 78d94fb..a22a0f4 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
@@ -912,6 +912,12 @@
                 pathIdx < clauses[clauseIdx][CLAUSE_PATHS_INDEX].length;
                 pathIdx++)
             {
+                // Make sure a package name was specified.
+                if (((String) clauses[clauseIdx][CLAUSE_PATHS_INDEX][pathIdx]).length() == 0)
+                {
+                    throw new IllegalArgumentException(
+                        "An empty package name was specified: " + header);
+                }
                 // Prepend the package name to the array of attributes.
                 R4Attribute[] attrs = (R4Attribute[]) clauses[clauseIdx][CLAUSE_ATTRIBUTES_INDEX];
                 R4Attribute[] newAttrs = new R4Attribute[attrs.length + 1];
@@ -1005,6 +1011,12 @@
                 pathIdx < clauses[clauseIdx][CLAUSE_PATHS_INDEX].length;
                 pathIdx++)
             {
+                // Make sure a package name was specified.
+                if (((String) clauses[clauseIdx][CLAUSE_PATHS_INDEX][pathIdx]).length() == 0)
+                {
+                    throw new IllegalArgumentException(
+                        "An empty package name was specified: " + header);
+                }
                 // Prepend the package name to the array of attributes.
                 R4Attribute[] attrs = (R4Attribute[]) clauses[clauseIdx][CLAUSE_ATTRIBUTES_INDEX];
                 R4Attribute[] newAttrs = new R4Attribute[attrs.length + 1];