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

Apply tiny polish to DevMojo #17596

Merged
merged 1 commit into from
Jun 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public class DevMojo extends AbstractMojo {
* running any one of these phases means the compile phase will have been run, if these have
* not been run we manually run compile
*/
private static final Set<String> POST_COMPILE_PHASES = new HashSet<>(Arrays.asList(
private static final Set<String> POST_COMPILE_PHASES = Set.of(
"compile",
"process-classes",
"generate-test-sources",
Expand All @@ -121,13 +121,13 @@ public class DevMojo extends AbstractMojo {
"post-integration-test",
"verify",
"install",
"deploy"));
"deploy");

/**
* running any one of these phases means the test-compile phase will have been run, if these have
* not been run we manually run test-compile
*/
private static final Set<String> POST_TEST_COMPILE_PHASES = new HashSet<>(Arrays.asList(
private static final Set<String> POST_TEST_COMPILE_PHASES = Set.of(
"test-compile",
"process-test-classes",
"test",
Expand All @@ -138,7 +138,7 @@ public class DevMojo extends AbstractMojo {
"post-integration-test",
"verify",
"install",
"deploy"));
"deploy");
private static final String QUARKUS_PLUGIN_GROUPID = "io.quarkus";
private static final String QUARKUS_PLUGIN_ARTIFACTID = "quarkus-maven-plugin";
private static final String QUARKUS_GENERATE_CODE_GOAL = "generate-code";
Expand Down Expand Up @@ -697,7 +697,7 @@ Collection<Path> pomFiles() {
}

boolean alive() {
return process == null ? false : process.isAlive();
return process != null && process.isAlive();
}

int exitValue() {
Expand Down Expand Up @@ -730,8 +730,8 @@ public void run() {
process.destroy();
try {
process.waitFor();
} catch (InterruptedException ignored) {
getLog().warn("Unable to properly wait for dev-mode end", ignored);
} catch (InterruptedException e) {
getLog().warn("Unable to properly wait for dev-mode end", e);
Copy link
Member

Choose a reason for hiding this comment

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

You should rest the interruption flag. (it was not done before)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a shutdown hook, so does it really matter to do so?

}
}
}, "Development Mode Shutdown Hook"));
Expand Down