activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r963240 - /activemq/trunk/activemq-karaf/src/main/java/org/apache/activemq/karaf/commands/ActiveMQCommandSupport.java
Date Mon, 12 Jul 2010 11:03:26 GMT
Author: gnodet
Date: Mon Jul 12 11:03:26 2010
New Revision: 963240

URL: http://svn.apache.org/viewvc?rev=963240&view=rev
Log:
fix possible npe in karaf commands

Modified:
    activemq/trunk/activemq-karaf/src/main/java/org/apache/activemq/karaf/commands/ActiveMQCommandSupport.java

Modified: activemq/trunk/activemq-karaf/src/main/java/org/apache/activemq/karaf/commands/ActiveMQCommandSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-karaf/src/main/java/org/apache/activemq/karaf/commands/ActiveMQCommandSupport.java?rev=963240&r1=963239&r2=963240&view=diff
==============================================================================
--- activemq/trunk/activemq-karaf/src/main/java/org/apache/activemq/karaf/commands/ActiveMQCommandSupport.java
(original)
+++ activemq/trunk/activemq-karaf/src/main/java/org/apache/activemq/karaf/commands/ActiveMQCommandSupport.java
Mon Jul 12 11:03:26 2010
@@ -34,18 +34,16 @@ public class ActiveMQCommandSupport exte
     private Command command;
 
     @Argument(index=0, multiValued=true, required=true)
-    private Collection<String> arguments = null;
+    private Collection<String> arguments;
 
     protected Object doExecute() throws Exception {
-        final String[] args = toStringArray(arguments.toArray());
-
         CommandContext context2 = new CommandContext();
         context2.setFormatter(new CommandShellOutputFormatter(System.out));
         Command currentCommand = command.getClass().newInstance();
 
         try {
             currentCommand.setCommandContext(context2);
-            currentCommand.execute(new ArrayList<String>(Arrays.asList(args)));
+            currentCommand.execute(arguments != null ? new ArrayList<String>(arguments)
: new ArrayList<String>());
             return null;
         } catch (Throwable e) {
             Throwable cur = e;



Mime
View raw message