Chromium Code Reviews| Index: editor/util/plugins/com.google.dart.java2dart/resources/java_core.dart |
| diff --git a/editor/util/plugins/com.google.dart.java2dart/resources/java_core.dart b/editor/util/plugins/com.google.dart.java2dart/resources/java_core.dart |
| index a450fbd85de638cc6afdb9fe190f37f7403ca222..7119161c4ca76e929f4ddb4570189b6fdac821bd 100644 |
| --- a/editor/util/plugins/com.google.dart.java2dart/resources/java_core.dart |
| +++ b/editor/util/plugins/com.google.dart.java2dart/resources/java_core.dart |
| @@ -390,3 +390,22 @@ void javaMapPutAll(Map target, Map source) { |
| bool javaStringEqualsIgnoreCase(String a, String b) { |
| return a.toLowerCase() == b.toLowerCase(); |
| } |
| + |
| +class JavaStringBuilder { |
| + StringBuffer sb = new StringBuffer(); |
| + String toString() => sb.toString(); |
| + void append(x) { |
| + sb.write(x); |
| + } |
| + void appendChar(int c) { |
| + sb.writeCharCode(c); |
| + } |
| + int get length => sb.length; |
| + void set length(int len) { |
| + var s = sb.toString().substring(0, len); |
|
floitsch
2013/03/06 16:52:18
Note that the Java StringBuilder also accepts a ne
scheglov
2013/03/06 17:12:21
Thank you!
Fixed.
|
| + sb = new StringBuffer(s); |
| + } |
| + void clear() { |
| + sb = new StringBuffer(); |
| + } |
| +} |