mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
do not print trace for compilation-canceled exception
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package org.jetbrains.jps.javac;
|
||||
|
||||
/**
|
||||
* @author Eugene Zhuravlev
|
||||
* Date: 4/2/12
|
||||
*/
|
||||
class CompilationCanceledException extends RuntimeException{
|
||||
CompilationCanceledException() {
|
||||
super("Compilation canceled");
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized Throwable fillInStackTrace() {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -210,12 +210,7 @@ class JavacFileManager extends ForwardingJavaFileManager<StandardJavaFileManager
|
||||
final int counter = (myChecksCounter + 1) % 10;
|
||||
myChecksCounter = counter;
|
||||
if (counter == 0 && myContext.isCanceled()) {
|
||||
throw new RuntimeException("Compilation canceled") {
|
||||
@Override
|
||||
public Throwable fillInStackTrace() {
|
||||
return this;
|
||||
}
|
||||
};
|
||||
throw new CompilationCanceledException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,6 +140,9 @@ public class JavacServer {
|
||||
final boolean rc = JavacMain.compile(options, files, classpath, platformCp, sourcePath, outs, diagnostic, outputSink, canceledStatus);
|
||||
return JavacProtoUtil.toMessage(sessionId, JavacProtoUtil.createBuildCompletedResponse(rc));
|
||||
}
|
||||
catch (CompilationCanceledException e) {
|
||||
return JavacProtoUtil.toMessage(sessionId, JavacProtoUtil.createFailure(e.getMessage(), e));
|
||||
}
|
||||
catch (Throwable e) {
|
||||
e.printStackTrace(System.err);
|
||||
return JavacProtoUtil.toMessage(sessionId, JavacProtoUtil.createFailure(e.getMessage(), e));
|
||||
|
||||
Reference in New Issue
Block a user