Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code improvements. #881

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Code improvements. #881

wants to merge 2 commits into from

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

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?

@@ -69,6 +73,11 @@
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 ?

@@ -194,6 +203,7 @@ private String handleStopEvents(
.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.

None yet

3 participants