From dea00a6f109aaea450e4758b3f866a0385bb9456 Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 17 Sep 2015 11:31:14 +0200 Subject: [PATCH] IDEA-97781 Improve diagnostics when Groovy compiler has wrong dependencies in the classpath (e.g. ASM) --- .../groovy/compiler/rt/GroovyCompilerWrapper.java | 8 +++++++- 1 file changed, 7 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 937492705a5c..cb9daae622bc 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 @@ -41,6 +41,10 @@ public class GroovyCompilerWrapper { private static final String LINKAGE_ERROR = "A groovyc error occurred while trying to load one of the classes in project dependencies, please ensure it's present. " + "See the message and the stack trace below for reference\n\n"; + private static final String INCOMPATIBLE_CLASS_CHANGE_ERROR = + "A groovyc error occurred while trying to load one of the classes in project dependencies. " + + "Please ensure its version is compatible with other jars (including Groovy ones) in the dependencies. " + + "See the message and the stack trace below for reference\n\n"; private final List collector; private boolean forStubs; @@ -74,11 +78,13 @@ public class GroovyCompilerWrapper { } else { throw e; } - } catch (TypeNotPresentException e) { processException(e, LINKAGE_ERROR); } + catch (IncompatibleClassChangeError e) { + processException(e, INCOMPATIBLE_CLASS_CHANGE_ERROR); + } catch (LinkageError e) { processException(e, LINKAGE_ERROR); }