Here is an updated version of the fix we have used in Jetbrains Runtime for quite a while. It has been tested by running jdk_desktop tests and manually using a test case attached to this issue. There is no reg test as I've not found a reliable way to verify file list content inside the system clipboard.
------------- Commit messages: - 8314498: [macos] Transferring File objects to Finder fails Changes: https://git.openjdk.org/jdk/pull/20144/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20144&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8314498 Stats: 40 lines in 2 files changed: 39 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/20144.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20144/head:pull/20144 PR: https://git.openjdk.org/jdk/pull/20144