Skip to content

Commit c87b2fc

Browse files
committed
Simplify command-airline codestart
1 parent 1673d7a commit c87b2fc

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

command-airline/runtime/src/main/codestarts/quarkus/quarkiverse-github-app-command-airline-codestart/java/src/main/java/org/acme/MyGitHubBot.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package org.acme;
22

33
import java.io.IOException;
4+
import java.util.ArrayList;
45
import java.util.List;
56

67
import org.kohsuke.github.GHEventPayload;
@@ -24,12 +25,12 @@ interface Commands {
2425
static class SayHello implements Commands {
2526

2627
@Arguments
27-
List<String> arguments;
28+
List<String> arguments = new ArrayList<>();
2829

2930
@Override
3031
public void run(GHEventPayload.IssueComment issueCommentPayload) throws IOException {
3132
issueCommentPayload.getIssue()
32-
.comment(":wave: Hello " + (arguments != null ? String.join(" ", arguments) : "from Bot"));
33+
.comment(":wave: Hello " + String.join(" ", arguments));
3334
}
3435
}
3536

integration-tests/command-airline/src/test/resources/__snapshots__/CodestartTest/testContent/src_main_java_ilove_quark_us_MyGitHubBot.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package ilove.quark.us;
22

33
import java.io.IOException;
4+
import java.util.ArrayList;
45
import java.util.List;
56

67
import org.kohsuke.github.GHEventPayload;
@@ -24,12 +25,12 @@ interface Commands {
2425
static class SayHello implements Commands {
2526

2627
@Arguments
27-
List<String> arguments;
28+
List<String> arguments = new ArrayList<>();
2829

2930
@Override
3031
public void run(GHEventPayload.IssueComment issueCommentPayload) throws IOException {
3132
issueCommentPayload.getIssue()
32-
.comment(":wave: Hello " + (arguments != null ? String.join(" ", arguments) : "from Bot"));
33+
.comment(":wave: Hello " + String.join(" ", arguments));
3334
}
3435
}
3536

0 commit comments

Comments
 (0)