I've cloned this repro and added the below test to the OperatingSystemTest. It fails every time for me on Windows.
@Test
public void testGetCommandLine() {
int processesWithNonEmptyCmdLine = 0;
for (OSProcess process : new SystemInfo().getOperatingSystem().getProcesses(0, null)) {
if (!process.getCommandLine().trim().isEmpty()) {
processesWithNonEmptyCmdLine++;
}
}
assertTrue(processesWithNonEmptyCmdLine >= 1);
}
PR up: #527
Thanks for the fix! I won't even pretend to know what I was thinking when I wrote that... I think I re-used a map that had been populated a different way and neglected to check/change the logic. Or was sleep deprived.
Gold star for the added unit test.