Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(398)

Side by Side Diff: editor/util/plugins/com.google.dart.java2dart/resources/java_core.dart

Issue 12543003: Use limited JavaStringBuilder implementation instead of Dart StringBuffer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 library java.core; 1 library java.core;
2 2
3 import "dart:math" as math; 3 import "dart:math" as math;
4 import "dart:uri"; 4 import "dart:uri";
5 5
6 class JavaSystem { 6 class JavaSystem {
7 static int currentTimeMillis() { 7 static int currentTimeMillis() {
8 return (new DateTime.now()).millisecondsSinceEpoch; 8 return (new DateTime.now()).millisecondsSinceEpoch;
9 } 9 }
10 10
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 383
384 void javaMapPutAll(Map target, Map source) { 384 void javaMapPutAll(Map target, Map source) {
385 source.forEach((k, v) { 385 source.forEach((k, v) {
386 target[k] = v; 386 target[k] = v;
387 }); 387 });
388 } 388 }
389 389
390 bool javaStringEqualsIgnoreCase(String a, String b) { 390 bool javaStringEqualsIgnoreCase(String a, String b) {
391 return a.toLowerCase() == b.toLowerCase(); 391 return a.toLowerCase() == b.toLowerCase();
392 } 392 }
393
394 class JavaStringBuilder {
395 StringBuffer sb = new StringBuffer();
396 String toString() => sb.toString();
397 void append(x) {
398 sb.write(x);
399 }
400 void appendChar(int c) {
401 sb.writeCharCode(c);
402 }
403 int get length => sb.length;
404 void set length(int len) {
405 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.
406 sb = new StringBuffer(s);
407 }
408 void clear() {
409 sb = new StringBuffer();
410 }
411 }
OLDNEW
« no previous file with comments | « no previous file | editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/processor/ObjectSemanticProcessor.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698