karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject git commit: [KARAF-2991] Shell Console throws exception when a service contains int[] as value for a property
Date Mon, 26 May 2014 21:06:40 GMT
Repository: karaf
Updated Branches:
  refs/heads/karaf-3.0.x c10cf26ea -> a42c74b08


[KARAF-2991] Shell Console throws exception when a service contains int[] as value for a property


Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/a42c74b0
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/a42c74b0
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/a42c74b0

Branch: refs/heads/karaf-3.0.x
Commit: a42c74b089c8e8b5ffcf844e2c601cd8d961d4ba
Parents: c10cf26
Author: Guillaume Nodet <gnodet@gmail.com>
Authored: Tue May 20 14:52:30 2014 +0200
Committer: Guillaume Nodet <gnodet@gmail.com>
Committed: Mon May 26 23:06:31 2014 +0200

----------------------------------------------------------------------
 .../src/main/java/org/apache/karaf/shell/util/ShellUtil.java     | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/a42c74b0/shell/console/src/main/java/org/apache/karaf/shell/util/ShellUtil.java
----------------------------------------------------------------------
diff --git a/shell/console/src/main/java/org/apache/karaf/shell/util/ShellUtil.java b/shell/console/src/main/java/org/apache/karaf/shell/util/ShellUtil.java
index 2ffef9f..f51e1ca 100644
--- a/shell/console/src/main/java/org/apache/karaf/shell/util/ShellUtil.java
+++ b/shell/console/src/main/java/org/apache/karaf/shell/util/ShellUtil.java
@@ -27,6 +27,7 @@ import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URL;
 import java.util.Arrays;
+import java.util.Collection;
 
 import jline.console.ConsoleReader;
 import org.apache.felix.service.command.CommandSession;
@@ -81,6 +82,9 @@ public class ShellUtil {
             return Arrays.toString((long[]) obj);
         } else if (obj instanceof short[]) {
             return Arrays.toString((short[]) obj);
+        } else if (obj instanceof Collection<?>) {
+            Object[] array = ((Collection<?>) obj).toArray();
+            return getValueString(array);
         } else if (obj.getClass().isArray()) {
             Object[] array = (Object[]) obj;
             StringBuilder sb = new StringBuilder();


Mime
View raw message