| OLD | NEW |
| 1 library java.core; | 1 library java.core; |
| 2 | 2 |
| 3 final Stopwatch nanoTimeStopwatch = new Stopwatch(); | 3 final Stopwatch nanoTimeStopwatch = new Stopwatch(); |
| 4 | 4 |
| 5 const int LONG_MAX_VALUE = 0x7fffffffffffffff; | 5 const int LONG_MAX_VALUE = 0x7fffffffffffffff; |
| 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 markFound = false; | 147 markFound = false; |
| 148 } else { | 148 } else { |
| 149 markFound = true; | 149 markFound = true; |
| 150 } | 150 } |
| 151 continue; | 151 continue; |
| 152 } | 152 } |
| 153 if (markFound) { | 153 if (markFound) { |
| 154 markFound = false; | 154 markFound = false; |
| 155 // %d | 155 // %d |
| 156 if (c == 0x64) { | 156 if (c == 0x64) { |
| 157 sb.writeCharCode(args[argIndex++]); | 157 sb.write(args[argIndex++]); |
| 158 continue; | 158 continue; |
| 159 } | 159 } |
| 160 // %s | 160 // %s |
| 161 if (c == 0x73) { | 161 if (c == 0x73) { |
| 162 sb.writeCharCode(args[argIndex++]); | 162 sb.write(args[argIndex++]); |
| 163 continue; | 163 continue; |
| 164 } | 164 } |
| 165 // unknown | 165 // unknown |
| 166 throw new IllegalArgumentException('[$fmt][$i] = 0x${c.toRadixString(16)}'
); | 166 throw new IllegalArgumentException('[$fmt][$i] = 0x${c.toRadixString(16)}'
); |
| 167 } else { | 167 } else { |
| 168 sb.writeCharCode(c); | 168 sb.writeCharCode(c); |
| 169 } | 169 } |
| 170 } | 170 } |
| 171 return sb.toString(); | 171 return sb.toString(); |
| 172 } | 172 } |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 * format('{0} are you {1}ing?', ['What', 'read']) = 'What are you reading?' | 421 * format('{0} are you {1}ing?', ['What', 'read']) = 'What are you reading?' |
| 422 */ | 422 */ |
| 423 String formatList(String pattern, List args) { | 423 String formatList(String pattern, List args) { |
| 424 return pattern.replaceAllMapped(new RegExp(r'\{(\d+)\}'), (match) { | 424 return pattern.replaceAllMapped(new RegExp(r'\{(\d+)\}'), (match) { |
| 425 String indexStr = match.group(1); | 425 String indexStr = match.group(1); |
| 426 int index = int.parse(indexStr); | 426 int index = int.parse(indexStr); |
| 427 var arg = args[index]; | 427 var arg = args[index]; |
| 428 return arg != null ? arg.toString() : null; | 428 return arg != null ? arg.toString() : null; |
| 429 }); | 429 }); |
| 430 } | 430 } |
| OLD | NEW |