RFR: 8366149: JNI exception pending in Java_sun_awt_X11GraphicsDevice_pGetBounds of awt_GraphicsEnv.c:1484 [v2]

Damon Nguyen dnguyen at openjdk.org
Thu Sep 18 23:30:10 UTC 2025


On Wed, 17 Sep 2025 19:58:51 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

>> Damon Nguyen has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Change fix to return NULLs instead.
>
> src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c line 1273:
> 
>> 1271:                         return NULL;
>> 1272:                     }
>> 1273:                     XFree(xinInfo);
> 
> Shouldn't we call XFree before returning here?
> Suggestion:
> 
>                     XFree(xinInfo);
>                     if (!bounds) {
>                         return NULL;
>                     }

Implemented the suggestion since it sounds right to me. Seems like XFree should be used before returning NULL (as found on line 163). Thanks!

> src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c line 1294:
> 
>> 1292: 
>> 1293:             bounds = (*env)->NewObject(env, clazz, mid, 0, 0,
>> 1294:                                     xwa.width, xwa.height);
> 
> I'm for reverting this change. The existing formatting was consistent in indenting wrapped lines by 8 spaces. The new formatting doesn't stick to either style: not 8 spaces, nor aligned to the opening parenthesis. The former is used in the file, see lines 1289–1290.

Reverted.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27110#discussion_r2361374152
PR Review Comment: https://git.openjdk.org/jdk/pull/27110#discussion_r2361371281


More information about the client-libs-dev mailing list