From: Simon Brandhof Date: Tue, 11 Dec 2012 12:28:15 +0000 (+0100) Subject: SONAR-3887 unlock the semaphore when plugin license si not valid X-Git-Tag: 3.4~58 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f1b81885dca255b308c8ea26319ada173320ad23;p=sonarqube.git SONAR-3887 unlock the semaphore when plugin license si not valid --- diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrapper/Batch.java b/sonar-batch/src/main/java/org/sonar/batch/bootstrapper/Batch.java index 254cd8c4f25..c670d4439ec 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/bootstrapper/Batch.java +++ b/sonar-batch/src/main/java/org/sonar/batch/bootstrapper/Batch.java @@ -68,14 +68,17 @@ public final class Batch { } private void startBatch() { - Module bootstrapModule = new BootstrapModule(projectReactor, components.toArray(new Object[components.size()])).init(); + Module bootstrapModule = null; try { + bootstrapModule = new BootstrapModule(projectReactor, components.toArray(new Object[components.size()])).init(); bootstrapModule.start(); } catch (RuntimeException e) { PicoUtils.propagateStartupException(e); } finally { try { - bootstrapModule.stop(); + if (bootstrapModule != null) { + bootstrapModule.stop(); + } } catch (Exception e) { // never throw exceptions in a finally block LoggerFactory.getLogger(Batch.class).error("Error while stopping batch", e);