RFR: 8289763: Remove NULL check in CDSProtectionDomain::init_security_info()
Ioi Lam
iklam at openjdk.org
Wed Jul 6 05:29:48 UTC 2022
On Wed, 6 Jul 2022 04:33:10 GMT, Calvin Cheung <ccheung at openjdk.org> wrote:
>> Please review this trivial clean up. I removed the unnecessary NULL check, and replaced the `CHECK_(pd)` with `CHECK_NH` to make the code cleaner.
>>
>> It's easier to view the changes by ignoring whitespace differences.
>
> src/hotspot/share/cds/cdsProtectionDomain.cpp line 52:
>
>> 50: Handle pd;
>> 51:
>> 52: if (ik != NULL) {
>
> Since the null check for ik has been removed, I'm wondering if it makes sense to add an assert that ik is non-null?
> (I noticed the caller already has a null check before calling the function.)
There are many functions that require input parameters to be non-NULL without explicitly asserting them. I think in this case, the API is quite obvious that a NULL class shouldn't be passed, so I think an assert is not necessary.
-------------
PR: https://git.openjdk.org/jdk/pull/9380
More information about the hotspot-runtime-dev
mailing list