convert tokens that evaluate to CharSequence to String, to avoid variables
being set to HeapCharBuffer (or other CharSequence impl).


git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@944070 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/shell/Closure.java b/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/shell/Closure.java
index ce33b56..12813cf 100644
--- a/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/shell/Closure.java
+++ b/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/shell/Closure.java
@@ -241,17 +241,30 @@
         {
             case WORD:
                 v = Tokenizer.expand(t, this);
+                
                 if (t == v)
                 {
-                    String s = t.toString();
+                    String s = v.toString();
                     if ("null".equals(s))
+                    {
                         v = null;
+                    }
                     else if ("false".equals(s))
+                    {
                         v = false;
+                    }
                     else if ("true".equals(s))
+                    {
                         v = true;
+                    }
                     else
+                    {
                         v = s;
+                    }
+                }
+                else if (v instanceof CharSequence)
+                {
+                    v = v.toString();
                 }
                 break;