<AWT Dev> RFR: 8257853: Remove dependencies on JNF's JNI utility functions in AWT and 2D code [v6]
prr at openjdk.java.net
Fri Dec 18 04:00:58 UTC 2020
On Fri, 18 Dec 2020 02:30:47 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:
>> Phil Race has updated the pull request incrementally with one additional commit since the last revision:
>> 8257853: Remove dependencies on JNF's JNI utility functions in AWT and 2D code
> src/java.desktop/macosx/native/libosxapp/JNIUtilities.h line 120:
>> 118: } \
>> 119: LOG_NULL(dst_var, name); \
>> 120: CHECK_NULL(dst_var);
> If some of these macros will be used on appkit thread, then the check like "CHECK_NULL" will not work, because the code will never return to the java, and the failure will be actually ignored.
If we get NULL back then there's a progamming bug. LOG_NULL will show it.
CHECK_NULL is just as much to satisfy JNI as anything.
If we are on a Java thread then it will still add some value so I don't see the point in removing it.
Nor do I think I'd like to use NSException instead because that affects the flow of control.
Yes, this may be different than before (probably more relevant to the other comment) but I think better may be a better approach overall. If we ever see an issue here that is likely to occur due to anything other than a bad internal inconsistency due to JDK changes then I would prefer to follow the code path and fix it up.
More information about the awt-dev