Author: marrs
Date: Fri Jan 21 12:15:53 2011
New Revision: 1061781

URL: http://svn.apache.org/viewvc?rev=1061781&view=rev
Log:
When the resource processor gets a resource that contains no Designates, which 
might be a bit strange but is allowed according to the spec, the processor 
throws a NPE, when it should just not do any processing. This change does just 
that, and logs the fact that there are no Designates.

Modified:
    
felix/trunk/deploymentadmin/autoconf/src/main/java/org/apache/felix/deployment/rp/autoconf/AutoConfResourceProcessor.java

Modified: 
felix/trunk/deploymentadmin/autoconf/src/main/java/org/apache/felix/deployment/rp/autoconf/AutoConfResourceProcessor.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/deploymentadmin/autoconf/src/main/java/org/apache/felix/deployment/rp/autoconf/AutoConfResourceProcessor.java?rev=1061781&r1=1061780&r2=1061781&view=diff
==============================================================================
--- 
felix/trunk/deploymentadmin/autoconf/src/main/java/org/apache/felix/deployment/rp/autoconf/AutoConfResourceProcessor.java
 (original)
+++ 
felix/trunk/deploymentadmin/autoconf/src/main/java/org/apache/felix/deployment/rp/autoconf/AutoConfResourceProcessor.java
 Fri Jan 21 12:15:53 2011
@@ -100,6 +100,11 @@ public class AutoConfResourceProcessor i
 
           // process resources
           Map designates = data.getDesignates();
+          if (designates == null) {
+              // if there are no designates, there's nothing to process
+              m_log.log(LogService.LOG_INFO, "No designates found in the 
resource, so there's nothing to process.");
+              return;
+          }
           Map localOcds = data.getObjectClassDefinitions();
           Iterator i = designates.keySet().iterator();
           while (i.hasNext()) {


Reply via email to