felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r930259 - /felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/shell/CommandSessionImpl.java
Date Fri, 02 Apr 2010 13:05:03 GMT
Author: gnodet
Date: Fri Apr  2 13:05:03 2010
New Revision: 930259

URL: http://svn.apache.org/viewvc?rev=930259&view=rev
Log:
FELIX-2247: Gogo badly prints empty maps and dictionaries

Modified:
    felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/shell/CommandSessionImpl.java

Modified: felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/shell/CommandSessionImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/shell/CommandSessionImpl.java?rev=930259&r1=930258&r2=930259&view=diff
==============================================================================
--- felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/shell/CommandSessionImpl.java
(original)
+++ felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/shell/CommandSessionImpl.java
Fri Apr  2 13:05:03 2010
@@ -225,13 +225,15 @@ public class CommandSessionImpl implemen
                 if (level == Converter.LINE)
                 {
                     StringBuilder sb = new StringBuilder();
-                    String del = "[";
                     Collection<?> c = (Collection<?>) target;
+					sb.append("[");
                     for (Object o : c)
                     {
-                        sb.append(del);
+						if (sb.length() > 1) 
+						{
+							sb.append(", ");
+						}
                         sb.append(format(o, level + 1, this));
-                        del = ", ";
                     }
                     sb.append("]");
                     return sb;
@@ -272,13 +274,15 @@ public class CommandSessionImpl implemen
                 if (level == Converter.LINE)
                 {
                     StringBuilder sb = new StringBuilder();
-                    String del = "[";
                     Map<?, ?> c = (Map<?, ?>) target;
+					sb.append("[");
                     for (Map.Entry<?, ?> entry : c.entrySet())
                     {
-                        sb.append(del);
+						if (sb.length() > 1) 
+						{
+							sb.append(", ");
+						}
                         sb.append(format(entry, level + 1, this));
-                        del = ", ";
                     }
                     sb.append("]");
                     return sb;



Mime
View raw message