RFR: JDK-8301072: Replace NULL with nullptr in share/oops/ [v2]
David Holmes
dholmes at openjdk.org
Sun Jan 29 23:07:20 UTC 2023
On Fri, 27 Jan 2023 13:42:43 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:
>> Hi, this PR changes all occurrences of NULL to nullptr for the subdirectory share/oops/. 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:
>>
>> 1. No changes but copyright header changed (probably because I reverted some changes but forgot the copyright).
>> 2. Macros having their NULL changed to nullptr, these are added to the script when I find them. They should be NULL.
>> 3. 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:
>>
>> ```c++
>> // 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 incrementally with one additional commit since the last revision:
>
> Do stefank's fixes
Looks good. Thanks!
src/hotspot/share/oops/method.hpp line 794:
> 792:
> 793: // Use checked_resolve_jmethod_id() in situations where the caller
> 794: // should provide a valid jmethodID, but might not. null is returned
Nit: Null (as it starts a sentence)
src/hotspot/share/oops/oop.hpp line 263:
> 261: // Like "forward_to", but inserts the forwarding pointer atomically.
> 262: // Exactly one thread succeeds in inserting the forwarding pointer, and
> 263: // this call returns "null" for that thread; any other thread has the
Nit: null should not be in quotes
-------------
Marked as reviewed by dholmes (Reviewer).
PR: https://git.openjdk.org/jdk/pull/12186
More information about the hotspot-dev
mailing list