> - 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
Alexey Semenyuk has updated the pull request incrementally with three
additional commits since the last revision:
- Result: add unit tests, remove unused mapErrors(UnaryOperator<Collection<?
extends Exception>>) function; better and more consistent error reporting based
on testing
- Result: replace create(Supplier<T>) with of(ThrowingSupplier<T, E>)
- CustomInfoPListTest: fix local test failure:
[22:38:21.786] TRACE: assertStringListEquals(): Check contents of
[CustomInfoPListTest/testPackage.571a7829/vanilla/PackageCustomInfoPListTest.app/Contents/runtime/Contents/Info.plist]
and
[CustomInfoPListTest/testPackage.571a7829/unpacked-pkg/unpacked/Applications/PackageCustomInfoPListTest.app/Contents/runtime/Contents/Info.plist]
plist files are the same
[22:38:21.786] TRACE: assertStringListEquals( 1, /CFBundleDevelopmentRegion:
en-US)
[22:38:21.786] TRACE: assertStringListEquals( 2, /CFBundleExecutable:
libjli.dylib)
[22:38:21.786] TRACE: assertStringListEquals( 3, /CFBundleIdentifier: Hello)
[22:38:21.787] TRACE: assertStringListEquals( 4,
/CFBundleInfoDictionaryVersion: 7.0)
[22:38:21.787] TRACE: assertStringListEquals( 5, /CFBundleName:
PackageCustomInfoPListTest)
[22:38:21.787] TRACE: assertStringListEquals( 6, /CFBundlePackageType: BNDL)
[22:38:21.787] TRACE: assertStringListEquals( 7,
/CFBundleShortVersionString: 1.0)
[22:38:21.787] TRACE: assertStringListEquals( 8, /CFBundleSignature: ????)
[22:38:21.787] TRACE: assertStringListEquals( 9, /CFBundleVersion: 1.0)
[22:38:21.787] ERROR: Actual list is shorter than expected by 5 elements:
Check contents of
[CustomInfoPListTest/testPackage.571a7829/vanilla/PackageCustomInfoPListTest.app/Contents/runtime/Contents/Info.plist]
and
[CustomInfoPListTest/testPackage.571a7829/unpacked-pkg/unpacked/Applications/PackageCustomInfoPListTest.app/Contents/runtime/Contents/Info.plist]
plist files are the same
[22:38:21.787] [ FAILED ] CustomInfoPListTest.testPackage(APP); checks=54
Exception in thread "main" java.lang.AssertionError: Actual list is shorter
than expected by 5 elements: Check contents of
[CustomInfoPListTest/testPackage.571a7829/vanilla/PackageCustomInfoPListTest.app/Contents/runtime/Contents/Info.plist]
and
[CustomInfoPListTest/testPackage.571a7829/unpacked-pkg/unpacked/Applications/PackageCustomInfoPListTest.app/Contents/runtime/Contents/Info.plist]
plist files are the same
at jdk.jpackage.test.TKit.error(TKit.java:360)
at jdk.jpackage.test.TKit.assertStringListEquals(TKit.java:1068)
at
CustomInfoPListTest$TestConfig.lambda$createPListFilesVerifier$1(CustomInfoPListTest.java:274)
at CustomInfoPListTest.lambda$testApp$9(CustomInfoPListTest.java:182)
Caused by not getting the default plist file from the vanilla app image
runtime directory when the external runtime with the "bin" subdirectory is used
with the tests.
Test log without the predefined runtime:
========================================
[22:35:26.310] Creating app package: PackageCustomInfoPListTest.app in
jpackage-tests/CustomInfoPListTest/testPackage.571a7829/vanilla
[22:35:26.318] Running jlink
...
[22:35:29.430] Using default package resource
ApplicationRuntime-Info.plist.template [Embedded Java Runtime Info.plist] (add
Runtime-Info.plist to the resource-dir to customize).
Test log with the predefined runtime:
=====================================
[22:38:17.465] Creating app package: PackageCustomInfoPListTest.app in
jpackage-tests/CustomInfoPListTest/testPackage.571a7829/vanilla
[22:38:17.605] Using default package resource Runtime-Info.plist.template
[Embedded Java Runtime Info.plist] (add Runtime-Info.plist to the resource-dir
to customize).
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/28731/files
- new: https://git.openjdk.org/jdk/pull/28731/files/c56b5350..0a47251e
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=28731&range=02
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=28731&range=01-02
Stats: 663 lines in 6 files changed: 640 ins; 11 del; 12 mod
Patch: https://git.openjdk.org/jdk/pull/28731.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/28731/head:pull/28731
PR: https://git.openjdk.org/jdk/pull/28731