commit | 9f2f8f250180be66e6c85c8abf6c070771fd126b | [log] [tgz] |
---|---|---|
author | Derek Baum <dbaum@apache.org> | Fri May 14 00:58:40 2010 +0000 |
committer | Derek Baum <dbaum@apache.org> | Fri May 14 00:58:40 2010 +0000 |
tree | 8d7b303a9d1510bfbfe0677b3f2cace4ff5440f9 | |
parent | 2fa59dae9a4b41adfe4f6718b84d84f1f17673f5 [diff] |
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;