geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r699206 - /geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/EchoAction.java
Date Fri, 26 Sep 2008 08:04:56 GMT
Author: jdillon
Date: Fri Sep 26 01:04:55 2008
New Revision: 699206

URL: http://svn.apache.org/viewvc?rev=699206&view=rev
Log:
Fixed display of arguments

Modified:
    geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/EchoAction.java

Modified: geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/EchoAction.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/EchoAction.java?rev=699206&r1=699205&r2=699206&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/EchoAction.java
(original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/EchoAction.java
Fri Sep 26 01:04:55 2008
@@ -26,6 +26,7 @@
 import org.apache.geronimo.gshell.io.IO;
 
 import java.util.List;
+import java.util.Iterator;
 
 /**
  * A simple command to print all arguments to the commands standard output.
@@ -43,15 +44,14 @@
 
     public Object execute(final CommandContext context) throws Exception {
         assert context != null;
-
         IO io = context.getIo();
 
-        if (args != null) {
-            int c=0;
-
-            for (String arg : args) {
-                io.out.print(arg);
-                if (++c + 1 < args.size()) {
+        if (args != null && !args.isEmpty()) {
+            Iterator iter = args.iterator();
+            
+            while (iter.hasNext()) {
+                io.out.print(iter.next());
+                if (iter.hasNext()) {
                     io.out.print(" ");
                 }
             }



Mime
View raw message