RFR: 8260616: Removing remaining JNF dependencies in the java.desktop module [v3]
Sergey Bylokhov
serb at openjdk.java.net
Mon Feb 1 22:51:47 UTC 2021
On Mon, 1 Feb 2021 19:09:59 GMT, Phil Race <prr at openjdk.org> wrote:
>> This completes the desktop module JNF removal
>>
>> * remove -framework JavaNativeFoundation from make files
>>
>> * remove #import <JavaNativeFoundation/JavaNativeFoundation.h> from all source files. If needed add import of JNIUtilities.h to get jni.h definitions - better anyway since then it gets the current JDK ones not the ones from the O/S
>>
>> * replace JNFNSToJavaString with NSStringToJavaString and JNFJavaToNSString with JavaStringToNSString
>>
>> * replace JNFNormalizedNSStringForPath with NormalizedPathNSStringFromJavaString and JNFNormalizedJavaStringForPath with NormalizedPathJavaStringFromNSString
>>
>> * replace JNFGet/ReleaseStringUTF16UniChars with direct calls to JNI
>>
>> * Map all JNFRunLoop perform* calls to the ThreadUtilities versions (the vast majority already did this)
>>
>> * Redo the ThreadUtilities calls to JNFRunLoop to directly invoke NSObject perform* methods.
>>
>> * define new javaRunLoopMode in ThreadUtilities to replace the JNF one and use where needed.
>>
>> * Remove the single usage of JNFPerformEnvBlock
>>
>> * replace JNFJavaToNSNumber in single A11Y file with local replacement
>>
>> * replace single usage of JNFNSTimeIntervalToJavaMillis in ScreenMenu.m with local replacement
>>
>> * remove un-needed JNFRunLoopDidStartNotification from NSApplicationAWT.m
>>
>> * misc. remaining cleanup (eg missed JNF_CHECK_AND_RETHROW_EXCEPTION)
>
> Phil Race has updated the pull request incrementally with one additional commit since the last revision:
>
> 8260616: Removing remaining JNF dependencies in the java.desktop module
src/java.desktop/macosx/native/libawt_lwawt/awt/CTextPipe.m line 611:
> 609: const jchar *unichars = (*env)->GetStringChars(env, str, NULL);
> 610: if (unichars == NULL) {
> 611: return;
Do not we need to throw an exception here? Otherwise, GetStringChars error will be ignored?
src/java.desktop/macosx/native/libawt_lwawt/awt/JavaComponentAccessibility.m line 967:
> 965: static NSNumber* JavaNumberToNSNumber(JNIEnv *env, jobject jnumber) {
> 966: if (jnumber == NULL) {
> 967: return nil;
Based on its usage it is probably should be zero on NULL number?
src/java.desktop/macosx/native/libosxapp/JNIUtilities.m line 30:
> 28: NSString* JavaStringToNSString(JNIEnv *env, jstring jstr) {
> 29: if (jstr == NULL) {
> 30: return NULL;
In other methods, the nil is used
src/java.desktop/macosx/native/libosxapp/ThreadUtilities.m line 53:
> 51: @implementation ThreadUtilities
> 52:
> 53: + (void)initialize {
I think we need to check how this new modes will work when the AWT is embedded inside SWT and FX.
-------------
PR: https://git.openjdk.java.net/jdk/pull/2305
More information about the build-dev
mailing list