felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pde...@apache.org
Subject svn commit: r1067887 - /felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/DescriptorParser.java
Date Mon, 07 Feb 2011 09:27:47 GMT
Author: pderop
Date: Mon Feb  7 09:27:45 2011
New Revision: 1067887

URL: http://svn.apache.org/viewvc?rev=1067887&view=rev
Log:
improved exception message when the type of a json descriptor entry is not provided

Modified:
    felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/DescriptorParser.java

Modified: felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/DescriptorParser.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/DescriptorParser.java?rev=1067887&r1=1067886&r2=1067887&view=diff
==============================================================================
--- felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/DescriptorParser.java
(original)
+++ felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/DescriptorParser.java
Mon Feb  7 09:27:45 2011
@@ -53,11 +53,17 @@ public class DescriptorParser
         JSONMetaData serviceMetaData = new JSONMetaData(json);
 
         String type = (String) json.get("type");
+        if (type == null)
+        {
+            throw new IllegalArgumentException("Invalid descriptor"
+                    + ": no \"type\" parameter found in first line");
+        }
+
         AbstractBuilder builder = m_builders.get(type);
         if (builder == null)
         {
             throw new IllegalArgumentException("Invalid descriptor"
-                    + ": no \"type\" parameter found in first line");
+                    + ": invalid \"type\" parameter found in first line");
         }
 
         // Parse the rest of the lines (dependencies)



Mime
View raw message