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

mixup in case of DISPLAY messages type #1038

Merged
merged 2 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public static void main(String[] argv) throws Exception {
} catch (DaemonException.InterruptedException e) {
final AttributedStyle s = new AttributedStyle().bold().foreground(AttributedStyle.RED);
String str = new AttributedString(System.lineSeparator() + "Canceled by user", s).toAnsi();
output.accept(Message.display(str));
output.accept(Message.err(str));
exitCode = 130;
}
}
Expand Down
8 changes: 2 additions & 6 deletions common/src/main/java/org/mvndaemon/mvnd/common/Message.java
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,8 @@ public String toString() {

private String mnemonic() {
switch (type) {
case DISPLAY:
return "Display";
case PROJECT_LOG_MESSAGE:
return "ProjectLogMessage";
default:
Expand Down Expand Up @@ -730,8 +732,6 @@ private String mnemonic() {
return "KeyboardInput";
case BUILD_LOG_MESSAGE:
return "BuildLogMessage";
case DISPLAY:
return "Display";
case PRINT_OUT:
return "PrintOut";
case PRINT_ERR:
Expand Down Expand Up @@ -1112,10 +1112,6 @@ public static StringMessage buildStatus(String payload) {
return new StringMessage(BUILD_STATUS, payload);
}

public static StringMessage display(String message) {
return new StringMessage(DISPLAY, message);
}

public static RequestInput requestInput(String projectId) {
return new RequestInput(projectId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,9 @@ private boolean doAccept(Message entry) {
break;
}
case Message.DISPLAY: {
Message.StringMessage d = (Message.StringMessage) entry;
clearDisplay();
terminal.writer().printf("%s%n", d.getMessage());
Message.ProjectEvent d = (Message.ProjectEvent) entry;
terminal.writer().printf("[%s] %s%n", d.getProjectId(), d.getMessage());
break;
}
case Message.PRINT_OUT: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void accept(List<Message> messages) {

@Override
public void describeTerminal() {
accept(Message.display("Test terminal"));
accept(Message.display("test", "Test terminal"));
}

@Override
Expand Down