| OLD | NEW |
| 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 import "dart:collection" show ListBase; | 5 import "dart:collection" show ListBase; |
| 6 | 6 |
| 7 class JavaSystem { | 7 class JavaSystem { |
| 8 static int currentTimeMillis() { | 8 static int currentTimeMillis() { |
| 9 return (new DateTime.now()).millisecondsSinceEpoch; | 9 return (new DateTime.now()).millisecondsSinceEpoch; |
| 10 } | 10 } |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 case '%': return '%'; | 136 case '%': return '%'; |
| 137 case 's': | 137 case 's': |
| 138 if (index >= args.length) { | 138 if (index >= args.length) { |
| 139 throw new MissingFormatArgumentException(match.group(0)); | 139 throw new MissingFormatArgumentException(match.group(0)); |
| 140 } | 140 } |
| 141 return args[index++].toString(); | 141 return args[index++].toString(); |
| 142 default: return match.group(1); | 142 default: return match.group(1); |
| 143 } | 143 } |
| 144 }); | 144 }); |
| 145 } | 145 } |
| 146 static bool startsWithBefore(String s, String other, int start) { |
| 147 return s.indexOf(other, start) != -1; |
| 148 } |
| 146 } | 149 } |
| 147 | 150 |
| 148 /** | 151 /** |
| 149 * Very limited printf implementation, supports only %s and %d. | 152 * Very limited printf implementation, supports only %s and %d. |
| 150 */ | 153 */ |
| 151 String _printf(String fmt, List args) { | 154 String _printf(String fmt, List args) { |
| 152 StringBuffer sb = new StringBuffer(); | 155 StringBuffer sb = new StringBuffer(); |
| 153 bool markFound = false; | 156 bool markFound = false; |
| 154 int argIndex = 0; | 157 int argIndex = 0; |
| 155 for (int i = 0; i < fmt.length; i++) { | 158 for (int i = 0; i < fmt.length; i++) { |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 } | 479 } |
| 477 } else if (sb.length > newLength) { | 480 } else if (sb.length > newLength) { |
| 478 var s = sb.toString().substring(0, newLength); | 481 var s = sb.toString().substring(0, newLength); |
| 479 sb = new StringBuffer(s); | 482 sb = new StringBuffer(s); |
| 480 } | 483 } |
| 481 } | 484 } |
| 482 void clear() { | 485 void clear() { |
| 483 sb = new StringBuffer(); | 486 sb = new StringBuffer(); |
| 484 } | 487 } |
| 485 } | 488 } |
| OLD | NEW |