RFR: JDK-8300245: Replace NULL with nullptr in share/jfr/ [v7]
Johan Sjölen
jsjolen at openjdk.org
Mon May 8 10:09:31 UTC 2023
On Mon, 8 May 2023 10:00:45 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:
>> Hi, this PR changes all occurrences of NULL to nullptr for the subdirectory share/jfr/. Unfortunately the script that does the change isn't perfect, and so we
>> need to comb through these manually to make sure nothing has gone wrong. I also review these changes but things slip past my eyes sometimes.
>>
>> Here are some typical things to look out for:
>>
>> No changes but copyright header changed (probably because I reverted some changes but forgot the copyright).
>> Macros having their NULL changed to nullptr, these are added to the script when I find them. They should be NULL.
>> nullptr in comments and logs. We try to use lower case "null" in these cases as it reads better. An exception is made when code expressions are in a comment.
>>
>> An example of this:
>>
>> // This function returns null
>> void* ret_null();
>> // This function returns true if *x == nullptr
>> bool is_nullptr(void** x);
>>
>> Note how nullptr participates in a code expression here, we really are talking about the specific value nullptr.
>>
>> Thanks!
>
> Johan Sjölen has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 11 commits:
>
> - Missing fixes
> - Merge branch 'master' into JDK-8300245
> - It's impossible for an array to be nullptr, remove asserts.
>
> Fails build on Clang systems
> - Merge remote-tracking branch 'origin/master' into JDK-8300245
> - Fix outdated copyright
> - Manual fix
> - Fix two faulty NULL_STRING misses
> - More manual fixes
> - Merge remote-tracking branch 'origin/master' into JDK-8300245
> - Manual fixes
> - ... and 1 more: https://git.openjdk.org/jdk/compare/5c7ede94...cb705720
Alright, @mgronlun, @egahlin, looks like the JFR null conversion is done. I'm currently running the tier1 tests. I removed a few asserts that didn't do anything (Clang complains about unnecessary comparisons), see here: https://github.com/openjdk/jdk/pull/12034/commits/2da97d578cf008170a0881d44844516370a6f456
-------------
PR Comment: https://git.openjdk.org/jdk/pull/12034#issuecomment-1538107444
More information about the hotspot-jfr-dev
mailing list