RFR: 8343342: java/io/File/GetXSpace.java fails on Windows with CD-ROM drive [v6]

Brian Burkhalter bpb at openjdk.org
Fri Dec 13 20:56:36 UTC 2024


On Fri, 13 Dec 2024 10:10:22 GMT, Taizo Kurashige <duke at openjdk.org> wrote:

>>> The native `GetXSpace` method needs to be defined on all platforms
>> 
>> This change fixes that problem:
>> 
>> --- a/test/jdk/java/io/File/libGetXSpace.c
>> +++ b/test/jdk/java/io/File/libGetXSpace.c
>> @@ -160,11 +160,11 @@ Java_GetXSpace_getSpace0
>>      return totalSpaceIsEstimated;
>>  }
>>  
>> -#ifdef WINDOWS
>>  JNIEXPORT jboolean JNICALL
>>  Java_GetXSpace_isCDDrive
>>      (JNIEnv *env, jclass cls, jstring root)
>>  {
>> +#ifdef WINDOWS
>>      const jchar* strchars = (*env)->GetStringChars(env, root, NULL);
>>      if (strchars == NULL) {
>>          JNU_ThrowByNameWithLastError(env, "java/lang/RuntimeException",
>> @@ -182,8 +182,10 @@ Java_GetXSpace_isCDDrive
>>      }
>>  
>>      return JNI_TRUE;
>> -}
>> +#else
>> +    return JNI_FALSE;
>>  #endif
>> +}
>
> Sorry for my lack of consideration. Thank you for the proposal. I Fixed.

Thanks. I verified the fix.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21799#discussion_r1884531303


More information about the core-libs-dev mailing list