| OLD | NEW |
| 1 library java.engine; | 1 library java.engine; |
| 2 | 2 |
| 3 import 'interner.dart'; | 3 import 'interner.dart'; |
| 4 import 'java_core.dart'; | 4 import 'java_core.dart'; |
| 5 | 5 |
| 6 /** | 6 /** |
| 7 * A predicate is a one-argument function that returns a boolean value. | 7 * A predicate is a one-argument function that returns a boolean value. |
| 8 */ | 8 */ |
| 9 typedef bool Predicate<E>(E argument); | 9 typedef bool Predicate<E>(E argument); |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 } | 33 } |
| 34 return true; | 34 return true; |
| 35 } | 35 } |
| 36 static bool isEmpty(String s) { | 36 static bool isEmpty(String s) { |
| 37 return s == null || s.isEmpty; | 37 return s == null || s.isEmpty; |
| 38 } | 38 } |
| 39 static String substringBefore(String str, String separator) { | 39 static String substringBefore(String str, String separator) { |
| 40 if (str == null || str.isEmpty) { | 40 if (str == null || str.isEmpty) { |
| 41 return str; | 41 return str; |
| 42 } | 42 } |
| 43 if (separator == null) { |
| 44 return str; |
| 45 } |
| 43 int pos = str.indexOf(separator); | 46 int pos = str.indexOf(separator); |
| 44 if (pos < 0) { | 47 if (pos < 0) { |
| 45 return str; | 48 return str; |
| 46 } | 49 } |
| 47 return str.substring(0, pos); | 50 return str.substring(0, pos); |
| 48 } | 51 } |
| 49 static endsWithChar(String str, int c) { | 52 static endsWithChar(String str, int c) { |
| 50 int length = str.length; | 53 int length = str.length; |
| 51 return length > 0 && str.codeUnitAt(length - 1) == c; | 54 return length > 0 && str.codeUnitAt(length - 1) == c; |
| 52 } | 55 } |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 if (cause != null) { | 328 if (cause != null) { |
| 326 buffer.write('Caused by '); | 329 buffer.write('Caused by '); |
| 327 cause._writeOn(buffer); | 330 cause._writeOn(buffer); |
| 328 } | 331 } |
| 329 } else { | 332 } else { |
| 330 buffer.writeln(exception.toString()); | 333 buffer.writeln(exception.toString()); |
| 331 buffer.writeln(stackTrace.toString()); | 334 buffer.writeln(stackTrace.toString()); |
| 332 } | 335 } |
| 333 } | 336 } |
| 334 } | 337 } |
| OLD | NEW |