mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
make it more clear in while loading which class from which module did NCDFE occur inside groovyc
This commit is contained in:
+6
-1
@@ -158,6 +158,11 @@ public class GroovycOutputParser {
|
||||
? BuildMessage.Kind.WARNING
|
||||
: BuildMessage.Kind.INFO;
|
||||
|
||||
if (StringUtil.isEmpty(url) || "null".equals(url)) {
|
||||
url = null;
|
||||
message = "While compiling " + myChunk.getPresentableShortName() + ": " + message;
|
||||
}
|
||||
|
||||
CompilerMessage compilerMessage = new CompilerMessage("Groovyc", kind, message, url, -1, -1, -1, lineInt, columnInt);
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Message: " + compilerMessage);
|
||||
@@ -227,7 +232,7 @@ public class GroovycOutputParser {
|
||||
if (msg.contains(GroovyRtConstants.NO_GROOVY)) {
|
||||
messages.add(reportNoGroovy());
|
||||
} else {
|
||||
messages.add(new CompilerMessage("Groovyc", BuildMessage.Kind.INFO, msg));
|
||||
messages.add(new CompilerMessage("Groovyc", BuildMessage.Kind.INFO, "While compiling " + myChunk.getPresentableShortName() + ":" + msg));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+12
@@ -32,6 +32,18 @@ class JointCompilationClassLoader extends UrlClassLoader {
|
||||
myClassPath = super.getClassPath();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class _defineClass(String name, byte[] b) {
|
||||
try {
|
||||
return super._defineClass(name, b);
|
||||
}
|
||||
catch (NoClassDefFoundError e) {
|
||||
NoClassDefFoundError wrap = new NoClassDefFoundError(e.getMessage() + " needed for " + name);
|
||||
wrap.initCause(e);
|
||||
throw wrap;
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected ClassPath getClassPath() {
|
||||
|
||||
@@ -73,7 +73,7 @@ public class GroovyCompilerWrapper {
|
||||
}
|
||||
catch (NoClassDefFoundError e) {
|
||||
final String className = e.getMessage();
|
||||
if (className.startsWith("org/apache/ivy/")) {
|
||||
if (className.contains("org/apache/ivy/")) {
|
||||
addMessageWithoutLocation("Cannot @Grab without Ivy, please add it to your module dependencies (NoClassDefFoundError: " + className + ")", true);
|
||||
} else {
|
||||
throw e;
|
||||
|
||||
@@ -23,6 +23,7 @@ import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.URL;
|
||||
import java.util.*;
|
||||
@@ -135,7 +136,8 @@ public class GroovycRunner {
|
||||
method.invoke(null, forStubs, argPath, configScript, mailbox);
|
||||
}
|
||||
catch (Throwable e) {
|
||||
while (e.getCause() != null) {
|
||||
//noinspection InstanceofCatchParameter
|
||||
while (e instanceof InvocationTargetException) {
|
||||
e = e.getCause();
|
||||
}
|
||||
e.printStackTrace();
|
||||
|
||||
Reference in New Issue
Block a user