RFR: 8304717: Declaration aliasing between boolean and jboolean is wrong [v3]
    David Holmes 
    dholmes at openjdk.org
       
    Fri Mar 31 06:36:18 UTC 2023
    
    
  
On Fri, 31 Mar 2023 05:57:01 GMT, Julian Waters <jwaters at openjdk.org> wrote:
>> A couple of spots wrongly refer to boolean and jboolean as the same thing. While this does still compile thanks to a happy accident and implicit conversions, they are not the same at all, and should be fixed before a future compiler error happens if their declarations are touched
>
> Julian Waters has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Explicit conversion to jboolean
Changes requested by dholmes (Reviewer).
src/java.prefs/macosx/native/libprefs/MacOSXPreferencesFile.m line 698:
> 696:     CFDictionaryAddValue(parent, child, node);
> 697:     if (!beforeAdd)
> 698:         beforeAdd = CFDictionaryContainsKey(parent, child) ? JNI_TRUE : JNI_FALSE;
If you do this here you need something similar on line 695. Still say it is simpler to use Boolean internally and convert to jboolean on return expression.
-------------
PR Review: https://git.openjdk.org/jdk/pull/13139#pullrequestreview-1366328929
PR Review Comment: https://git.openjdk.org/jdk/pull/13139#discussion_r1154068780
    
    
More information about the client-libs-dev
mailing list