| 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 { |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 * The exception that caused this exception, or `null` if this exception was | 248 * The exception that caused this exception, or `null` if this exception was |
| 249 * not caused by another exception. | 249 * not caused by another exception. |
| 250 */ | 250 */ |
| 251 final CaughtException cause; | 251 final CaughtException cause; |
| 252 | 252 |
| 253 /** | 253 /** |
| 254 * Initialize a newly created exception to have the given [message] and | 254 * Initialize a newly created exception to have the given [message] and |
| 255 * [cause]. | 255 * [cause]. |
| 256 */ | 256 */ |
| 257 AnalysisException([this.message = 'Exception', this.cause = null]); | 257 AnalysisException([this.message = 'Exception', this.cause = null]); |
| 258 |
| 259 String toString() { |
| 260 StringBuffer buffer = new StringBuffer(); |
| 261 buffer.write("AnalysisException: "); |
| 262 buffer.writeln(message); |
| 263 if (cause != null) { |
| 264 buffer.write('Caused by '); |
| 265 cause._writeOn(buffer); |
| 266 } |
| 267 return buffer.toString(); |
| 268 } |
| 258 } | 269 } |
| 259 | 270 |
| 260 | 271 |
| 261 /** | 272 /** |
| 262 * Instances of the class `CaughtException` represent an exception that was | 273 * Instances of the class `CaughtException` represent an exception that was |
| 263 * caught and has an associated stack trace. | 274 * caught and has an associated stack trace. |
| 264 */ | 275 */ |
| 265 class CaughtException implements Exception { | 276 class CaughtException implements Exception { |
| 266 /** | 277 /** |
| 267 * The exception that was caught. | 278 * The exception that was caught. |
| 268 */ | 279 */ |
| 269 final Exception exception; | 280 final Object exception; |
| 270 | 281 |
| 271 /** | 282 /** |
| 272 * The stack trace associated with the exception. | 283 * The stack trace associated with the exception. |
| 273 */ | 284 */ |
| 274 StackTrace stackTrace; | 285 StackTrace stackTrace; |
| 275 | 286 |
| 276 /** | 287 /** |
| 277 * Initialize a newly created caught exception to have the given [exception] | 288 * Initialize a newly created caught exception to have the given [exception] |
| 278 * and [stackTrace]. | 289 * and [stackTrace]. |
| 279 */ | 290 */ |
| (...skipping 30 matching lines...) Expand all Loading... |
| 310 if (cause != null) { | 321 if (cause != null) { |
| 311 buffer.write('Caused by '); | 322 buffer.write('Caused by '); |
| 312 cause._writeOn(buffer); | 323 cause._writeOn(buffer); |
| 313 } | 324 } |
| 314 } else { | 325 } else { |
| 315 buffer.writeln(exception.toString()); | 326 buffer.writeln(exception.toString()); |
| 316 buffer.writeln(stackTrace.toString()); | 327 buffer.writeln(stackTrace.toString()); |
| 317 } | 328 } |
| 318 } | 329 } |
| 319 } | 330 } |
| OLD | NEW |