felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From db...@apache.org
Subject svn commit: r944070 - /felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/shell/Closure.java
Date Fri, 14 May 2010 00:58:41 GMT
Author: dbaum
Date: Fri May 14 00:58:40 2010
New Revision: 944070

URL: http://svn.apache.org/viewvc?rev=944070&view=rev
Log:
convert tokens that evaluate to CharSequence to String, to avoid variables
being set to HeapCharBuffer (or other CharSequence impl).

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

Modified: felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/shell/Closure.java
URL: http://svn.apache.org/viewvc/felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/shell/Closure.java?rev=944070&r1=944069&r2=944070&view=diff
==============================================================================
--- felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/shell/Closure.java
(original)
+++ felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/shell/Closure.java
Fri May 14 00:58:40 2010
@@ -241,17 +241,30 @@ public class Closure extends Reflective 
         {
             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;
 



Mime
View raw message