From f1b81885dca255b308c8ea26319ada173320ad23 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Tue, 11 Dec 2012 13:28:15 +0100 Subject: [PATCH] SONAR-3887 unlock the semaphore when plugin license si not valid --- .../src/main/java/org/sonar/batch/bootstrapper/Batch.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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); -- 2.39.5