Skip to content

Commit

Permalink
fix(java_common): allow analyzers to throw InterruptedExceptions (#3330)
Browse files Browse the repository at this point in the history
  • Loading branch information
schroederc committed Dec 19, 2018
1 parent a423b40 commit 01617d9
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ public AbstractCompilationAnalyzer(StatisticsCollector statistics) {
* Analyzes the given {@link AnalysisRequest}, emitting all facts with the given {@link
* FactEmitter}.
*/
public void analyzeRequest(AnalysisRequest req, FactEmitter emitter) throws AnalysisException {
public void analyzeRequest(AnalysisRequest req, FactEmitter emitter)
throws AnalysisException, InterruptedException {
Preconditions.checkNotNull(req, "AnalysisRequest must be non-null");
Stopwatch timer = Stopwatch.createStarted();
try (FileDataProvider fileData = parseFileDataService(req.getFileDataService())) {
Expand All @@ -65,6 +66,8 @@ public void analyzeRequest(AnalysisRequest req, FactEmitter emitter) throws Anal
"Analyzing compilation: {%s}",
TextFormat.shortDebugString(req.getCompilation().getVName()));
analyzeCompilation(req.getCompilation(), Optional.ofNullable(revision), fileData, emitter);
} catch (InterruptedException e) {
throw e;
} catch (Throwable t) {
logger.atWarning().withCause(t).log("Uncaught exception");
t.printStackTrace();
Expand Down Expand Up @@ -95,7 +98,7 @@ protected abstract void analyzeCompilation(
Optional<String> revision,
FileDataProvider fileDataProvider,
FactEmitter emitter)
throws AnalysisException;
throws AnalysisException, InterruptedException;

/**
* {@link FactEmitter} that emits an {@link AnalysisOutput} with an embedded {@link Entry} for
Expand Down

0 comments on commit 01617d9

Please sign in to comment.