-
Notifications
You must be signed in to change notification settings - Fork 212
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
base: master
Are you sure you want to change the base?
Code improvements. #881
Conversation
.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()) |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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())); |
There was a problem hiding this comment.
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
No description provided.