On Wed, 10 Dec 2025 01:33:36 GMT, Alexey Semenyuk <[email protected]> wrote:

> - Add exception type as an additional generic parameter to all `Throwing...` 
> interfaces
> - Add unit tests for "jdk.jpackage.internal.util.function" package
> - Add `ExceptionBox.toUnchecked()`. It is equivalent to 
> `ExceptionBox.rethrowUnchecked()`, but doesn't throw
> - Replace `ExceptionBox.rethrowUnchecked(...)` with 
> `ExceptionBox.toUnchecked(...)`; this increased test coverage of 
> "jdk.jpackage.internal.util.function" package from 86% to 97%
> - Change exception handling in `ExceptionBox.toUnchecked()` (former 
> `ExceptionBox.rethrowUnchecked()`):
>   -  `InterruptedException`: instead of rethrowing an exception of this type, 
> it calls `Thread.currentThread().interrupt()` and then rethrows it
>  - Add `ExceptionBox.unbox()` (former `TKit.unbox()`). It is complementary to 
> `ExceptionBox.toUnchecked()`
>  - Catch `Exception` instead of `Throwable` where appropriate to avoid 
> catching `Error`-s. The idea is not to handle fatal errors
>  - Replace vague `throws Throwable` exception specifications with more 
> specific ones where appropriate
>  - Add `ExceptionBox.reachedUnreachable()` for use in locations that control 
> flow is not expected to reach
> 
> Supplementary changes:
>  - Take advantage of the updated `Throwing...` interfaces in the `Result` 
> class.
>  - Add unit tests for the `Result` class and fix uncovered minor issues.

This pull request has now been integrated.

Changeset: 2241218e
Author:    Alexey Semenyuk <[email protected]>
URL:       
https://git.openjdk.org/jdk/commit/2241218ef64ed6cb51f962f3ab6db1a766f1744f
Stats:     1374 lines in 55 files changed: 1116 ins; 38 del; 220 mod

8373631: Improve classes in the "jdk.jpackage.internal.util.function" package

Reviewed-by: almatvee

-------------

PR: https://git.openjdk.org/jdk/pull/28731

Reply via email to