From efa4711e2c0e250b0fb48d94d5408cce90946e35 Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 17 Sep 2015 12:17:55 +0200 Subject: [PATCH] display groovyc version mismatch message more prominently (IDEA-96332) --- .../groovy/compiler/rt/GroovyCompilerWrapper.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/groovy/rt/src/org/jetbrains/groovy/compiler/rt/GroovyCompilerWrapper.java b/plugins/groovy/rt/src/org/jetbrains/groovy/compiler/rt/GroovyCompilerWrapper.java index 40dd9ef6392a..7819f1fccb2b 100644 --- a/plugins/groovy/rt/src/org/jetbrains/groovy/compiler/rt/GroovyCompilerWrapper.java +++ b/plugins/groovy/rt/src/org/jetbrains/groovy/compiler/rt/GroovyCompilerWrapper.java @@ -86,7 +86,11 @@ public class GroovyCompilerWrapper { processException(e, INCOMPATIBLE_CLASS_CHANGE_ERROR); } catch (LinkageError e) { - processException(e, LINKAGE_ERROR); + if (e.getCause() instanceof GroovyRuntimeException) { + processException(e, getExceptionMessage((GroovyRuntimeException)e.getCause())); + } else { + processException(e, LINKAGE_ERROR); + } } finally { addWarnings(unit.getErrorCollector()); @@ -207,6 +211,9 @@ public class GroovyCompilerWrapper { final StringWriter writer = new StringWriter(); writer.append(prefix); + if (!prefix.endsWith("\n")) { + writer.append("\n\n"); + } //noinspection IOResourceOpenedButNotSafelyClosed exception.printStackTrace(new PrintWriter(writer)); collector.add(new CompilerMessage(forStubs ? GroovyCompilerMessageCategories.INFORMATION : GroovyCompilerMessageCategories.ERROR, writer.toString(), null, -1, -1));