mirror of
https://github.com/apache/maven-mvnd.git
synced 2026-01-13 07:04:14 +08:00
[1.x] mixup in case of DISPLAY messages type (#1037)
ProjectEvent message mixup fixed. Fixes #1036
This commit is contained in:
@@ -165,7 +165,7 @@ public class DefaultClient implements Client {
|
||||
} 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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -499,6 +499,8 @@ public abstract class Message {
|
||||
|
||||
private String mnemonic() {
|
||||
switch (type) {
|
||||
case DISPLAY:
|
||||
return "Display";
|
||||
case PROJECT_LOG_MESSAGE:
|
||||
return "ProjectLogMessage";
|
||||
default:
|
||||
@@ -730,8 +732,6 @@ public abstract class Message {
|
||||
return "KeyboardInput";
|
||||
case BUILD_LOG_MESSAGE:
|
||||
return "BuildLogMessage";
|
||||
case DISPLAY:
|
||||
return "Display";
|
||||
case PRINT_OUT:
|
||||
return "PrintOut";
|
||||
case PRINT_ERR:
|
||||
@@ -1112,10 +1112,6 @@ public abstract class Message {
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -312,9 +312,9 @@ public class TerminalOutput implements ClientOutput {
|
||||
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: {
|
||||
|
||||
@@ -59,7 +59,7 @@ public class TestClientOutput implements ClientOutput {
|
||||
|
||||
@Override
|
||||
public void describeTerminal() {
|
||||
accept(Message.display("Test terminal"));
|
||||
accept(Message.display("test", "Test terminal"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user