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 2009/01/23 17:01:54 UTC

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

Author: rickhall
Date: Fri Jan 23 08:01:53 2009
New Revision: 737064

URL: http://svn.apache.org/viewvc?rev=737064&view=rev
Log:
Verify that package name is not empty for imports and exports. (FELIX-897)

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=737064&r1=737063&r2=737064&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 Fri Jan 23 08:01:53 2009
@@ -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];