On Tue, 24 May 2022 19:49:35 GMT, Ioi Lam <ik...@openjdk.org> wrote:

>> My bad. How about `Intentional incomplete switch. There are ...`? Anyway, 
>> why is the empty `default` case needed other than for the comment?
>
> To me, the `default:` switch is a clear indication that "everything else 
> comes here". So you won't be confused whether the comment is related to the 
> last line just above the comment.

If you don't like the `default:` coding style, how about this:


switch (info.getName()) {
// Only the following controllers are important to Java. All
// other controllers (such as freezer) are ignored and
// are not considered in the checks below for
// anyCgroupsV1Controller/anyCgroupsV1Controller.
case CPU_CTRL:      infos.put(CPU_CTRL, info); break;
case CPUACCT_CTRL:  infos.put(CPUACCT_CTRL, info); break;
case CPUSET_CTRL:   infos.put(CPUSET_CTRL, info); break;
case MEMORY_CTRL:   infos.put(MEMORY_CTRL, info); break;
case BLKIO_CTRL:    infos.put(BLKIO_CTRL, info); break;
case PIDS_CTRL:     infos.put(PIDS_CTRL, info); break;
}

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

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

Reply via email to