Add MessageCollector#hasErrors, get rid of MessageSeverityCollector

Also fix duplicated wrapping of a message collector into a message severity
collector (in CLICompiler and in the beginning of doExecute in
K2JVMCompiler/K2JSCompiler)
This commit is contained in:
Alexander Udalov
2016-02-14 18:01:39 +03:00
parent c5e2f55ea7
commit 3c81bb4bfc
15 changed files with 107 additions and 111 deletions
@@ -33,7 +33,7 @@ import java.io.IOException;
public abstract class AbstractModuleXmlParserTest extends TestCase {
protected void doTest(String xmlPath) throws IOException {
protected static void doTest(String xmlPath) throws IOException {
File txtFile = new File(FileUtil.getNameWithoutExtension(xmlPath) + ".txt");
ModuleScriptData result = ModuleXmlParser.parseModuleScript(xmlPath, new MessageCollector() {
@@ -43,6 +43,11 @@ public abstract class AbstractModuleXmlParserTest extends TestCase {
) {
throw new AssertionError(MessageRenderer.PLAIN_FULL_PATHS.render(severity, message, location));
}
@Override
public boolean hasErrors() {
throw new UnsupportedOperationException();
}
});
StringBuilder sb = new StringBuilder();