diff --git a/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/messages/MessageCollectorPlainTextToStream.java b/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/messages/MessageCollectorPlainTextToStream.java index 52212ad7e9e..12a514a4a38 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/messages/MessageCollectorPlainTextToStream.java +++ b/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/messages/MessageCollectorPlainTextToStream.java @@ -27,9 +27,7 @@ public class MessageCollectorPlainTextToStream implements MessageCollector { public static final MessageCollector PLAIN_TEXT_TO_SYSTEM_ERR = new MessageCollectorPlainTextToStream(System.err, NON_VERBOSE); - @NotNull private final PrintStream stream; - @NotNull private final Set severitiesToPrint; public MessageCollectorPlainTextToStream(@NotNull PrintStream stream, @NotNull Set severities) { @@ -40,8 +38,7 @@ public class MessageCollectorPlainTextToStream implements MessageCollector { @Override public void report(@NotNull CompilerMessageSeverity severity, @NotNull String message, @NotNull CompilerMessageLocation location) { if (severitiesToPrint.contains(severity)) { - stream.println(MessageRenderer.PLAIN.render(severity, message, location)); + stream.println(MessageRenderer.PLAIN_FULL_PATHS.render(severity, message, location)); } } - } diff --git a/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/messages/MessageRenderer.java b/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/messages/MessageRenderer.java index 281dd5d4615..948c10783fe 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/messages/MessageRenderer.java +++ b/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/messages/MessageRenderer.java @@ -25,7 +25,7 @@ import java.io.File; public interface MessageRenderer { - MessageRenderer TAGS = new MessageRenderer() { + MessageRenderer XML = new MessageRenderer() { @Override public String renderPreamble() { return ""; @@ -58,7 +58,7 @@ public interface MessageRenderer { } }; - MessageRenderer PLAIN = new PlainText() { + MessageRenderer PLAIN_FULL_PATHS = new PlainText() { @Nullable @Override protected String getPath(@NotNull CompilerMessageLocation location) { @@ -66,7 +66,7 @@ public interface MessageRenderer { } }; - MessageRenderer PLAIN_WITH_RELATIVE_PATH = new PlainText() { + MessageRenderer PLAIN_RELATIVE_PATHS = new PlainText() { private final File cwd = new File(".").getAbsoluteFile(); @Nullable @@ -102,6 +102,8 @@ public interface MessageRenderer { } String renderPreamble(); + String render(@NotNull CompilerMessageSeverity severity, @NotNull String message, @NotNull CompilerMessageLocation location); + String renderConclusion(); } diff --git a/compiler/cli/src/org/jetbrains/jet/cli/common/CLICompiler.java b/compiler/cli/src/org/jetbrains/jet/cli/common/CLICompiler.java index 5daa75868ce..22e682aa262 100644 --- a/compiler/cli/src/org/jetbrains/jet/cli/common/CLICompiler.java +++ b/compiler/cli/src/org/jetbrains/jet/cli/common/CLICompiler.java @@ -49,19 +49,19 @@ public abstract class CLICompiler { @NotNull public ExitCode exec(@NotNull PrintStream errStream, @NotNull String... args) { - return exec(errStream, Services.EMPTY, MessageRenderer.PLAIN_WITH_RELATIVE_PATH, args); + return exec(errStream, Services.EMPTY, MessageRenderer.PLAIN_RELATIVE_PATHS, args); } @SuppressWarnings("UnusedDeclaration") // Used via reflection in CompilerRunnerUtil#invokeExecMethod @NotNull public ExitCode execAndOutputHtml(@NotNull PrintStream errStream, @NotNull Services services, @NotNull String... args) { - return exec(errStream, services, MessageRenderer.TAGS, args); + return exec(errStream, services, MessageRenderer.XML, args); } @SuppressWarnings("UnusedDeclaration") // Used via reflection in KotlinCompilerBaseTask @NotNull public ExitCode execFullPathsInMessages(@NotNull PrintStream errStream, @NotNull String[] args) { - return exec(errStream, Services.EMPTY, MessageRenderer.PLAIN, args); + return exec(errStream, Services.EMPTY, MessageRenderer.PLAIN_FULL_PATHS, args); } @Nullable diff --git a/compiler/tests/org/jetbrains/jet/modules/xml/AbstractModuleXmlParserTest.java b/compiler/tests/org/jetbrains/jet/modules/xml/AbstractModuleXmlParserTest.java index e4eba5ede86..cc1bcd80f4a 100644 --- a/compiler/tests/org/jetbrains/jet/modules/xml/AbstractModuleXmlParserTest.java +++ b/compiler/tests/org/jetbrains/jet/modules/xml/AbstractModuleXmlParserTest.java @@ -41,7 +41,7 @@ public abstract class AbstractModuleXmlParserTest extends TestCase { public void report( @NotNull CompilerMessageSeverity severity, @NotNull String message, @NotNull CompilerMessageLocation location ) { - throw new AssertionError(MessageRenderer.PLAIN.render(severity, message, location)); + throw new AssertionError(MessageRenderer.PLAIN_FULL_PATHS.render(severity, message, location)); } });