camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1379710 - in /camel/branches/camel-2.10.x: ./ platforms/karaf/commands/src/main/java/org/apache/camel/karaf/commands/RouteList.java
Date Sat, 01 Sep 2012 07:35:43 GMT
Author: davsclaus
Date: Sat Sep  1 07:35:43 2012
New Revision: 1379710

URL: http://svn.apache.org/viewvc?rev=1379710&view=rev
Log:
CAMEL-5543: Fixed possible NPE in camel:route-list karaf command.

Modified:
    camel/branches/camel-2.10.x/   (props changed)
    camel/branches/camel-2.10.x/platforms/karaf/commands/src/main/java/org/apache/camel/karaf/commands/RouteList.java

Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
  Merged /camel/trunk:r1379709

Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-2.10.x/platforms/karaf/commands/src/main/java/org/apache/camel/karaf/commands/RouteList.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/platforms/karaf/commands/src/main/java/org/apache/camel/karaf/commands/RouteList.java?rev=1379710&r1=1379709&r2=1379710&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/platforms/karaf/commands/src/main/java/org/apache/camel/karaf/commands/RouteList.java
(original)
+++ camel/branches/camel-2.10.x/platforms/karaf/commands/src/main/java/org/apache/camel/karaf/commands/RouteList.java
Sat Sep  1 07:35:43 2012
@@ -20,6 +20,7 @@ import java.util.LinkedList;
 import java.util.List;
 
 import org.apache.camel.CamelContext;
+import org.apache.camel.ServiceStatus;
 import org.apache.camel.model.RouteDefinition;
 import org.apache.felix.gogo.commands.Argument;
 import org.apache.felix.gogo.commands.Command;
@@ -62,8 +63,8 @@ public class RouteList extends OsgiComma
             if (routeDefinitions != null && !routeDefinitions.isEmpty()) {
                 for (RouteDefinition routeDefinition : routeDefinitions) {
                     String contextName = camelContext.getName();
-                    String status = camelContext.getRouteStatus(routeDefinition.getId()).name();
-                    System.out.println(String.format(OUTPUT_FORMAT, routeDefinition.getId(),
contextName, status));
+                    ServiceStatus status = camelContext.getRouteStatus(routeDefinition.getId());
+                    System.out.println(String.format(OUTPUT_FORMAT, routeDefinition.getId(),
contextName, status != null ? status.name() : UNKNOWN));
                 }
             }
         }



Mime
View raw message