[groovy] use context classloader instead of 'this' classloader (IDEA-138275)

(cherry picked from commit 4f32475)
This commit is contained in:
Daniil Ovchinnikov
2015-04-07 15:19:10 +03:00
parent 52df7031b7
commit 62decdd714
@@ -196,10 +196,12 @@ public class DependentGroovycRunner {
}
}
else if (line.startsWith(GroovyRtConstants.PATCHERS)) {
final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
String s;
while (!GroovyRtConstants.END.equals(s = reader.readLine())) {
try {
final CompilationUnitPatcher patcher = (CompilationUnitPatcher)Class.forName(s).newInstance();
final Class<?> patcherClass = classLoader.loadClass(s);
final CompilationUnitPatcher patcher = (CompilationUnitPatcher)patcherClass.newInstance();
patchers.add(patcher);
}
catch (InstantiationException e) {