felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r922246 - /felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManager.java
Date Fri, 12 Mar 2010 13:14:47 GMT
Author: fmeschbe
Date: Fri Mar 12 13:14:46 2010
New Revision: 922246

URL: http://svn.apache.org/viewvc?rev=922246&view=rev
Log:
FELIX-2198 Prevent NullPointerException if ConfigurationAdmin service is not running.

Modified:
    felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManager.java

Modified: felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManager.java?rev=922246&r1=922245&r2=922246&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManager.java
(original)
+++ felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManager.java
Fri Mar 12 13:14:46 2010
@@ -284,30 +284,27 @@ public class ConfigManager extends Confi
 
         final Locale loc = getLocale( request );
         final String locale = ( loc != null ) ? loc.toString() : null;
-        
+
 
         JSONObject json = new JSONObject();
         try
         {
             json.put("status", ca != null ? Boolean.TRUE : Boolean.FALSE);
-            listConfigurations(json, ca, pidFilter, locale, loc);
-            listFactoryConfigurations(json, pidFilter, locale);
+            if ( ca != null )
+            {
+                listConfigurations( json, ca, pidFilter, locale, loc );
+                listFactoryConfigurations( json, pidFilter, locale );
+            }
         }
         catch (JSONException e)
         {
             throw new IOException(e.toString());
         }
-        
+
         // if a configuration is addressed, display it immediately
-        final Configuration config;
         if ( request.getParameter( "create" ) != null && pid != null )
         {
-            config = new PlaceholderConfiguration( pid );
-            pid = config.getPid();
-        }
-        else
-        {
-            config = getConfiguration( ca, pid );
+            pid = new PlaceholderConfiguration( pid ).getPid();
         }
 
 
@@ -709,7 +706,7 @@ public class ConfigManager extends Confi
                         }
                         else if ( value.getClass().isArray() )
                         {
-                            if ( value.getClass().getComponentType().isPrimitive() ) 
+                            if ( value.getClass().getComponentType().isPrimitive() )
                             {
                                 final int len = Array.getLength(value);
                                 final Object[] tmp = new Object[len];



Mime
View raw message