On Fri, 8 Jan 2021 19:05:09 GMT, Phil Race <p...@openjdk.org> wrote:

>> Proposed updates to JNI error handling.
>
> src/java.desktop/macosx/native/libosxapp/JNIUtilities.h line 46:
> 
>> 44:               if ((*env)->ExceptionOccurred(env) != NULL) { \
>> 45:                   (*env)->ExceptionDescribe(env); \
>> 46:               } \
> 
> So the update here is that if we are not on the appkit thread, make sure a 
> java exception is thrown.
> If we are on the appkit thread, clear any java exception since it isn't going 
> anywhere but do it using
> describe which prints it.

I read the logic of the method differently, probably the wrong indents?
  - If we are not on the toolkit thread then
    - Check ExceptionOccurred -> throw JNU_ThrowInternalError if needed or 
check exception again ->call ExceptionDescribe
  - NSException raise at the end.

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

PR: https://git.openjdk.java.net/jdk/pull/1967

Reply via email to