On Thu, 11 Jul 2024 19:48:00 GMT, Alexey Ushakov <[email protected]> wrote:
> 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.
src/java.desktop/macosx/classes/sun/lwawt/macosx/CClipboard.java line 93:
> 91: byte[] bytes =
> DataTransferer.getInstance().translateTransferable(contents, flavor, format);
> 92: if (DataFlavor.javaFileListFlavor.equals(flavor)) {
> 93: writeFileObjects(bytes);
looks to me like you are supposed to pass the format too, the native code seems
to expect it.
src/java.desktop/macosx/native/libawt_lwawt/awt/CClipboard.m line 184:
> 182: JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CClipboard_writeFileObjects
> 183: (JNIEnv *env, jobject inObject, jbyteArray inBytes, jlong inFormat)
> 184: {
This native method takes a long, but I don't see that in the Java code ??
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20144#discussion_r1674649213
PR Review Comment: https://git.openjdk.org/jdk/pull/20144#discussion_r1674647735