当我调用以下函数时,出现Internal error: anatlyzer.atl.analyser.AnalyserInternalError: java.util.concurrent.ExecutionException: java.lang.NullPointerException
错误。尝试,捕获,最后全部运行。我该如何解决?
public void perform() {
ExecutorService executor = Executors.newSingleThreadExecutor();
Future<?> result = executor.submit(new Runnable() {
@Override
public void run() {
AnalyserContext.setErrorModel(errors);
AnalyserContext.setTypingModel(typ);
AnalyserContext.setGlobalNamespace(mm);
stage++;
List<? extends Unit> units = trafo.allObjectsOf(Unit.class);
for (Unit unit : units) {
new ExtendTransformation(trafo, mm, unit).perform();
... } });
try {
// wait;
result.get();
} catch (Exception e) {
throw new AnalyserInternalError(e, stage);
} finally {
executor.shutdown();
}
}