| OLD | NEW |
| 1 library java.engine; | 1 library java.engine; |
| 2 | 2 |
| 3 import 'java_core.dart'; | 3 import 'java_core.dart'; |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * A predicate is a one-argument function that returns a boolean value. | 6 * A predicate is a one-argument function that returns a boolean value. |
| 7 */ | 7 */ |
| 8 typedef bool Predicate<E>(E argument); | 8 typedef bool Predicate<E>(E argument); |
| 9 | 9 |
| 10 class StringUtilities { | 10 class StringUtilities { |
| 11 static const String EMPTY = ''; | 11 static const String EMPTY = ''; |
| 12 static const List<String> EMPTY_ARRAY = const <String>[]; | 12 static const List<String> EMPTY_ARRAY = const <String>[]; |
| 13 static String intern(String s) => s; | 13 |
| 14 static Interner INTERNER = new NullInterner(); |
| 15 |
| 16 static String intern(String string) => INTERNER.intern(string); |
| 14 static bool isTagName(String s) { | 17 static bool isTagName(String s) { |
| 15 if (s == null || s.length == 0) { | 18 if (s == null || s.length == 0) { |
| 16 return false; | 19 return false; |
| 17 } | 20 } |
| 18 int sz = s.length; | 21 int sz = s.length; |
| 19 for (int i = 0; i < sz; i++) { | 22 for (int i = 0; i < sz; i++) { |
| 20 int c = s.codeUnitAt(i); | 23 int c = s.codeUnitAt(i); |
| 21 if (!Character.isLetter(c)) { | 24 if (!Character.isLetter(c)) { |
| 22 if (i == 0) { | 25 if (i == 0) { |
| 23 return false; | 26 return false; |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 if (cause != null) { | 313 if (cause != null) { |
| 311 buffer.write('Caused by '); | 314 buffer.write('Caused by '); |
| 312 cause._writeOn(buffer); | 315 cause._writeOn(buffer); |
| 313 } | 316 } |
| 314 } else { | 317 } else { |
| 315 buffer.writeln(exception.toString()); | 318 buffer.writeln(exception.toString()); |
| 316 buffer.writeln(stackTrace.toString()); | 319 buffer.writeln(stackTrace.toString()); |
| 317 } | 320 } |
| 318 } | 321 } |
| 319 } | 322 } |
| OLD | NEW |