mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
8274079: Cleanup unnecessary calls to Throwable.initCause() in java.base module
Reviewed-by: weijun
This commit is contained in:
parent
8609ea55ac
commit
1459180f35
22 changed files with 55 additions and 132 deletions
|
@ -411,7 +411,7 @@ public final class Duration
|
|||
try {
|
||||
return create(negate, daysAsSecs, hoursAsSecs, minsAsSecs, seconds, nanos);
|
||||
} catch (ArithmeticException ex) {
|
||||
throw (DateTimeParseException) new DateTimeParseException("Text cannot be parsed to a Duration: overflow", text, 0).initCause(ex);
|
||||
throw new DateTimeParseException("Text cannot be parsed to a Duration: overflow", text, 0, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -432,7 +432,7 @@ public final class Duration
|
|||
long val = Long.parseLong(text, start, end, 10);
|
||||
return Math.multiplyExact(val, multiplier);
|
||||
} catch (NumberFormatException | ArithmeticException ex) {
|
||||
throw (DateTimeParseException) new DateTimeParseException("Text cannot be parsed to a Duration: " + errorText, text, 0).initCause(ex);
|
||||
throw new DateTimeParseException("Text cannot be parsed to a Duration: " + errorText, text, 0, ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -451,7 +451,7 @@ public final class Duration
|
|||
}
|
||||
return fraction * negate;
|
||||
} catch (NumberFormatException | ArithmeticException ex) {
|
||||
throw (DateTimeParseException) new DateTimeParseException("Text cannot be parsed to a Duration: fraction", text, 0).initCause(ex);
|
||||
throw new DateTimeParseException("Text cannot be parsed to a Duration: fraction", text, 0, ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue