[Integrated] RFR: 8245456: MacPasteboard throws ClassCastException on static builds
Jose Pereda
jpereda at openjdk.java.net
Wed May 20 13:24:02 UTC 2020
On Wed, 20 May 2020 11:47:29 GMT, Jose Pereda <jpereda at openjdk.org> wrote:
> Trying to paste on a JavaFX app statically built on Mac OS throws:
>
> Exception in thread "JavaFX Application Thread" java.lang.ClassCastException
> at at com.sun.glass.ui.mac.MacPasteboard._getUTFs(MacPasteboard.java)
>
>
> Checking the native method signature a `String[][]` type is expected. However the native method implementation uses:
> jobjectArray utfs = (*env)->NewObjectArray(env, size, (*env)->FindClass(env, "java/lang/Object"), NULL);
> for (items) {
> jobjectArray array = (*env)->NewObjectArray(env, size, (*env)->FindClass(env, "java/lang/String"), NULL);
> }
>
> This PR fixes the issue by applying the correct array type signature according to [JNI
> specs](https://docs.oracle.com/en/java/javase/11/docs/specs/jni/functions.html#findclass).
> It has been tested on Mac OS, both with and without static build.
This pull request has now been integrated.
Changeset: 37b5edc7
Author: Jose Pereda <jpereda at openjdk.org>
Committer: Kevin Rushforth <kcr at openjdk.org>
URL: https://git.openjdk.java.net/jfx/commit/37b5edc7
Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
8245456: MacPasteboard throws ClassCastException on static builds
Reviewed-by: kcr
-------------
PR: https://git.openjdk.java.net/jfx/pull/228
More information about the openjfx-dev
mailing list