Skip to content

Conversation

khmarbaise
Copy link
Member

No description provided.

@khmarbaise khmarbaise requested a review from gnodet August 25, 2023 13:45
.as("Daemon registry size should be " + size)
.isEqualTo(size);
Assertions.assertThat(registry.getAll())
.as("Daemon registry size should be %d actually containing:(%s)", size, registry.getAll())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure what "actually containing" means here. It's a tad awkward phrasing. Is this a UI message somewhere or just a test failure message?

public class DaemonConnector {

private static final Logger LOGGER = LoggerFactory.getLogger(DaemonConnector.class);
private static final Function<DaemonInfo, Boolean> daemonIsIdle = di -> di.getState() == DaemonState.Idle;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not using method if we don't want to inline those methods ?

.collect(Collectors.groupingBy(DaemonStopEvent::getDaemonId, Collectors.minBy(this::compare)))
.values()
.stream()
.filter(Optional::isPresent)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know IntelliJ prints a warning 'Optional::get' without 'isPresent()' check, but I think this is not a possible case : the groupingBy would not create a key if there's no value, so minBy will always return a non empty Optional.

}
}
String jvmArgs = Objects.toString(parameters.jvmArgs(), "");
args.addAll(Stream.of(jvmArgs.split(" ")).filter(nonEmpty).collect(Collectors.toList()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stream.of(jvmArgs.split(" ")).filter(nonEmpty).forEach(args::add) ? to avoid the toList step

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants