RFR: 8287073: NPE from CgroupV2Subsystem.getInstance() [v2]

Maxim Kartashev mkartashev at openjdk.java.net
Thu May 26 16:04:18 UTC 2022


On Thu, 26 May 2022 15:23:35 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> Maxim Kartashev has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Removed unnecessary null checks
>
> src/java.base/linux/classes/jdk/internal/platform/CgroupSubsystemFactory.java line 116:
> 
>> 114:         } else {
>> 115:             CgroupV1Subsystem subsystem = CgroupV1Subsystem.getInstance(infos);
>> 116:             return new CgroupV1MetricsImpl(subsystem);
> 
> This shouldn't be changed because the current implementation of `CgroupV1Subsystem.getInstance(infos)` has a path that returns null.
> 
> Maybe that's impossible, because when we call `CgroupV1Subsystem.getInstance`, we must have at least one v1 subsystem in `infos`. However, that's not related to this issue.  Please fix that in a separate RFE. For example, `CgroupV1Subsystem.getInstance(infos)`  can be changed to throw an exception instead if return null.

Fine by me; done.

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

PR: https://git.openjdk.java.net/jdk/pull/8803


More information about the core-libs-dev mailing list