equal
deleted
inserted
replaced
438 |
438 |
439 /** |
439 /** |
440 * Use best possible cause for err.initCause(), substituting the |
440 * Use best possible cause for err.initCause(), substituting the |
441 * cause for err itself if the cause has the same (or better) type. |
441 * cause for err itself if the cause has the same (or better) type. |
442 */ |
442 */ |
443 static private Error initCauseFrom(Error err, Exception ex) { |
443 private static Error initCauseFrom(Error err, Exception ex) { |
444 Throwable th = ex.getCause(); |
444 Throwable th = ex.getCause(); |
445 if (err.getClass().isInstance(th)) |
445 if (err.getClass().isInstance(th)) |
446 return (Error) th; |
446 return (Error) th; |
447 err.initCause(th == null ? ex : th); |
447 err.initCause(th == null ? ex : th); |
448 return err; |
448 return err; |