You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by kw...@apache.org on 2025/10/14 14:27:59 UTC

(sling-org-apache-sling-event) branch master updated (c6ec865 -> 2295761)

This is an automated email from the ASF dual-hosted git repository.

kwin pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-event.git


    from c6ec865  Update README for clarity on bundle implementation
     new 2ab428d  SLING-12261 Use Parent 62
     new 298d2c2  SLING-12261 Reformat with Spotless
     new 2295761  Fix brittle test

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .sling-module.json                                 |   3 +-
 pom.xml                                            | 284 +++++++++--------
 .../sling/event/impl/EnvironmentComponent.java     |  17 +-
 .../sling/event/impl/EventingThreadPool.java       |  26 +-
 .../InitDelayingTopologyEventListener.java         |  38 ++-
 .../sling/event/impl/jobs/InternalJobState.java    |   7 +-
 .../sling/event/impl/jobs/JobBuilderImpl.java      |   1 -
 .../sling/event/impl/jobs/JobConsumerManager.java  | 261 ++++++++--------
 .../apache/sling/event/impl/jobs/JobHandler.java   |  87 +++---
 .../org/apache/sling/event/impl/jobs/JobImpl.java  |  67 ++--
 .../sling/event/impl/jobs/JobManagerImpl.java      | 287 ++++++++---------
 .../sling/event/impl/jobs/JobTopicTraverser.java   |  38 ++-
 .../org/apache/sling/event/impl/jobs/Utility.java  | 104 ++++---
 .../impl/jobs/config/ConfigurationConstants.java   |   1 -
 .../jobs/config/InternalQueueConfiguration.java    | 216 +++++++------
 .../impl/jobs/config/JobManagerConfiguration.java  | 216 +++++++------
 .../impl/jobs/config/MainQueueConfiguration.java   | 175 +++++------
 .../jobs/config/QueueConfigurationManager.java     |  36 +--
 .../impl/jobs/config/TopologyCapabilities.java     |  90 +++---
 .../event/impl/jobs/config/TopologyHandler.java    |  19 +-
 .../event/impl/jobs/console/InventoryPlugin.java   | 206 +++++++------
 .../event/impl/jobs/console/WebConsolePlugin.java  | 261 +++++++++-------
 .../event/impl/jobs/jmx/AbstractJobStatistics.java |  21 +-
 .../event/impl/jobs/jmx/AllJobStatisticsMBean.java |  21 +-
 .../sling/event/impl/jobs/jmx/EmptyStatistics.java |  17 +-
 .../sling/event/impl/jobs/jmx/QueueMBeanImpl.java  |  13 +-
 .../event/impl/jobs/jmx/QueueStatusEvent.java      |  15 +-
 .../sling/event/impl/jobs/jmx/QueuesMBeanImpl.java | 114 ++++---
 .../impl/jobs/notifications/NewJobSender.java      |  36 +--
 .../jobs/notifications/NotificationUtility.java    |  21 +-
 .../impl/jobs/queues/JobExecutionContextImpl.java  |  33 +-
 .../impl/jobs/queues/JobExecutionResultImpl.java   |  14 +-
 .../sling/event/impl/jobs/queues/JobQueueImpl.java | 308 ++++++++++---------
 .../event/impl/jobs/queues/QueueJobCache.java      | 132 ++++----
 .../sling/event/impl/jobs/queues/QueueManager.java | 144 +++++----
 .../jobs/scheduling/JobScheduleBuilderImpl.java    |  17 +-
 .../impl/jobs/scheduling/JobSchedulerImpl.java     | 230 +++++++-------
 .../impl/jobs/scheduling/ScheduledJobHandler.java  | 139 +++++----
 .../impl/jobs/scheduling/ScheduledJobInfoImpl.java |  21 +-
 .../event/impl/jobs/stats/BaseStatisticsImpl.java  |  16 +-
 .../sling/event/impl/jobs/stats/GaugeSupport.java  |  26 +-
 .../event/impl/jobs/stats/StatisticsImpl.java      |   6 +-
 .../event/impl/jobs/stats/StatisticsManager.java   |  67 ++--
 .../event/impl/jobs/tasks/CheckTopologyTask.java   | 178 ++++++-----
 .../sling/event/impl/jobs/tasks/CleanUpTask.java   | 171 +++++------
 .../impl/jobs/tasks/FindUnfinishedJobsTask.java    |  26 +-
 .../event/impl/jobs/tasks/HistoryCleanUpTask.java  | 115 ++++---
 .../sling/event/impl/jobs/tasks/UpgradeTask.java   |  72 +++--
 .../event/impl/support/BatchResourceRemover.java   |   7 +-
 .../event/impl/support/ExactTopicMatcher.java      |   2 +-
 .../event/impl/support/PackageTopicMatcher.java    |   3 +-
 .../sling/event/impl/support/ResourceHelper.java   | 110 +++----
 .../sling/event/impl/support/ScheduleInfoImpl.java | 290 +++++++++---------
 .../impl/support/SubPackagesTopicMatcher.java      |   9 +-
 .../event/impl/support/TopicMatcherHelper.java     |  57 ++--
 .../org/apache/sling/event/impl/JsonTestBase.java  |  10 +-
 .../java/org/apache/sling/event/impl/TestUtil.java |  12 +-
 .../InitDelayingTopologyEventListenerTest.java     |  16 +-
 .../jobs/InstanceDescriptionComparatorTest.java    |  17 +-
 .../event/impl/jobs/JobConsumerManagerTest.java    |  31 +-
 .../sling/event/impl/jobs/JobHandlerTest.java      | 130 ++++----
 .../sling/event/impl/jobs/JobManagerImplTest.java  |  79 +++--
 .../apache/sling/event/impl/jobs/JobsImplTest.java |  12 +-
 .../sling/event/impl/jobs/StatisticsImplTest.java  |  22 +-
 .../apache/sling/event/impl/jobs/UtilityTest.java  |  19 +-
 .../config/InternalQueueConfigurationTest.java     |  77 +++--
 .../jobs/config/JobManagerConfigurationTest.java   |  33 +-
 .../config/JobManagerConfigurationTestFactory.java |  62 ++--
 .../jobs/config/QueueConfigurationManagerTest.java |  25 +-
 .../impl/jobs/config/TopologyCapabilitiesTest.java |  10 +-
 .../impl/jobs/console/InventoryPluginTest.java     | 211 ++++++-------
 .../impl/jobs/jmx/AllJobStatisticsMBeanTest.java   |  19 +-
 .../sling/event/impl/jobs/jmx/DummyStatistics.java |  43 ++-
 .../event/impl/jobs/jmx/QueuesMBeanImplTest.java   |  76 +++--
 .../jobs/queues/JobExecutionContextImplTest.java   |  50 +--
 .../event/impl/jobs/queues/JobQueueImplTest.java   | 111 ++++---
 .../event/impl/jobs/queues/TestTopicHalting.java   | 163 +++++-----
 .../event/impl/jobs/stats/StatisticsImplTest.java  |  22 +-
 .../impl/jobs/stats/StatisticsManagerTest.java     |  30 +-
 .../impl/jobs/stats/TopicStatisticsImplTest.java   |  18 +-
 .../sling/event/impl/jobs/tasks/CleanUpTest.java   | 110 ++++---
 .../jobs/tasks/HistoryCleanUpRemovedJobsTest.java  |  27 +-
 .../impl/jobs/tasks/HistoryCleanUpTaskTest.java    |  12 +-
 .../sling/event/it/AbstractJobHandlingIT.java      |  60 ++--
 .../sling/event/it/AbstractMaxParallelIT.java      | 136 ++++----
 .../java/org/apache/sling/event/it/ChaosIT.java    | 209 +++++++------
 .../org/apache/sling/event/it/ClassloadingIT.java  | 156 +++++-----
 .../java/org/apache/sling/event/it/HistoryIT.java  | 133 +++++---
 .../sling/event/it/JobHandlingConditionIT.java     |  20 +-
 .../org/apache/sling/event/it/JobHandlingIT.java   | 341 ++++++++++-----------
 .../apache/sling/event/it/JobManagerSearchIT.java  |  20 +-
 .../org/apache/sling/event/it/JobsTestSupport.java |  73 +++--
 .../sling/event/it/OrderedMaxParallelIT.java       |  25 +-
 .../org/apache/sling/event/it/OrderedQueueIT.java  | 106 ++++---
 .../sling/event/it/RoundRobinMaxParallelIT.java    |  23 +-
 .../apache/sling/event/it/RoundRobinQueueIT.java   |  98 +++---
 .../org/apache/sling/event/it/SchedulingIT.java    |  48 +--
 .../org/apache/sling/event/it/TimedJobsIT.java     |  13 +-
 .../org/apache/sling/event/it/TopicMatchingIT.java | 107 +++----
 .../apache/sling/event/it/UnorderedQueueIT.java    |  98 +++---
 100 files changed, 4221 insertions(+), 3783 deletions(-)


(sling-org-apache-sling-event) 03/03: Fix brittle test

Posted by kw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kwin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-event.git

commit 22957616a8f93aca555b2f5dfac3f36c042ded5a
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Mon Oct 13 15:50:20 2025 +0200

    Fix brittle test
    
    Close dangling resource resolver in test
---
 .../sling/event/impl/jobs/tasks/CleanUpTask.java      |  4 ++--
 .../event/impl/jobs/tasks/HistoryCleanUpTask.java     |  2 +-
 .../event/impl/jobs/queues/TestTopicHalting.java      | 19 ++++++++++---------
 .../jobs/tasks/HistoryCleanUpRemovedJobsTest.java     | 16 +++++++++-------
 4 files changed, 22 insertions(+), 19 deletions(-)

diff --git a/src/main/java/org/apache/sling/event/impl/jobs/tasks/CleanUpTask.java b/src/main/java/org/apache/sling/event/impl/jobs/tasks/CleanUpTask.java
index 24cb007..70b5d50 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/tasks/CleanUpTask.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/tasks/CleanUpTask.java
@@ -142,11 +142,11 @@ public class CleanUpTask {
         logger.debug("Job manager maintenance: Finished #{}", this.schedulerRuns);
     }
 
-    private void historyCleanUpRemovedJobs(Calendar since) {
+    private void historyCleanUpRemovedJobs(Calendar olderThan) {
         ResourceResolver resolver = this.configuration.createResourceResolver();
         try {
             HistoryCleanUpTask.cleanup(
-                    since,
+                    olderThan,
                     resolver,
                     /**
                      * We use a dummy context here as we are running it as a
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/tasks/HistoryCleanUpTask.java b/src/main/java/org/apache/sling/event/impl/jobs/tasks/HistoryCleanUpTask.java
index 116c57c..9a94423 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/tasks/HistoryCleanUpTask.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/tasks/HistoryCleanUpTask.java
@@ -202,7 +202,7 @@ public class HistoryCleanUpTask implements JobExecutor {
 
                                     // check if we can delete the minute
                                     final int minute = Integer.valueOf(minuteResource.getName());
-                                    final boolean oldMinute = oldHour || minute <= removeMinute;
+                                    final boolean oldMinute = oldHour || minute < removeMinute;
 
                                     if (oldMinute) {
                                         final Iterator<Resource> jobIter = minuteResource.listChildren();
diff --git a/src/test/java/org/apache/sling/event/impl/jobs/queues/TestTopicHalting.java b/src/test/java/org/apache/sling/event/impl/jobs/queues/TestTopicHalting.java
index f6c2ed5..51b3f35 100644
--- a/src/test/java/org/apache/sling/event/impl/jobs/queues/TestTopicHalting.java
+++ b/src/test/java/org/apache/sling/event/impl/jobs/queues/TestTopicHalting.java
@@ -168,17 +168,18 @@ public class TestTopicHalting {
 
         queueManager.activate(null);
 
-        @SuppressWarnings("deprecation")
-        ResourceResolver resourceResolver = factory.getAdministrativeResourceResolver(null);
-        ContentBuilder contentBuilder = new ContentBuilder(resourceResolver);
-
-        final String topic = "aTopic";
-        for (int year = 2019; year <= 2022; year++) {
-            for (int month = 1; month <= 12; month++) {
-                createJob(contentBuilder, ownSlingId, topic, year, month);
+        try (@SuppressWarnings("deprecation")
+                ResourceResolver resourceResolver = factory.getAdministrativeResourceResolver(null)) {
+            ContentBuilder contentBuilder = new ContentBuilder(resourceResolver);
+
+            final String topic = "aTopic";
+            for (int year = 2019; year <= 2022; year++) {
+                for (int month = 1; month <= 12; month++) {
+                    createJob(contentBuilder, ownSlingId, topic, year, month);
+                }
             }
+            resourceResolver.commit();
         }
-        resourceResolver.commit();
     }
 
     private void initQueueConfigurationManagerMocks() {
diff --git a/src/test/java/org/apache/sling/event/impl/jobs/tasks/HistoryCleanUpRemovedJobsTest.java b/src/test/java/org/apache/sling/event/impl/jobs/tasks/HistoryCleanUpRemovedJobsTest.java
index 5334000..6a865ae 100644
--- a/src/test/java/org/apache/sling/event/impl/jobs/tasks/HistoryCleanUpRemovedJobsTest.java
+++ b/src/test/java/org/apache/sling/event/impl/jobs/tasks/HistoryCleanUpRemovedJobsTest.java
@@ -45,7 +45,6 @@ public class HistoryCleanUpRemovedJobsTest {
     private static final String JCR_TOPIC = "test";
     private static final String JCR_JOB_NAME = "test-job";
     private static final SimpleDateFormat DATE_FORMATTER = new SimpleDateFormat("yyyy/MM/dd/HH/mm");
-    private static final int MAX_AGE_IN_DAYS = 60;
 
     @Rule
     public final SlingContext ctx = new SlingContext();
@@ -67,6 +66,7 @@ public class HistoryCleanUpRemovedJobsTest {
     private void setupConfiguration() {
         Mockito.when(configuration.getStoredCancelledJobsPath()).thenReturn(JCR_PATH);
         Mockito.when(configuration.createResourceResolver()).thenReturn(ctx.resourceResolver());
+        // should remove jobs completed more than 1 minute ago
         Mockito.when(configuration.getHistoryCleanUpRemovedJobs()).thenReturn(1);
     }
 
@@ -77,6 +77,7 @@ public class HistoryCleanUpRemovedJobsTest {
     @Test
     public void shouldNotDeleteDroppedResourcesYoungerThanRemoveDate() {
         Calendar calendar = Calendar.getInstance();
+        // this should be at less than 1 minute earlier than the cut-off date (disregarding seconds)
         calendar.add(Calendar.SECOND, -1);
         Resource resource = createResourceForDate(calendar, Job.JobState.DROPPED.name());
         task.run();
@@ -86,6 +87,7 @@ public class HistoryCleanUpRemovedJobsTest {
     @Test
     public void shouldNotDeleteErrorResourcesYoungerThanRemoveDate() {
         Calendar calendar = Calendar.getInstance();
+        // this should be at less than 1 minute earlier than the cut-off date (disregarding seconds)
         calendar.add(Calendar.SECOND, -1);
         Resource resource = createResourceForDate(calendar, Job.JobState.ERROR.name());
         task.run();
@@ -95,8 +97,8 @@ public class HistoryCleanUpRemovedJobsTest {
     @Test
     public void shouldNotDeleteSuccessfulResourcesOlderThanRemoveDate() {
         Calendar calendar = Calendar.getInstance();
-
-        calendar.add(Calendar.MINUTE, -1);
+        // this should be at least 1 minute earlier than the cut-off date (disregarding seconds)
+        calendar.add(Calendar.MINUTE, -2);
         Resource resource = createResourceForDate(calendar, Job.JobState.SUCCEEDED.name());
 
         task.run();
@@ -106,8 +108,8 @@ public class HistoryCleanUpRemovedJobsTest {
     @Test
     public void shouldDeleteDroppedResourcesOlderThanRemoveDate() {
         Calendar calendar = Calendar.getInstance();
-
-        calendar.add(Calendar.MINUTE, -1);
+        // this should be at least 1 minute earlier than the cut-off date (disregarding seconds)
+        calendar.add(Calendar.MINUTE, -2);
         Resource resource = createResourceForDate(calendar, Job.JobState.DROPPED.name());
 
         task.run();
@@ -117,8 +119,8 @@ public class HistoryCleanUpRemovedJobsTest {
     @Test
     public void shouldDeleteErrorResourcesOlderThanRemoveDate() {
         Calendar calendar = Calendar.getInstance();
-
-        calendar.add(Calendar.MINUTE, -1);
+        // this should be at least 1 minute earlier than the cut-off date (disregarding seconds)
+        calendar.add(Calendar.MINUTE, -2);
         Resource resource = createResourceForDate(calendar, Job.JobState.DROPPED.name());
 
         task.run();


(sling-org-apache-sling-event) 01/03: SLING-12261 Use Parent 62

Posted by kw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kwin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-event.git

commit 2ab428d38fbdbaa9cc3215481af9043849207054
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Fri Oct 10 18:10:56 2025 +0200

    SLING-12261 Use Parent 62
    
    Update dependencies to be compliant with Sling Mock 3.x
---
 .sling-module.json                                 |   3 +-
 pom.xml                                            | 100 +++++++++++++--------
 .../sling/event/impl/jobs/JobManagerImplTest.java  |   2 +-
 3 files changed, 64 insertions(+), 41 deletions(-)

diff --git a/.sling-module.json b/.sling-module.json
index 8b0fb37..35477b9 100644
--- a/.sling-module.json
+++ b/.sling-module.json
@@ -1,5 +1,6 @@
 {
     "jenkins": {
-        "buildTimeout": 60
+        "buildTimeout": 60,
+        "jdks": [17, 21]
     }
 }
diff --git a/pom.xml b/pom.xml
index ee26cfa..07c5717 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling-bundle-parent</artifactId>
-        <version>48</version>
+        <version>62</version>
         <relativePath />
     </parent>
 
@@ -47,8 +47,7 @@
         <min.port>37000</min.port>
         <max.port>37999</max.port>
         <project.build.outputTimestamp>2025-06-04T08:33:29Z</project.build.outputTimestamp>
-        <!-- Mockito does no longer support Java 8 -->
-        <minimalJavaBuildVersion>11</minimalJavaBuildVersion>
+        <sling.java.version>8</sling.java.version>
     </properties>
 
 
@@ -144,12 +143,34 @@
         <dependency>
             <groupId>org.osgi</groupId>
             <artifactId>org.osgi.service.component.annotations</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.service.metatype.annotations</artifactId>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.jetbrains</groupId>
             <artifactId>annotations</artifactId>
             <scope>provided</scope>
         </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.framework</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.service.event</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.service.condition</artifactId>
+            <version>1.0.0</version>
+            <scope>provided</scope>
+        </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.discovery.api</artifactId>
@@ -165,14 +186,7 @@
         <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>osgi.core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>osgi.cmpn</artifactId>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
@@ -183,13 +197,19 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.api</artifactId>
-            <version>2.11.0</version>
+            <version>2.25.4</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.event.api</artifactId>
+            <version>1.0.4</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.commons.osgi</artifactId>
-            <version>2.1.0</version>
+            <version>2.4.0</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
@@ -213,13 +233,13 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.serviceusermapper</artifactId>
-            <version>1.2.0</version>
+            <version>1.5.4</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.jackrabbit</groupId>
             <artifactId>jackrabbit-jcr-commons</artifactId>
-            <version>2.11.2</version>
+            <version>2.20.9</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
@@ -232,11 +252,32 @@
         <dependency>
             <groupId>javax.servlet</groupId>
             <artifactId>javax.servlet-api</artifactId>
+            <scope>provided</scope>
         </dependency>
         <!-- Testing -->
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.testing.sling-mock-oak</artifactId>
+            <version>3.1.0-1.40.0</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.testing.sling-mock.junit4</artifactId>
+            <version>3.5.4</version>
+            <scope>test</scope>
+        </dependency>
+        <!-- transitive dependency of sling-mock, otherwise ancient version from commons.testing takes precedence-->
+        <dependency>
+            <artifactId>org.apache.sling.jcr.api</artifactId>
+            <groupId>org.apache.sling</groupId>
+            <version>2.4.0</version>
+            <scope>test</scope>
+        </dependency>
         <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-simple</artifactId>
+            <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.osgi</groupId>
@@ -261,18 +302,6 @@
             <version>2.0.20</version>
             <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>org.apache.sling</groupId>
-            <artifactId>org.apache.sling.testing.sling-mock</artifactId>
-            <version>2.2.6</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.sling</groupId>
-            <artifactId>org.apache.sling.testing.sling-mock-oak</artifactId>
-            <version>3.1.0-1.40.0</version>
-            <scope>test</scope>
-        </dependency>
         <dependency>
             <groupId>com.jayway.jsonpath</groupId>
             <artifactId>json-path</artifactId>
@@ -297,16 +326,11 @@
             <artifactId>javax.inject</artifactId>
             <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>org.apache.sling</groupId>
-            <artifactId>org.apache.sling.event.api</artifactId>
-            <version>1.0.4</version>
-        </dependency>
-
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.commons.testing</artifactId>
             <version>2.0.10</version>
+            <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
@@ -332,7 +356,6 @@
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
             <scope>test</scope>
-            <version>4.13.1</version>
         </dependency>
         <dependency>
             <groupId>org.jmock</groupId>
@@ -379,11 +402,10 @@
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.service.condition</artifactId>
-            <version>1.0.0</version>
-            <scope>provided</scope>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+            <version>3.19.0</version>
+            <scope>test</scope>
         </dependency>
-
     </dependencies>
 </project>
diff --git a/src/test/java/org/apache/sling/event/impl/jobs/JobManagerImplTest.java b/src/test/java/org/apache/sling/event/impl/jobs/JobManagerImplTest.java
index fb391d5..991dc1f 100644
--- a/src/test/java/org/apache/sling/event/impl/jobs/JobManagerImplTest.java
+++ b/src/test/java/org/apache/sling/event/impl/jobs/JobManagerImplTest.java
@@ -32,7 +32,7 @@ import java.io.IOException;
 import java.io.PrintStream;
 import java.lang.reflect.InvocationTargetException;
 
-import org.apache.commons.lang.reflect.FieldUtils;
+import org.apache.commons.lang3.reflect.FieldUtils;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.event.impl.TestUtil;


(sling-org-apache-sling-event) 02/03: SLING-12261 Reformat with Spotless

Posted by kw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kwin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-event.git

commit 298d2c2e71b334081f56ab8a664235443f5e9521
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Fri Oct 10 18:12:18 2025 +0200

    SLING-12261 Reformat with Spotless
---
 pom.xml                                            | 186 +++++------
 .../sling/event/impl/EnvironmentComponent.java     |  17 +-
 .../sling/event/impl/EventingThreadPool.java       |  26 +-
 .../InitDelayingTopologyEventListener.java         |  38 ++-
 .../sling/event/impl/jobs/InternalJobState.java    |   7 +-
 .../sling/event/impl/jobs/JobBuilderImpl.java      |   1 -
 .../sling/event/impl/jobs/JobConsumerManager.java  | 261 ++++++++--------
 .../apache/sling/event/impl/jobs/JobHandler.java   |  87 +++---
 .../org/apache/sling/event/impl/jobs/JobImpl.java  |  67 ++--
 .../sling/event/impl/jobs/JobManagerImpl.java      | 287 ++++++++---------
 .../sling/event/impl/jobs/JobTopicTraverser.java   |  38 ++-
 .../org/apache/sling/event/impl/jobs/Utility.java  | 104 ++++---
 .../impl/jobs/config/ConfigurationConstants.java   |   1 -
 .../jobs/config/InternalQueueConfiguration.java    | 216 +++++++------
 .../impl/jobs/config/JobManagerConfiguration.java  | 216 +++++++------
 .../impl/jobs/config/MainQueueConfiguration.java   | 175 +++++------
 .../jobs/config/QueueConfigurationManager.java     |  36 +--
 .../impl/jobs/config/TopologyCapabilities.java     |  90 +++---
 .../event/impl/jobs/config/TopologyHandler.java    |  19 +-
 .../event/impl/jobs/console/InventoryPlugin.java   | 206 +++++++------
 .../event/impl/jobs/console/WebConsolePlugin.java  | 261 +++++++++-------
 .../event/impl/jobs/jmx/AbstractJobStatistics.java |  21 +-
 .../event/impl/jobs/jmx/AllJobStatisticsMBean.java |  21 +-
 .../sling/event/impl/jobs/jmx/EmptyStatistics.java |  17 +-
 .../sling/event/impl/jobs/jmx/QueueMBeanImpl.java  |  13 +-
 .../event/impl/jobs/jmx/QueueStatusEvent.java      |  15 +-
 .../sling/event/impl/jobs/jmx/QueuesMBeanImpl.java | 114 ++++---
 .../impl/jobs/notifications/NewJobSender.java      |  36 +--
 .../jobs/notifications/NotificationUtility.java    |  21 +-
 .../impl/jobs/queues/JobExecutionContextImpl.java  |  33 +-
 .../impl/jobs/queues/JobExecutionResultImpl.java   |  14 +-
 .../sling/event/impl/jobs/queues/JobQueueImpl.java | 308 ++++++++++---------
 .../event/impl/jobs/queues/QueueJobCache.java      | 132 ++++----
 .../sling/event/impl/jobs/queues/QueueManager.java | 144 +++++----
 .../jobs/scheduling/JobScheduleBuilderImpl.java    |  17 +-
 .../impl/jobs/scheduling/JobSchedulerImpl.java     | 230 +++++++-------
 .../impl/jobs/scheduling/ScheduledJobHandler.java  | 139 +++++----
 .../impl/jobs/scheduling/ScheduledJobInfoImpl.java |  21 +-
 .../event/impl/jobs/stats/BaseStatisticsImpl.java  |  16 +-
 .../sling/event/impl/jobs/stats/GaugeSupport.java  |  26 +-
 .../event/impl/jobs/stats/StatisticsImpl.java      |   6 +-
 .../event/impl/jobs/stats/StatisticsManager.java   |  67 ++--
 .../event/impl/jobs/tasks/CheckTopologyTask.java   | 178 ++++++-----
 .../sling/event/impl/jobs/tasks/CleanUpTask.java   | 167 +++++-----
 .../impl/jobs/tasks/FindUnfinishedJobsTask.java    |  26 +-
 .../event/impl/jobs/tasks/HistoryCleanUpTask.java  | 113 ++++---
 .../sling/event/impl/jobs/tasks/UpgradeTask.java   |  72 +++--
 .../event/impl/support/BatchResourceRemover.java   |   7 +-
 .../event/impl/support/ExactTopicMatcher.java      |   2 +-
 .../event/impl/support/PackageTopicMatcher.java    |   3 +-
 .../sling/event/impl/support/ResourceHelper.java   | 110 +++----
 .../sling/event/impl/support/ScheduleInfoImpl.java | 290 +++++++++---------
 .../impl/support/SubPackagesTopicMatcher.java      |   9 +-
 .../event/impl/support/TopicMatcherHelper.java     |  57 ++--
 .../org/apache/sling/event/impl/JsonTestBase.java  |  10 +-
 .../java/org/apache/sling/event/impl/TestUtil.java |  12 +-
 .../InitDelayingTopologyEventListenerTest.java     |  16 +-
 .../jobs/InstanceDescriptionComparatorTest.java    |  17 +-
 .../event/impl/jobs/JobConsumerManagerTest.java    |  31 +-
 .../sling/event/impl/jobs/JobHandlerTest.java      | 130 ++++----
 .../sling/event/impl/jobs/JobManagerImplTest.java  |  77 +++--
 .../apache/sling/event/impl/jobs/JobsImplTest.java |  12 +-
 .../sling/event/impl/jobs/StatisticsImplTest.java  |  22 +-
 .../apache/sling/event/impl/jobs/UtilityTest.java  |  19 +-
 .../config/InternalQueueConfigurationTest.java     |  77 +++--
 .../jobs/config/JobManagerConfigurationTest.java   |  33 +-
 .../config/JobManagerConfigurationTestFactory.java |  62 ++--
 .../jobs/config/QueueConfigurationManagerTest.java |  25 +-
 .../impl/jobs/config/TopologyCapabilitiesTest.java |  10 +-
 .../impl/jobs/console/InventoryPluginTest.java     | 211 ++++++-------
 .../impl/jobs/jmx/AllJobStatisticsMBeanTest.java   |  19 +-
 .../sling/event/impl/jobs/jmx/DummyStatistics.java |  43 ++-
 .../event/impl/jobs/jmx/QueuesMBeanImplTest.java   |  76 +++--
 .../jobs/queues/JobExecutionContextImplTest.java   |  50 +--
 .../event/impl/jobs/queues/JobQueueImplTest.java   | 111 ++++---
 .../event/impl/jobs/queues/TestTopicHalting.java   | 146 +++++----
 .../event/impl/jobs/stats/StatisticsImplTest.java  |  22 +-
 .../impl/jobs/stats/StatisticsManagerTest.java     |  30 +-
 .../impl/jobs/stats/TopicStatisticsImplTest.java   |  18 +-
 .../sling/event/impl/jobs/tasks/CleanUpTest.java   | 110 ++++---
 .../jobs/tasks/HistoryCleanUpRemovedJobsTest.java  |  17 +-
 .../impl/jobs/tasks/HistoryCleanUpTaskTest.java    |  12 +-
 .../sling/event/it/AbstractJobHandlingIT.java      |  60 ++--
 .../sling/event/it/AbstractMaxParallelIT.java      | 136 ++++----
 .../java/org/apache/sling/event/it/ChaosIT.java    | 209 +++++++------
 .../org/apache/sling/event/it/ClassloadingIT.java  | 156 +++++-----
 .../java/org/apache/sling/event/it/HistoryIT.java  | 133 +++++---
 .../sling/event/it/JobHandlingConditionIT.java     |  20 +-
 .../org/apache/sling/event/it/JobHandlingIT.java   | 341 ++++++++++-----------
 .../apache/sling/event/it/JobManagerSearchIT.java  |  20 +-
 .../org/apache/sling/event/it/JobsTestSupport.java |  73 +++--
 .../sling/event/it/OrderedMaxParallelIT.java       |  25 +-
 .../org/apache/sling/event/it/OrderedQueueIT.java  | 106 ++++---
 .../sling/event/it/RoundRobinMaxParallelIT.java    |  23 +-
 .../apache/sling/event/it/RoundRobinQueueIT.java   |  98 +++---
 .../org/apache/sling/event/it/SchedulingIT.java    |  48 +--
 .../org/apache/sling/event/it/TimedJobsIT.java     |  13 +-
 .../org/apache/sling/event/it/TopicMatchingIT.java | 107 +++----
 .../apache/sling/event/it/UnorderedQueueIT.java    |  98 +++---
 99 files changed, 4140 insertions(+), 3728 deletions(-)

diff --git a/pom.xml b/pom.xml
index 07c5717..774ca37 100644
--- a/pom.xml
+++ b/pom.xml
@@ -37,8 +37,8 @@
     <scm>
         <connection>scm:git:https://gitbox.apache.org/repos/asf/sling-org-apache-sling-event.git</connection>
         <developerConnection>scm:git:https://gitbox.apache.org/repos/asf/sling-org-apache-sling-event.git</developerConnection>
-        <url>https://github.com/apache/sling-org-apache-sling-event.git</url>
         <tag>org.apache.sling.event-4.3.12</tag>
+        <url>https://github.com/apache/sling-org-apache-sling-event.git</url>
     </scm>
 
     <properties>
@@ -49,96 +49,6 @@
         <project.build.outputTimestamp>2025-06-04T08:33:29Z</project.build.outputTimestamp>
         <sling.java.version>8</sling.java.version>
     </properties>
-
-
-    <build>
-        <plugins>
-            <!-- plain unit tests -->
-            <plugin>
-                <artifactId>maven-surefire-plugin</artifactId>
-            </plugin>
-            <plugin>
-                <groupId>org.codehaus.mojo</groupId>
-                <artifactId>build-helper-maven-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>reserve-network-port</id>
-                        <goals>
-                            <goal>reserve-network-port</goal>
-                        </goals>
-                        <phase>pre-integration-test</phase>
-                        <configuration>
-                            <portNames>
-                                <portName>http.port</portName>
-                            </portNames>
-                            <minPortNumber>${min.port}</minPortNumber>
-                            <maxPortNumber>${max.port}</maxPortNumber>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-            <!-- integration tests run with pax-exam -->
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-failsafe-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>integration-test</goal>
-                            <goal>verify</goal>
-                        </goals>
-                    </execution>
-                </executions>
-                <configuration>
-                    <redirectTestOutputToFile>true</redirectTestOutputToFile>
-                    <systemPropertyVariables combine.children="append">
-                        <bundle.filename>${basedir}/target/${project.build.finalName}.jar</bundle.filename>
-                    </systemPropertyVariables>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.servicemix.tooling</groupId>
-                <artifactId>depends-maven-plugin</artifactId>
-            </plugin>
-            <plugin><!-- workaround for https://issues.apache.org/jira/browse/SM-5021 -->
-                <groupId>com.google.code.maven-replacer-plugin</groupId>
-                <artifactId>replacer</artifactId>
-                <version>1.5.3</version>
-                <executions>
-                    <execution>
-                        <id>fix-depends-RB</id>
-                        <phase>process-resources</phase>
-                        <goals>
-                            <goal>replace</goal>
-                        </goals>
-                    </execution>
-                </executions>
-                <configuration>
-                    <file>${project.build.directory}/classes/META-INF/maven/dependencies.properties</file>
-                    <replacements>
-                        <replacement>
-                            <token># Generated at: .+</token>
-                            <value>#</value>
-                        </replacement>
-                    </replacements>
-                    <regex>true</regex>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-    <profiles>
-        <profile>
-            <id>port-java8</id>
-            <activation>
-                <activeByDefault>false</activeByDefault>
-                <jdk>1.8</jdk>
-            </activation>
-            <properties>
-                <min.port>38000</min.port>
-                <max.port>38999</max.port>
-            </properties>
-        </profile>
-    </profiles>
     <dependencies>
         <dependency>
             <groupId>org.osgi</groupId>
@@ -225,9 +135,9 @@
             <scope>provided</scope>
         </dependency>
         <dependency>
+            <groupId>io.dropwizard.metrics</groupId>
             <artifactId>metrics-core</artifactId>
             <version>3.2.4</version>
-            <groupId>io.dropwizard.metrics</groupId>
             <scope>provided</scope>
         </dependency>
         <dependency>
@@ -269,8 +179,8 @@
         </dependency>
         <!-- transitive dependency of sling-mock, otherwise ancient version from commons.testing takes precedence-->
         <dependency>
-            <artifactId>org.apache.sling.jcr.api</artifactId>
             <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.jcr.api</artifactId>
             <version>2.4.0</version>
             <scope>test</scope>
         </dependency>
@@ -408,4 +318,94 @@
             <scope>test</scope>
         </dependency>
     </dependencies>
+
+    <build>
+        <plugins>
+            <!-- plain unit tests -->
+            <plugin>
+                <artifactId>maven-surefire-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>build-helper-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>reserve-network-port</id>
+                        <goals>
+                            <goal>reserve-network-port</goal>
+                        </goals>
+                        <phase>pre-integration-test</phase>
+                        <configuration>
+                            <portNames>
+                                <portName>http.port</portName>
+                            </portNames>
+                            <minPortNumber>${min.port}</minPortNumber>
+                            <maxPortNumber>${max.port}</maxPortNumber>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <!-- integration tests run with pax-exam -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-failsafe-plugin</artifactId>
+                <configuration>
+                    <redirectTestOutputToFile>true</redirectTestOutputToFile>
+                    <systemPropertyVariables combine.children="append">
+                        <bundle.filename>${basedir}/target/${project.build.finalName}.jar</bundle.filename>
+                    </systemPropertyVariables>
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>integration-test</goal>
+                            <goal>verify</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.servicemix.tooling</groupId>
+                <artifactId>depends-maven-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <!-- workaround for https://issues.apache.org/jira/browse/SM-5021 -->
+                <groupId>com.google.code.maven-replacer-plugin</groupId>
+                <artifactId>replacer</artifactId>
+                <version>1.5.3</version>
+                <configuration>
+                    <file>${project.build.directory}/classes/META-INF/maven/dependencies.properties</file>
+                    <replacements>
+                        <replacement>
+                            <token># Generated at: .+</token>
+                            <value>#</value>
+                        </replacement>
+                    </replacements>
+                    <regex>true</regex>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>fix-depends-RB</id>
+                        <goals>
+                            <goal>replace</goal>
+                        </goals>
+                        <phase>process-resources</phase>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+    <profiles>
+        <profile>
+            <id>port-java8</id>
+            <activation>
+                <activeByDefault>false</activeByDefault>
+                <jdk>1.8</jdk>
+            </activation>
+            <properties>
+                <min.port>38000</min.port>
+                <max.port>38999</max.port>
+            </properties>
+        </profile>
+    </profiles>
 </project>
diff --git a/src/main/java/org/apache/sling/event/impl/EnvironmentComponent.java b/src/main/java/org/apache/sling/event/impl/EnvironmentComponent.java
index 56b5bd3..eebf7ad 100644
--- a/src/main/java/org/apache/sling/event/impl/EnvironmentComponent.java
+++ b/src/main/java/org/apache/sling/event/impl/EnvironmentComponent.java
@@ -36,21 +36,20 @@ import org.osgi.service.component.annotations.ReferencePolicyOption;
  * This component needs to be immediate to set the global variables
  * (application id and thread pool).
  */
-@Component(immediate=true,
-    property = {
-            Constants.SERVICE_VENDOR + "=The Apache Software Foundation"
-    },
-    service={EnvironmentComponent.class})
+@Component(
+        immediate = true,
+        property = {Constants.SERVICE_VENDOR + "=The Apache Software Foundation"},
+        service = {EnvironmentComponent.class})
 public class EnvironmentComponent {
 
     /**
      * Our thread pool.
      */
-    @Reference(service=EventingThreadPool.class, policyOption=ReferencePolicyOption.GREEDY)
+    @Reference(service = EventingThreadPool.class, policyOption = ReferencePolicyOption.GREEDY)
     private ThreadPool threadPool;
 
     /** Sling settings service. */
-    @Reference(policyOption=ReferencePolicyOption.GREEDY)
+    @Reference(policyOption = ReferencePolicyOption.GREEDY)
     private SlingSettingsService settingsService;
 
     /**
@@ -69,7 +68,7 @@ public class EnvironmentComponent {
     @Deactivate
     protected void deactivate() {
         // Unset the thread pool
-        if ( Environment.THREAD_POOL == this.threadPool ) {
+        if (Environment.THREAD_POOL == this.threadPool) {
             Environment.THREAD_POOL = null;
         }
     }
@@ -79,7 +78,7 @@ public class EnvironmentComponent {
     }
 
     protected void unbindThreadPool(final EventingThreadPool etp) {
-        if ( this.threadPool == etp ) {
+        if (this.threadPool == etp) {
             this.threadPool = null;
         }
     }
diff --git a/src/main/java/org/apache/sling/event/impl/EventingThreadPool.java b/src/main/java/org/apache/sling/event/impl/EventingThreadPool.java
index 0cf1531..12855d3 100644
--- a/src/main/java/org/apache/sling/event/impl/EventingThreadPool.java
+++ b/src/main/java/org/apache/sling/event/impl/EventingThreadPool.java
@@ -34,31 +34,31 @@ import org.osgi.service.metatype.annotations.AttributeDefinition;
 import org.osgi.service.metatype.annotations.Designate;
 import org.osgi.service.metatype.annotations.ObjectClassDefinition;
 
-
 /**
  * The configurable eventing thread pool.
  */
-@Component(service = EventingThreadPool.class,
-           property = {
-              Constants.SERVICE_VENDOR + "=The Apache Software Foundation"
-})
+@Component(
+        service = EventingThreadPool.class,
+        property = {Constants.SERVICE_VENDOR + "=The Apache Software Foundation"})
 @Designate(ocd = EventingThreadPool.Config.class)
 public class EventingThreadPool implements ThreadPool {
 
-    @ObjectClassDefinition(name = "Apache Sling Job Thread Pool",
-        description="This is the thread pool used by the Apache Sling job handling. The "
-                  + "threads from this pool are merely used for executing jobs. By limiting this pool, it is "
-                  + "possible to limit the maximum number of parallel processed jobs - regardless of the queue "
-                  + "configuration.")
+    @ObjectClassDefinition(
+            name = "Apache Sling Job Thread Pool",
+            description = "This is the thread pool used by the Apache Sling job handling. The "
+                    + "threads from this pool are merely used for executing jobs. By limiting this pool, it is "
+                    + "possible to limit the maximum number of parallel processed jobs - regardless of the queue "
+                    + "configuration.")
     public @interface Config {
 
-        @AttributeDefinition(name = "Pool Size",
-              description="The size of the thread pool. This pool is used to execute jobs and therefore "
+        @AttributeDefinition(
+                name = "Pool Size",
+                description = "The size of the thread pool. This pool is used to execute jobs and therefore "
                         + "limits the maximum number of jobs executed in parallel.")
         int minPoolSize() default 35;
     }
 
-    @Reference(policyOption=ReferencePolicyOption.GREEDY)
+    @Reference(policyOption = ReferencePolicyOption.GREEDY)
     private ThreadPoolManager threadPoolManager;
 
     /** The real thread pool used. */
diff --git a/src/main/java/org/apache/sling/event/impl/discovery/InitDelayingTopologyEventListener.java b/src/main/java/org/apache/sling/event/impl/discovery/InitDelayingTopologyEventListener.java
index 53afa8b..cc6f433 100644
--- a/src/main/java/org/apache/sling/event/impl/discovery/InitDelayingTopologyEventListener.java
+++ b/src/main/java/org/apache/sling/event/impl/discovery/InitDelayingTopologyEventListener.java
@@ -83,10 +83,10 @@ public class InitDelayingTopologyEventListener implements TopologyEventListener
      */
     public InitDelayingTopologyEventListener(final long startupDelay, final TopologyEventListener delegate) {
 
-        if ( delegate == null ) {
+        if (delegate == null) {
             throw new IllegalArgumentException("delegate must not be null");
         }
-        if ( startupDelay <= 0) {
+        if (startupDelay <= 0) {
             throw new IllegalArgumentException("startupDelay must be greater than 0, not " + startupDelay);
         }
         this.delegate = delegate;
@@ -128,17 +128,19 @@ public class InitDelayingTopologyEventListener implements TopologyEventListener
 
     @Override
     public void handleTopologyEvent(TopologyEvent event) {
-        synchronized ( syncObj ) {
-            if ( this.delaying ) {
+        synchronized (syncObj) {
+            if (this.delaying) {
                 // when we're delaying, keep hold of the last event
                 // as action afterStartupDelay depends on this last
                 // event
-                this.logger.debug("handleTopologyEvent: delaying processing of received topology event (startup delay active) {}", event);
+                this.logger.debug(
+                        "handleTopologyEvent: delaying processing of received topology event (startup delay active) {}",
+                        event);
                 this.pendingDelayedEvent = event;
 
                 // and we're delaying - so stop processing now and return
                 return;
-            } else if ( this.pendingDelayedEvent != null ) {
+            } else if (this.pendingDelayedEvent != null) {
                 // this means that while we're no longer delaying we still
                 // have a pending delayed event to process.
                 // more concretely, it means that this event is a CHANGING
@@ -148,16 +150,19 @@ public class InitDelayingTopologyEventListener implements TopologyEventListener
                 // to ensure our code gets an INIT first thing
 
                 // paranoia check:
-                if ( event.getType() == Type.TOPOLOGY_CHANGING ) {
+                if (event.getType() == Type.TOPOLOGY_CHANGING) {
                     // this should never happen - but if it does, rinse and repeat
                     this.pendingDelayedEvent = event;
-                    this.logger.info("handleTopologyEvent: ignoring received topology event of type CHANGING {}", event);
+                    this.logger.info(
+                            "handleTopologyEvent: ignoring received topology event of type CHANGING {}", event);
                     return;
                 } else {
                     // otherwise we now **convert** the event to an init event
                     this.pendingDelayedEvent = null;
-                    this.logger.debug("handleTopologyEvent: first stable topology event received after startup delaying. "
-                            + "Simulating an INIT event with this new view: {}", event);
+                    this.logger.debug(
+                            "handleTopologyEvent: first stable topology event received after startup delaying. "
+                                    + "Simulating an INIT event with this new view: {}",
+                            event);
                     event = new TopologyEvent(Type.TOPOLOGY_INIT, null, event.getNewView());
                 }
             } else {
@@ -190,16 +195,16 @@ public class InitDelayingTopologyEventListener implements TopologyEventListener
      * Hence only called once!
      */
     private void afterStartupDelay() {
-        synchronized ( this.syncObj ) {
+        synchronized (this.syncObj) {
             // stop any future delaying
             this.delaying = false;
 
-            if ( this.pendingDelayedEvent == null ) {
+            if (this.pendingDelayedEvent == null) {
                 // if no event received while we delayed,
                 // then we don't have to do anything later
                 this.logger.debug("afterStartupDelay: startup delay passed without any events delayed. "
                         + "So, ready for first upcoming INIT event");
-            } else if ( this.pendingDelayedEvent.getType() == Type.TOPOLOGY_CHANGING ) {
+            } else if (this.pendingDelayedEvent.getType() == Type.TOPOLOGY_CHANGING) {
                 // if the last delayed event was CHANGING
                 // then we must convert the next upcoming CHANGED, PROPERTIES
                 // into an INIT
@@ -218,8 +223,11 @@ public class InitDelayingTopologyEventListener implements TopologyEventListener
                 final TopologyEvent artificialInitEvent =
                         new TopologyEvent(Type.TOPOLOGY_INIT, null, this.pendingDelayedEvent.getNewView());
 
-                this.logger.debug("afterStartupDelay: startup delay passed, last pending delayed event was stable ({}). "
-                        + "Simulating an INIT event with that view: {}", this.pendingDelayedEvent, artificialInitEvent);
+                this.logger.debug(
+                        "afterStartupDelay: startup delay passed, last pending delayed event was stable ({}). "
+                                + "Simulating an INIT event with that view: {}",
+                        this.pendingDelayedEvent,
+                        artificialInitEvent);
                 this.pendingDelayedEvent = null;
 
                 // call the delegate.
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/InternalJobState.java b/src/main/java/org/apache/sling/event/impl/jobs/InternalJobState.java
index 6fe1994..861a5d7 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/InternalJobState.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/InternalJobState.java
@@ -25,10 +25,9 @@ import org.apache.sling.event.jobs.consumer.JobExecutor;
  * The state of the job after it has been processed by a {@link JobExecutor}.
  */
 public enum InternalJobState {
-
-    SUCCEEDED(NotificationConstants.TOPIC_JOB_FINISHED),    // processing finished successfully
-    FAILED(NotificationConstants.TOPIC_JOB_FAILED),         // processing failed, can be retried
-    CANCELLED(NotificationConstants.TOPIC_JOB_CANCELLED);   // processing failed permanently
+    SUCCEEDED(NotificationConstants.TOPIC_JOB_FINISHED), // processing finished successfully
+    FAILED(NotificationConstants.TOPIC_JOB_FAILED), // processing failed, can be retried
+    CANCELLED(NotificationConstants.TOPIC_JOB_CANCELLED); // processing failed permanently
 
     private final String topic;
 
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/JobBuilderImpl.java b/src/main/java/org/apache/sling/event/impl/jobs/JobBuilderImpl.java
index aee4e46..f4806b5 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/JobBuilderImpl.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/JobBuilderImpl.java
@@ -41,7 +41,6 @@ public class JobBuilderImpl implements JobBuilder {
         this.topic = topic;
     }
 
-
     @Override
     public JobBuilder properties(final Map<String, Object> props) {
         this.properties = props;
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/JobConsumerManager.java b/src/main/java/org/apache/sling/event/impl/jobs/JobConsumerManager.java
index 1682104..32b5079 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/JobConsumerManager.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/JobConsumerManager.java
@@ -58,33 +58,36 @@ import org.slf4j.LoggerFactory;
 /**
  * This component manages/keeps track of all job consumer services.
  */
-@Component(service = JobConsumerManager.class,
-    property = {
-          Constants.SERVICE_VENDOR + "=The Apache Software Foundation"
-    })
+@Component(
+        service = JobConsumerManager.class,
+        property = {Constants.SERVICE_VENDOR + "=The Apache Software Foundation"})
 @Designate(ocd = JobConsumerManager.Config.class)
 public class JobConsumerManager {
 
-    @ObjectClassDefinition(name = "Apache Sling Job Consumer Manager",
-           description="The consumer manager controls the job consumer (= processors). "
-                     + "It can be used to temporarily disable job processing on the current instance. Other instances "
-                     + "in a cluster are not affected.")
+    @ObjectClassDefinition(
+            name = "Apache Sling Job Consumer Manager",
+            description = "The consumer manager controls the job consumer (= processors). "
+                    + "It can be used to temporarily disable job processing on the current instance. Other instances "
+                    + "in a cluster are not affected.")
     public @interface Config {
 
-        @AttributeDefinition(name = "Distribute config",
-          description="If this is disabled, the configuration is not persisted on save in the cluster and is "
-                    + "only used on the current instance. This option should always be disabled!")
+        @AttributeDefinition(
+                name = "Distribute config",
+                description = "If this is disabled, the configuration is not persisted on save in the cluster and is "
+                        + "only used on the current instance. This option should always be disabled!")
         boolean org_apache_sling_installer_configuration_persist() default false;
 
-        @AttributeDefinition(name = "Topic Allow List",
-              description="This is a list of topics which currently should be "
+        @AttributeDefinition(
+                name = "Topic Allow List",
+                description = "This is a list of topics which currently should be "
                         + "processed by this instance. Leaving it empty, all job consumers are disabled. Putting a '*' as "
                         + "one entry, enables all job consumers. Adding separate topics enables job consumers for exactly "
                         + "this topic.")
         String[] job_consumermanager_allowlist();
 
-        @AttributeDefinition(name = "Topic Deny List",
-              description="This is a list of topics which currently shouldn't be "
+        @AttributeDefinition(
+                name = "Topic Deny List",
+                description = "This is a list of topics which currently shouldn't be "
                         + "processed by this instance. Leaving it empty, all job consumers are enabled. Putting a '*' as "
                         + "one entry, disables all job consumers. Adding separate topics disables job consumers for exactly "
                         + "this topic.")
@@ -93,6 +96,7 @@ public class JobConsumerManager {
 
     public @interface DeprecatedConfig {
         String[] job_consumermanager_whitelist();
+
         String[] job_consumermanager_blacklist();
     }
 
@@ -121,7 +125,7 @@ public class JobConsumerManager {
         serviceProps.put(PropertyProvider.PROPERTY_PROPERTIES, TopologyCapabilities.PROPERTY_TOPICS);
         // we add a changing property to the service registration
         // to make sure a modification event is really sent
-        synchronized ( this ) {
+        synchronized (this) {
             serviceProps.put("changeCount", this.changeCount++);
         }
         return serviceProps;
@@ -138,32 +142,36 @@ public class JobConsumerManager {
     }
 
     private String[] getAllowListConfig(final Config config, final DeprecatedConfig deprecatedConfig) {
-        if (isDefined(config.job_consumermanager_allowlist()) && isDefined(deprecatedConfig.job_consumermanager_whitelist()) ) {
+        if (isDefined(config.job_consumermanager_allowlist())
+                && isDefined(deprecatedConfig.job_consumermanager_whitelist())) {
             logger.error("Both properties, job.consumermanager.allowlist and job.consumermanager.whitelist"
-                + ", were defined. Using job.consumermanager.allowlist for configuring job consumers."
-                + "Please remove the other property from your configuration.");
+                    + ", were defined. Using job.consumermanager.allowlist for configuring job consumers."
+                    + "Please remove the other property from your configuration.");
             return config.job_consumermanager_allowlist();
         } else if (isDefined(config.job_consumermanager_allowlist())) {
             return config.job_consumermanager_allowlist();
         } else if (isDefined(deprecatedConfig.job_consumermanager_whitelist())) {
-            logger.warn("The property job.consumermanager.allowlist is not set. Using the provided property " +
-                "job.consumermanager.whitelist instead. Please update your configuration to use job.consumermanager.allowlist.");
+            logger.warn(
+                    "The property job.consumermanager.allowlist is not set. Using the provided property "
+                            + "job.consumermanager.whitelist instead. Please update your configuration to use job.consumermanager.allowlist.");
             return deprecatedConfig.job_consumermanager_whitelist();
         }
         return new String[] {"*"}; // default
     }
 
     private String[] getDenyListConfig(final Config config, final DeprecatedConfig deprecatedConfig) {
-        if (isDefined(config.job_consumermanager_denylist()) && isDefined(deprecatedConfig.job_consumermanager_blacklist()) ) {
+        if (isDefined(config.job_consumermanager_denylist())
+                && isDefined(deprecatedConfig.job_consumermanager_blacklist())) {
             logger.error("Both properties, job.consumermanager.denylist and job.consumermanager.blacklist"
-                + ", were defined. Using job.consumermanager.denylist for configuring job consumers."
-                + "Please remove the other property from your configuration.");
+                    + ", were defined. Using job.consumermanager.denylist for configuring job consumers."
+                    + "Please remove the other property from your configuration.");
             return config.job_consumermanager_denylist();
         } else if (isDefined(config.job_consumermanager_denylist())) {
             return config.job_consumermanager_denylist();
         } else if (isDefined(deprecatedConfig.job_consumermanager_blacklist())) {
-            logger.warn("The property job.consumermanager.denylist is not set. Using the provided property " +
-                "job.consumermanager.blacklist instead. Please update your configuration to use job.consumermanager.denylist.");
+            logger.warn(
+                    "The property job.consumermanager.denylist is not set. Using the provided property "
+                            + "job.consumermanager.blacklist instead. Please update your configuration to use job.consumermanager.denylist.");
             return deprecatedConfig.job_consumermanager_blacklist();
         }
         return null; // default
@@ -176,31 +184,33 @@ public class JobConsumerManager {
         this.denyListMatchers = TopicMatcherHelper.buildMatchers(getDenyListConfig(config, deprecatedConfig));
 
         final boolean enable = this.allowListMatchers != null && this.denyListMatchers != TopicMatcherHelper.MATCH_ALL;
-        if ( wasEnabled != enable ) {
-            synchronized ( this.topicToConsumerMap ) {
+        if (wasEnabled != enable) {
+            synchronized (this.topicToConsumerMap) {
                 this.calculateTopics(enable);
             }
-            if ( enable ) {
+            if (enable) {
                 logger.debug("Registering property provider with: {}", this.topics);
-                this.propagationService = bc.registerService(PropertyProvider.class,
+                this.propagationService = bc.registerService(
+                        PropertyProvider.class,
                         new PropertyProvider() {
 
                             @Override
                             public String getProperty(final String name) {
-                                if ( TopologyCapabilities.PROPERTY_TOPICS.equals(name) ) {
+                                if (TopologyCapabilities.PROPERTY_TOPICS.equals(name)) {
                                     return topics;
                                 }
                                 return null;
                             }
-                        }, this.getRegistrationProperties());
+                        },
+                        this.getRegistrationProperties());
             } else {
                 logger.debug("Unregistering property provider with");
                 this.propagationService.unregister();
                 this.propagationService = null;
             }
-        } else if ( enable ) {
+        } else if (enable) {
             // update properties
-            synchronized ( this.topicToConsumerMap ) {
+            synchronized (this.topicToConsumerMap) {
                 this.calculateTopics(true);
             }
             logger.debug("Updating property provider with: {}", this.topics);
@@ -210,12 +220,12 @@ public class JobConsumerManager {
 
     @Deactivate
     protected void deactivate() {
-        if ( this.propagationService != null ) {
+        if (this.propagationService != null) {
             this.propagationService.unregister();
             this.propagationService = null;
         }
         this.bundleContext = null;
-        synchronized ( this.topicToConsumerMap ) {
+        synchronized (this.topicToConsumerMap) {
             this.topicToConsumerMap.clear();
             this.listenerMap.clear();
         }
@@ -227,16 +237,16 @@ public class JobConsumerManager {
      * @return A consumer or <code>null</code>
      */
     public JobExecutor getExecutor(final String topic) {
-        synchronized ( this.topicToConsumerMap ) {
+        synchronized (this.topicToConsumerMap) {
             final List<ConsumerInfo> consumers = this.topicToConsumerMap.get(topic);
-            if ( consumers != null ) {
+            if (consumers != null) {
                 return consumers.get(0).getExecutor(this.bundleContext);
             }
             int pos = topic.lastIndexOf('/');
-            if ( pos > 0 ) {
+            if (pos > 0) {
                 final String category = topic.substring(0, pos + 1).concat("*");
                 final List<ConsumerInfo> categoryConsumers = this.topicToConsumerMap.get(category);
-                if ( categoryConsumers != null ) {
+                if (categoryConsumers != null) {
                     return categoryConsumers.get(0).getExecutor(this.bundleContext);
                 }
 
@@ -244,24 +254,24 @@ public class JobConsumerManager {
                 do {
                     final String subCategory = topic.substring(0, pos + 1).concat("**");
                     final List<ConsumerInfo> subCategoryConsumers = this.topicToConsumerMap.get(subCategory);
-                    if ( subCategoryConsumers != null ) {
+                    if (subCategoryConsumers != null) {
                         return subCategoryConsumers.get(0).getExecutor(this.bundleContext);
                     }
                     pos = topic.lastIndexOf('/', pos - 1);
-                } while ( pos > 0 );
+                } while (pos > 0);
             }
         }
         return null;
     }
 
     public void registerListener(final String key, final JobExecutor consumer, final JobExecutionContext handler) {
-        synchronized ( this.topicToConsumerMap ) {
+        synchronized (this.topicToConsumerMap) {
             this.listenerMap.put(key, new Object[] {consumer, handler});
         }
     }
 
     public void unregisterListener(final String key) {
-        synchronized ( this.topicToConsumerMap ) {
+        synchronized (this.topicToConsumerMap) {
             this.listenerMap.remove(key);
         }
     }
@@ -277,9 +287,10 @@ public class JobConsumerManager {
      * Bind a new consumer
      * @param serviceReference The service reference to the consumer.
      */
-    @Reference(service=JobConsumer.class,
-            cardinality=ReferenceCardinality.MULTIPLE,
-            policy=ReferencePolicy.DYNAMIC)
+    @Reference(
+            service = JobConsumer.class,
+            cardinality = ReferenceCardinality.MULTIPLE,
+            policy = ReferencePolicy.DYNAMIC)
     protected void bindJobConsumer(final ServiceReference<JobConsumer> serviceReference) {
         this.bindService(serviceReference, true);
     }
@@ -296,9 +307,10 @@ public class JobConsumerManager {
      * Bind a new executor
      * @param serviceReference The service reference to the executor.
      */
-    @Reference(service=JobExecutor.class,
-            cardinality=ReferenceCardinality.MULTIPLE,
-            policy=ReferencePolicy.DYNAMIC)
+    @Reference(
+            service = JobExecutor.class,
+            cardinality = ReferenceCardinality.MULTIPLE,
+            policy = ReferencePolicy.DYNAMIC)
     protected void bindJobExecutor(final ServiceReference<JobExecutor> serviceReference) {
         this.bindService(serviceReference, false);
     }
@@ -318,16 +330,16 @@ public class JobConsumerManager {
      */
     private void bindService(final ServiceReference<?> serviceReference, final boolean isConsumer) {
         final String[] topics = PropertiesUtil.toStringArray(serviceReference.getProperty(JobConsumer.PROPERTY_TOPICS));
-        if ( topics != null && topics.length > 0 ) {
+        if (topics != null && topics.length > 0) {
             final ConsumerInfo info = new ConsumerInfo(serviceReference, isConsumer);
             boolean changed = false;
-            synchronized ( this.topicToConsumerMap ) {
-                for(final String t : topics) {
-                    if ( t != null ) {
+            synchronized (this.topicToConsumerMap) {
+                for (final String t : topics) {
+                    if (t != null) {
                         final String topic = t.trim();
-                        if ( topic.length() > 0 ) {
+                        if (topic.length() > 0) {
                             List<ConsumerInfo> consumers = this.topicToConsumerMap.get(topic);
-                            if ( consumers == null ) {
+                            if (consumers == null) {
                                 consumers = new ArrayList<>();
                                 this.topicToConsumerMap.put(topic, consumers);
                                 changed = true;
@@ -337,11 +349,11 @@ public class JobConsumerManager {
                         }
                     }
                 }
-                if ( changed ) {
+                if (changed) {
                     this.calculateTopics(this.propagationService != null);
                 }
             }
-            if ( changed && this.propagationService != null ) {
+            if (changed && this.propagationService != null) {
                 logger.debug("Updating property provider with: {}", this.topics);
                 this.propagationService.setProperties(this.getRegistrationProperties());
             }
@@ -355,30 +367,32 @@ public class JobConsumerManager {
      */
     private void unbindService(final ServiceReference<?> serviceReference, final boolean isConsumer) {
         final String[] topics = PropertiesUtil.toStringArray(serviceReference.getProperty(JobConsumer.PROPERTY_TOPICS));
-        if ( topics != null && topics.length > 0 ) {
+        if (topics != null && topics.length > 0) {
             final ConsumerInfo info = new ConsumerInfo(serviceReference, isConsumer);
             boolean changed = false;
-            synchronized ( this.topicToConsumerMap ) {
-                for(final String t : topics) {
-                    if ( t != null ) {
+            synchronized (this.topicToConsumerMap) {
+                for (final String t : topics) {
+                    if (t != null) {
                         final String topic = t.trim();
-                        if ( topic.length() > 0 ) {
+                        if (topic.length() > 0) {
                             final List<ConsumerInfo> consumers = this.topicToConsumerMap.get(topic);
-                            if ( consumers != null ) { // sanity check
-                                for(final ConsumerInfo oldConsumer : consumers) {
-                                    if ( oldConsumer.equals(info) && oldConsumer.executor != null ) {
+                            if (consumers != null) { // sanity check
+                                for (final ConsumerInfo oldConsumer : consumers) {
+                                    if (oldConsumer.equals(info) && oldConsumer.executor != null) {
                                         // notify listener
-                                        for(final Object[] listenerObjects : this.listenerMap.values()) {
-                                            if ( listenerObjects[0] == oldConsumer.executor ) {
-                                                final JobExecutionContext context = (JobExecutionContext)listenerObjects[1];
-                                                context.asyncProcessingFinished(context.result().failed());
+                                        for (final Object[] listenerObjects : this.listenerMap.values()) {
+                                            if (listenerObjects[0] == oldConsumer.executor) {
+                                                final JobExecutionContext context =
+                                                        (JobExecutionContext) listenerObjects[1];
+                                                context.asyncProcessingFinished(
+                                                        context.result().failed());
                                                 break;
                                             }
                                         }
                                     }
                                 }
                                 consumers.remove(info);
-                                if ( consumers.size() == 0 ) {
+                                if (consumers.size() == 0) {
                                     this.topicToConsumerMap.remove(topic);
                                     changed = true;
                                 }
@@ -386,11 +400,11 @@ public class JobConsumerManager {
                         }
                     }
                 }
-                if ( changed ) {
+                if (changed) {
                     this.calculateTopics(this.propagationService != null);
                 }
             }
-            if ( changed && this.propagationService != null ) {
+            if (changed && this.propagationService != null) {
                 logger.debug("Updating property provider with: {}", this.topics);
                 this.propagationService.setProperties(this.getRegistrationProperties());
             }
@@ -398,8 +412,8 @@ public class JobConsumerManager {
     }
 
     private boolean match(final String topic, final TopicMatcher[] matchers) {
-        for(final TopicMatcher m : matchers) {
-            if ( m.match(topic) != null ) {
+        for (final TopicMatcher m : matchers) {
+            if (m.match(topic) != null) {
                 return true;
             }
         }
@@ -407,15 +421,15 @@ public class JobConsumerManager {
     }
 
     private void calculateTopics(final boolean enabled) {
-        if ( enabled ) {
+        if (enabled) {
             // create a sorted list - this ensures that the property value
             // is always the same for the same topics.
             final List<String> topicList = new ArrayList<>();
-            for(final String topic : this.topicToConsumerMap.keySet() ) {
+            for (final String topic : this.topicToConsumerMap.keySet()) {
                 // check allow list
-                if ( this.match(topic, this.allowListMatchers) ) {
+                if (this.match(topic, this.allowListMatchers)) {
                     // and deny list
-                    if ( this.denyListMatchers == null || !this.match(topic, this.denyListMatchers) ) {
+                    if (this.denyListMatchers == null || !this.match(topic, this.denyListMatchers)) {
                         topicList.add(topic);
                     }
                 }
@@ -424,8 +438,8 @@ public class JobConsumerManager {
 
             final StringBuilder sb = new StringBuilder();
             boolean first = true;
-            for(final String topic : topicList ) {
-                if ( first ) {
+            for (final String topic : topicList) {
+                if (first) {
                     first = false;
                 } else {
                     sb.append(',');
@@ -441,7 +455,7 @@ public class JobConsumerManager {
     /**
      * Internal class caching some consumer infos like service id and ranking.
      */
-    private final static class ConsumerInfo implements Comparable<ConsumerInfo> {
+    private static final class ConsumerInfo implements Comparable<ConsumerInfo> {
 
         public final ServiceReference<?> serviceReference;
         private final boolean isConsumer;
@@ -453,19 +467,19 @@ public class JobConsumerManager {
             this.serviceReference = serviceReference;
             this.isConsumer = isConsumer;
             final Object sr = serviceReference.getProperty(Constants.SERVICE_RANKING);
-            if ( sr == null || !(sr instanceof Integer)) {
+            if (sr == null || !(sr instanceof Integer)) {
                 this.ranking = 0;
             } else {
-                this.ranking = (Integer)sr;
+                this.ranking = (Integer) sr;
             }
-            this.serviceId = (Long)serviceReference.getProperty(Constants.SERVICE_ID);
+            this.serviceId = (Long) serviceReference.getProperty(Constants.SERVICE_ID);
         }
 
         @Override
         public int compareTo(final ConsumerInfo o) {
-            if ( this.ranking < o.ranking ) {
+            if (this.ranking < o.ranking) {
                 return 1;
-            } else if (this.ranking > o.ranking ) {
+            } else if (this.ranking > o.ranking) {
                 return -1;
             }
             // If ranks are equal, then sort by service id in descending order.
@@ -474,8 +488,8 @@ public class JobConsumerManager {
 
         @Override
         public boolean equals(final Object obj) {
-            if ( obj instanceof ConsumerInfo ) {
-                return ((ConsumerInfo)obj).serviceId == this.serviceId;
+            if (obj instanceof ConsumerInfo) {
+                return ((ConsumerInfo) obj).serviceId == this.serviceId;
             }
             return false;
         }
@@ -486,8 +500,8 @@ public class JobConsumerManager {
         }
 
         public JobExecutor getExecutor(final BundleContext bundleContext) {
-            if ( executor == null ) {
-                if ( this.isConsumer ) {
+            if (executor == null) {
+                if (this.isConsumer) {
                     executor = new JobConsumerWrapper((JobConsumer) bundleContext.getService(this.serviceReference));
                 } else {
                     executor = (JobExecutor) bundleContext.getService(this.serviceReference);
@@ -497,7 +511,7 @@ public class JobConsumerManager {
         }
     }
 
-    private final static class JobConsumerWrapper implements JobExecutor {
+    private static final class JobConsumerWrapper implements JobExecutor {
 
         private final JobConsumer consumer;
 
@@ -507,45 +521,44 @@ public class JobConsumerManager {
 
         @Override
         public JobExecutionResult process(final Job job, final JobExecutionContext context) {
-            final JobConsumer.AsyncHandler asyncHandler =
-                    new JobConsumer.AsyncHandler() {
-
-                        final Object asyncLock = new Object();
-                        final AtomicBoolean asyncDone = new AtomicBoolean(false);
-
-                        private void check(final JobExecutionResult result) {
-                            synchronized ( asyncLock ) {
-                                if ( !asyncDone.get() ) {
-                                    asyncDone.set(true);
-                                    context.asyncProcessingFinished(result);
-                                } else {
-                                    throw new IllegalStateException("Job is already marked as processed");
-                                }
-                            }
+            final JobConsumer.AsyncHandler asyncHandler = new JobConsumer.AsyncHandler() {
+
+                final Object asyncLock = new Object();
+                final AtomicBoolean asyncDone = new AtomicBoolean(false);
+
+                private void check(final JobExecutionResult result) {
+                    synchronized (asyncLock) {
+                        if (!asyncDone.get()) {
+                            asyncDone.set(true);
+                            context.asyncProcessingFinished(result);
+                        } else {
+                            throw new IllegalStateException("Job is already marked as processed");
                         }
+                    }
+                }
 
-                        @Override
-                        public void ok() {
-                            this.check(context.result().succeeded());
-                        }
+                @Override
+                public void ok() {
+                    this.check(context.result().succeeded());
+                }
 
-                        @Override
-                        public void failed() {
-                            this.check(context.result().failed());
-                        }
+                @Override
+                public void failed() {
+                    this.check(context.result().failed());
+                }
 
-                        @Override
-                        public void cancel() {
-                            this.check(context.result().cancelled());
-                        }
-                    };
-            ((JobImpl)job).setProperty(JobConsumer.PROPERTY_JOB_ASYNC_HANDLER, asyncHandler);
+                @Override
+                public void cancel() {
+                    this.check(context.result().cancelled());
+                }
+            };
+            ((JobImpl) job).setProperty(JobConsumer.PROPERTY_JOB_ASYNC_HANDLER, asyncHandler);
             final JobConsumer.JobResult result = this.consumer.process(job);
-            if ( result == JobResult.ASYNC ) {
+            if (result == JobResult.ASYNC) {
                 return null;
-            } else if ( result == JobResult.FAILED) {
+            } else if (result == JobResult.FAILED) {
                 return context.result().failed();
-            } else if ( result == JobResult.OK) {
+            } else if (result == JobResult.OK) {
                 return context.result().succeeded();
             }
             return context.result().cancelled();
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/JobHandler.java b/src/main/java/org/apache/sling/event/impl/jobs/JobHandler.java
index 12e2221..67ac95f 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/JobHandler.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/JobHandler.java
@@ -18,7 +18,6 @@
  */
 package org.apache.sling.event.impl.jobs;
 
-
 import java.util.Calendar;
 import java.util.Date;
 import java.util.HashMap;
@@ -37,7 +36,6 @@ import org.apache.sling.event.jobs.Job;
 import org.apache.sling.event.jobs.Queue;
 import org.apache.sling.event.jobs.consumer.JobExecutor;
 
-
 /**
  * This object adds actions to a {@link JobImpl}.
  */
@@ -58,9 +56,7 @@ public class JobHandler {
 
     private final JobExecutor consumer;
 
-    public JobHandler(final JobImpl job,
-            final JobExecutor consumer,
-            final JobManagerConfiguration configuration) {
+    public JobHandler(final JobImpl job, final JobExecutor consumer, final JobManagerConfiguration configuration) {
         this.job = job;
         this.consumer = consumer;
         this.configuration = configuration;
@@ -88,11 +84,11 @@ public class JobHandler {
      * Reschedule the job
      * Update the retry count and remove the started time.
      * @return <code>true</code> if rescheduling was successful, <code>false</code> otherwise.
-     */    
+     */
     public boolean reschedule() {
-        return withJobResource((jobResource,mvm) -> {
+        return withJobResource((jobResource, mvm) -> {
             mvm.put(Job.PROPERTY_JOB_RETRY_COUNT, job.getProperty(Job.PROPERTY_JOB_RETRY_COUNT, Integer.class));
-            if ( job.getProperty(Job.PROPERTY_RESULT_MESSAGE) != null ) {
+            if (job.getProperty(Job.PROPERTY_RESULT_MESSAGE) != null) {
                 mvm.put(Job.PROPERTY_RESULT_MESSAGE, job.getProperty(Job.PROPERTY_RESULT_MESSAGE));
             }
             mvm.remove(Job.PROPERTY_JOB_STARTED_TIME);
@@ -100,8 +96,10 @@ public class JobHandler {
             try {
                 jobResource.getResourceResolver().commit();
                 return true;
-            } catch ( final PersistenceException pe ) {
-                this.configuration.getMainLogger().debug("Unable to update reschedule properties for job " + job.getId(), pe);
+            } catch (final PersistenceException pe) {
+                this.configuration
+                        .getMainLogger()
+                        .debug("Unable to update reschedule properties for job " + job.getId(), pe);
             }
             return false;
         });
@@ -112,10 +110,10 @@ public class JobHandler {
      * @param state The state of the processing
      * @param keepJobInHistory whether to keep the job in the job history.
      * @param duration the duration of the processing.
-     */    
+     */
     public void finished(final Job.JobState state, final boolean keepJobInHistory, final Long duration) {
         final boolean isSuccess = (state == Job.JobState.SUCCEEDED);
-        withJobResource((jobResource,mvm) -> {
+        withJobResource((jobResource, mvm) -> {
             try {
                 ResourceResolver rr = jobResource.getResourceResolver();
                 String newPath = null;
@@ -144,11 +142,13 @@ public class JobHandler {
 
                 if (keepJobInHistory && configuration.getMainLogger().isDebugEnabled()) {
                     if (isSuccess) {
-                        configuration.getMainLogger().debug("Kept successful job {} at {}", Utility.toString(job),
-                                newPath);
+                        configuration
+                                .getMainLogger()
+                                .debug("Kept successful job {} at {}", Utility.toString(job), newPath);
                     } else {
-                        configuration.getMainLogger().debug("Moved cancelled job {} to {}", Utility.toString(job),
-                                newPath);
+                        configuration
+                                .getMainLogger()
+                                .debug("Moved cancelled job {} to {}", Utility.toString(job), newPath);
                     }
                 }
             } catch (final PersistenceException pe) {
@@ -157,22 +157,21 @@ public class JobHandler {
             return false; // this return value is ignored
         });
     }
-    
-    
 
     /**
      * Reassign to a new instance.
      */
     public void reassign() {
-        final QueueInfo queueInfo = this.configuration.getQueueConfigurationManager().getQueueInfo(job.getTopic());
+        final QueueInfo queueInfo =
+                this.configuration.getQueueConfigurationManager().getQueueInfo(job.getTopic());
         // Sanity check if queue configuration has changed
         final TopologyCapabilities caps = this.configuration.getTopologyCapabilities();
-        final String targetId = (caps == null ? null
-                : caps.detectTarget(job.getTopic(), job.getProperties(), queueInfo));
+        final String targetId =
+                (caps == null ? null : caps.detectTarget(job.getTopic(), job.getProperties(), queueInfo));
 
         withJobResource((jobResource, mvm) -> {
-            final String newPath = this.configuration.getUniquePath(targetId, job.getTopic(), job.getId(),
-                    job.getProperties());
+            final String newPath =
+                    this.configuration.getUniquePath(targetId, job.getTopic(), job.getId(), job.getProperties());
 
             final Map<String, Object> props = new HashMap<>(mvm);
             props.remove(Job.PROPERTY_JOB_QUEUE_NAME);
@@ -199,16 +198,16 @@ public class JobHandler {
      * Update the property of a job in the resource tree
      * @param propNames the property names to update
      * @return {@code true} if the update was successful.
-     */    
+     */
     public boolean persistJobProperties(final String... propNames) {
         if (propNames == null) {
             return true;
         }
-        return withJobResource((jobResource,mvm) -> {
-            for(final String propName : propNames) {
+        return withJobResource((jobResource, mvm) -> {
+            for (final String propName : propNames) {
                 final Object val = job.getProperty(propName);
-                if ( val != null ) {
-                    if ( val.getClass().isEnum() ) {
+                if (val != null) {
+                    if (val.getClass().isEnum()) {
                         mvm.put(propName, val.toString());
                     } else {
                         mvm.put(propName, val);
@@ -225,7 +224,6 @@ public class JobHandler {
             }
             return false;
         });
-        
     }
 
     public boolean isStopped() {
@@ -238,7 +236,6 @@ public class JobHandler {
 
     public void addToRetryList() {
         this.configuration.addJobToRetryList(this.job);
-
     }
 
     public boolean removeFromRetryList() {
@@ -252,44 +249,46 @@ public class JobHandler {
 
     @Override
     public boolean equals(Object obj) {
-        if ( ! (obj instanceof JobHandler) ) {
+        if (!(obj instanceof JobHandler)) {
             return false;
         }
-        return this.job.getId().equals(((JobHandler)obj).job.getId());
+        return this.job.getId().equals(((JobHandler) obj).job.getId());
     }
 
     @Override
     public String toString() {
         return "JobHandler(" + this.job.getId() + ")";
     }
-    
+
     /**
      * Helper method to execute a function on the job resource. Performs all necessary checks and validations
      * so that the function does not need to perform any null checks and such.
-     * 
+     *
      * The second parameter is a ModifiableValueMap (non-null) adapted from the JobResource,
      * so both a read-only and a read/write case can be implemented.
      *
      * @param func the function to execute
      * @return the status (which is passed thru from func
      */
-    private boolean withJobResource (BiFunction<Resource,ModifiableValueMap,Boolean> func) {
+    private boolean withJobResource(BiFunction<Resource, ModifiableValueMap, Boolean> func) {
         try (ResourceResolver resolver = this.configuration.createResourceResolver()) {
             Resource jobResource = resolver.getResource(job.getResourcePath());
             if (jobResource == null) {
                 this.configuration.getMainLogger().debug("No job resource found at {}", job.getResourcePath());
-                return false;  
+                return false;
             }
-            // This implicitly assumes that the ResourceResolver provided by the configuration allows 
+            // This implicitly assumes that the ResourceResolver provided by the configuration allows
             // r/w access to the jobResource.
             ModifiableValueMap mvm = jobResource.adaptTo(ModifiableValueMap.class);
-            if (mvm == null){
-                this.configuration.getMainLogger().debug("Cannot adapt resource {} to ModifiableValueMap, no write permissions?", job.getResourcePath());
-                return false;  
+            if (mvm == null) {
+                this.configuration
+                        .getMainLogger()
+                        .debug(
+                                "Cannot adapt resource {} to ModifiableValueMap, no write permissions?",
+                                job.getResourcePath());
+                return false;
             }
-            return func.apply(jobResource,mvm);
+            return func.apply(jobResource, mvm);
         }
-        
     }
-
-}
\ No newline at end of file
+}
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/JobImpl.java b/src/main/java/org/apache/sling/event/impl/jobs/JobImpl.java
index f5956f7..2bc70c6 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/JobImpl.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/JobImpl.java
@@ -84,12 +84,10 @@ public class JobImpl implements Job, Comparable<JobImpl> {
      * @param properties Non-null map of properties, at least containing {@link #PROPERTY_RESOURCE_PATH}
      */
     @SuppressWarnings("unchecked")
-    public JobImpl(final String topic,
-                   final String jobId,
-                   final Map<String, Object> properties) {
+    public JobImpl(final String topic, final String jobId, final Map<String, Object> properties) {
         this.topic = topic;
         this.jobId = jobId;
-        this.path = (String)properties.remove(PROPERTY_RESOURCE_PATH);
+        this.path = (String) properties.remove(PROPERTY_RESOURCE_PATH);
         this.readErrorList = (List<Exception>) properties.remove(ResourceHelper.PROPERTY_MARKER_READ_ERROR_LIST);
 
         this.properties = new ValueMapDecorator(properties);
@@ -113,13 +111,13 @@ public class JobImpl implements Job, Comparable<JobImpl> {
     }
 
     public ReadErrorType getReadErrorType() {
-        if ( this.readErrorList == null || this.readErrorList.isEmpty() ) {
+        if (this.readErrorList == null || this.readErrorList.isEmpty()) {
             return ReadErrorType.NONE;
         } else {
-            for(final Exception e : this.readErrorList) {
-                if ( e instanceof RuntimeException ) {
+            for (final Exception e : this.readErrorList) {
+                if (e instanceof RuntimeException) {
                     return ReadErrorType.RUNTIMEEXCEPTION;
-                } else if ( e.getCause() != null && e.getCause() instanceof ClassNotFoundException ) {
+                } else if (e.getCause() != null && e.getCause() instanceof ClassNotFoundException) {
                     return ReadErrorType.CLASSNOTFOUNDEXCEPTION;
                 }
             }
@@ -242,7 +240,7 @@ public class JobImpl implements Job, Comparable<JobImpl> {
     }
 
     public void setProperty(final String name, final Object value) {
-        if ( value == null ) {
+        if (value == null) {
             this.properties.remove(name);
         } else {
             this.properties.put(name, value);
@@ -261,16 +259,23 @@ public class JobImpl implements Job, Comparable<JobImpl> {
         this.properties.remove(Job.PROPERTY_JOB_PROGRESS_STEP);
         this.properties.remove(Job.PROPERTY_RESULT_MESSAGE);
         this.properties.put(Job.PROPERTY_JOB_STARTED_TIME, Calendar.getInstance());
-        return new String[] {Job.PROPERTY_JOB_QUEUE_NAME, Job.PROPERTY_JOB_RETRIES,
-                Job.PROPERTY_JOB_PROGRESS_LOG, Job.PROPERTY_JOB_PROGRESS_ETA, PROPERTY_JOB_PROGRESS_STEPS,
-                PROPERTY_JOB_PROGRESS_STEP, Job.PROPERTY_RESULT_MESSAGE, Job.PROPERTY_JOB_STARTED_TIME};
+        return new String[] {
+            Job.PROPERTY_JOB_QUEUE_NAME,
+            Job.PROPERTY_JOB_RETRIES,
+            Job.PROPERTY_JOB_PROGRESS_LOG,
+            Job.PROPERTY_JOB_PROGRESS_ETA,
+            PROPERTY_JOB_PROGRESS_STEPS,
+            PROPERTY_JOB_PROGRESS_STEP,
+            Job.PROPERTY_RESULT_MESSAGE,
+            Job.PROPERTY_JOB_STARTED_TIME
+        };
     }
 
     public String[] startProgress(final int steps, final long eta) {
-        if ( steps > 0 ) {
+        if (steps > 0) {
             this.setProperty(Job.PROPERTY_JOB_PROGRESS_STEPS, steps);
         }
-        if ( eta > 0 ) {
+        if (eta > 0) {
             final Date finishDate = new Date(System.currentTimeMillis() + eta * 1000);
             final Calendar finishCal = Calendar.getInstance();
             finishCal.setTime(finishDate);
@@ -281,16 +286,17 @@ public class JobImpl implements Job, Comparable<JobImpl> {
 
     public String[] setProgress(final int step) {
         final int steps = this.getProperty(Job.PROPERTY_JOB_PROGRESS_STEPS, -1);
-        if ( steps > 0 && step > 0 ) {
+        if (steps > 0 && step > 0) {
             int current = this.getProperty(Job.PROPERTY_JOB_PROGRESS_STEP, 0);
             current += step;
-            if ( current > steps ) {
+            if (current > steps) {
                 current = steps;
             }
             this.setProperty(Job.PROPERTY_JOB_PROGRESS_STEP, current);
 
             final Calendar now = Calendar.getInstance();
-            final long elapsed = now.getTimeInMillis() - this.getProcessingStarted().getTimeInMillis();
+            final long elapsed =
+                    now.getTimeInMillis() - this.getProcessingStarted().getTimeInMillis();
 
             final long eta = System.currentTimeMillis() + (elapsed / current) * (steps - current);
             now.setTimeInMillis(eta);
@@ -301,7 +307,7 @@ public class JobImpl implements Job, Comparable<JobImpl> {
     }
 
     public String update(final long eta) {
-        if ( eta > 0 ) {
+        if (eta > 0) {
             final Date finishDate = new Date(System.currentTimeMillis() + eta * 1000);
             final Calendar finishCal = Calendar.getInstance();
             finishCal.setTime(finishDate);
@@ -321,7 +327,7 @@ public class JobImpl implements Job, Comparable<JobImpl> {
 
         final String logEntry = MessageFormat.format(message, args);
         final String[] entries = this.getProperty(Job.PROPERTY_JOB_PROGRESS_LOG, String[].class);
-        if ( entries == null ) {
+        if (entries == null) {
             this.setProperty(Job.PROPERTY_JOB_PROGRESS_LOG, new String[] {logEntry});
         } else {
             addLog(logEntry, entries, logMaxCount);
@@ -332,8 +338,8 @@ public class JobImpl implements Job, Comparable<JobImpl> {
     @Override
     public JobState getJobState() {
         final String enumValue = this.getProperty(JobImpl.PROPERTY_FINISHED_STATE, String.class);
-        if ( enumValue == null ) {
-            if ( this.getProcessingStarted() != null ) {
+        if (enumValue == null) {
+            if (this.getProcessingStarted() != null) {
                 return JobState.ACTIVE;
             }
             return JobState.QUEUED;
@@ -392,10 +398,10 @@ public class JobImpl implements Job, Comparable<JobImpl> {
     @Override
     public int compareTo(final JobImpl o) {
         int result = this.getCreated().compareTo(o.getCreated());
-        if ( result == 0 ) {
-            if ( this.counter < o.counter ) {
+        if (result == 0) {
+            if (this.counter < o.counter) {
                 result = -1;
-            } else if ( this.counter > o.counter ) {
+            } else if (this.counter > o.counter) {
                 result = 1;
             } else {
                 result = this.jobId.compareTo(o.jobId);
@@ -411,19 +417,18 @@ public class JobImpl implements Job, Comparable<JobImpl> {
 
     @Override
     public boolean equals(final Object obj) {
-        if ( obj == this ) {
+        if (obj == this) {
             return true;
         }
-        if ( obj instanceof JobImpl ) {
-            return this.jobId.equals(((JobImpl)obj).jobId);
+        if (obj instanceof JobImpl) {
+            return this.jobId.equals(((JobImpl) obj).jobId);
         }
         return false;
     }
 
     @Override
     public String toString() {
-        return "JobImpl [properties=" + properties + ", topic=" + topic
-                + ", path=" + path + ", jobId=" + jobId + "]";
+        return "JobImpl [properties=" + properties + ", topic=" + topic + ", path=" + path + ", jobId=" + jobId + "]";
     }
 
     // helper methods
@@ -434,13 +439,13 @@ public class JobImpl implements Job, Comparable<JobImpl> {
             newEntries = new String[maxSize];
             System.arraycopy(entries, entries.length - maxSize + 1, newEntries, 0, maxSize - 2);
             final String prevLastLog = entries[entries.length - 1];
-            newEntries[maxSize - 2] = prevLastLog.endsWith(TRUNCATED_LOG) ? prevLastLog.replace(TRUNCATED_LOG, "") : prevLastLog;
+            newEntries[maxSize - 2] =
+                    prevLastLog.endsWith(TRUNCATED_LOG) ? prevLastLog.replace(TRUNCATED_LOG, "") : prevLastLog;
             newEntries[maxSize - 1] = logEntry.endsWith(TRUNCATED_LOG) ? logEntry : logEntry + TRUNCATED_LOG;
         } else {
             newEntries = new String[entries.length + 1];
             System.arraycopy(entries, 0, newEntries, 0, entries.length);
             newEntries[entries.length] = logEntry;
-
         }
         this.setProperty(Job.PROPERTY_JOB_PROGRESS_LOG, newEntries);
     }
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/JobManagerImpl.java b/src/main/java/org/apache/sling/event/impl/jobs/JobManagerImpl.java
index 564b21a..137a18e 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/JobManagerImpl.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/JobManagerImpl.java
@@ -28,6 +28,8 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
+import com.codahale.metrics.Gauge;
+import com.codahale.metrics.MetricRegistry;
 import org.apache.jackrabbit.util.ISO9075;
 import org.apache.sling.api.resource.LoginException;
 import org.apache.sling.api.resource.PersistenceException;
@@ -76,35 +78,31 @@ import org.osgi.service.event.EventHandler;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.codahale.metrics.Gauge;
-import com.codahale.metrics.MetricRegistry;
-
-
 /**
  * Implementation of the job manager.
  */
-@Component(immediate=true,
-    service={JobManager.class, EventHandler.class, Runnable.class},
-    property = {
+@Component(
+        immediate = true,
+        service = {JobManager.class, EventHandler.class, Runnable.class},
+        property = {
             Constants.SERVICE_VENDOR + "=The Apache Software Foundation",
             Scheduler.PROPERTY_SCHEDULER_PERIOD + ":Long=60",
             Scheduler.PROPERTY_SCHEDULER_CONCURRENT + ":Boolean=false",
             Scheduler.PROPERTY_SCHEDULER_THREAD_POOL + "=" + ScheduleInfoImpl.EVENTING_THREADPOOL_NAME,
             EventConstants.EVENT_TOPIC + "=" + ResourceHelper.BUNDLE_EVENT_STARTED,
             EventConstants.EVENT_TOPIC + "=" + ResourceHelper.BUNDLE_EVENT_UPDATED
-    })
-public class JobManagerImpl
-    implements JobManager, EventHandler, Runnable {
-    
+        })
+public class JobManagerImpl implements JobManager, EventHandler, Runnable {
+
     private static final String GAUGE_TOTAL_SCHEDULED_JOBS = "event.scheduledJobs.count";
 
     /** Default logger. */
     private final Logger logger = LoggerFactory.getLogger(this.getClass());
 
-    @Reference(policyOption=ReferencePolicyOption.GREEDY)
+    @Reference(policyOption = ReferencePolicyOption.GREEDY)
     private EventAdmin eventAdmin;
 
-    @Reference(policyOption=ReferencePolicyOption.GREEDY)
+    @Reference(policyOption = ReferencePolicyOption.GREEDY)
     private Scheduler scheduler;
 
     @Reference
@@ -113,7 +111,7 @@ public class JobManagerImpl
     @Reference
     private QueuesMBean queuesMBean;
 
-    @Reference(policyOption=ReferencePolicyOption.GREEDY)
+    @Reference(policyOption = ReferencePolicyOption.GREEDY)
     private ThreadPoolManager threadPoolManager;
 
     /** The job manager configuration. */
@@ -122,8 +120,7 @@ public class JobManagerImpl
 
     @Reference
     private StatisticsManager statisticsManager;
-    
-    
+
     @Reference(target = "(name=sling)", cardinality = ReferenceCardinality.OPTIONAL)
     private MetricRegistry metricRegistry;
 
@@ -143,7 +140,8 @@ public class JobManagerImpl
      */
     @Activate
     protected void activate(final BundleContext ctx, final Map<String, Object> props) throws LoginException {
-        this.jobScheduler = new org.apache.sling.event.impl.jobs.scheduling.JobSchedulerImpl(this.configuration, this.scheduler, this);
+        this.jobScheduler = new org.apache.sling.event.impl.jobs.scheduling.JobSchedulerImpl(
+                this.configuration, this.scheduler, this);
         if (metricRegistry != null) {
             Gauge<Integer> sup = () -> jobScheduler.getTotalNumberOfScheduledJobs();
             metricRegistry.gauge(GAUGE_TOTAL_SCHEDULED_JOBS, () -> sup);
@@ -170,7 +168,7 @@ public class JobManagerImpl
     protected void deactivate() {
         logger.debug("Apache Sling Job Manager stopping on instance {}", Environment.APPLICATION_ID);
 
-        if ( this.changeListenerReg != null ) {
+        if (this.changeListenerReg != null) {
             this.changeListenerReg.unregister();
             this.changeListenerReg = null;
         }
@@ -192,7 +190,7 @@ public class JobManagerImpl
     public void run() {
         // invoke maintenance task
         final CleanUpTask task = this.maintenanceTask;
-        if ( task != null ) {
+        if (task != null) {
             task.run();
         }
     }
@@ -247,37 +245,38 @@ public class JobManagerImpl
     private boolean internalRemoveJobById(final String jobId, final boolean forceRemove) {
         logger.debug("Trying to remove job {}", jobId);
         boolean result = true;
-        JobImpl job = (JobImpl)this.getJobById(jobId);
-        if ( job != null ) {
-            if ( logger.isDebugEnabled() ) {
+        JobImpl job = (JobImpl) this.getJobById(jobId);
+        if (job != null) {
+            if (logger.isDebugEnabled()) {
                 logger.debug("Found removal job: {}", Utility.toString(job));
             }
-            final JobImpl retryJob = (JobImpl)this.configuration.getJobFromRetryList(jobId);
-            if ( retryJob != null ) {
+            final JobImpl retryJob = (JobImpl) this.configuration.getJobFromRetryList(jobId);
+            if (retryJob != null) {
                 job = retryJob;
             }
             // currently running?
-            if ( !forceRemove && job.getProcessingStarted() != null ) {
-                if ( logger.isDebugEnabled() ) {
+            if (!forceRemove && job.getProcessingStarted() != null) {
+                if (logger.isDebugEnabled()) {
                     logger.debug("Unable to remove job - job is started: {}", Utility.toString(job));
                 }
                 result = false;
             } else {
                 final boolean isHistoryJob = this.configuration.isStoragePath(job.getResourcePath());
                 // if history job, simply remove - otherwise move to history!
-                if ( isHistoryJob ) {
+                if (isHistoryJob) {
                     final ResourceResolver resolver = this.configuration.createResourceResolver();
                     try {
                         final Resource jobResource = resolver.getResource(job.getResourcePath());
-                        if ( jobResource != null ) {
+                        if (jobResource != null) {
                             resolver.delete(jobResource);
                             resolver.commit();
                             logger.debug("Removed job with id: {}", jobId);
                         } else {
                             logger.debug("Unable to remove job with id - resource already removed: {}", jobId);
                         }
-                        NotificationUtility.sendNotification(this.eventAdmin, NotificationConstants.TOPIC_JOB_REMOVED, job, null);
-                    } catch ( final PersistenceException pe) {
+                        NotificationUtility.sendNotification(
+                                this.eventAdmin, NotificationConstants.TOPIC_JOB_REMOVED, job, null);
+                    } catch (final PersistenceException pe) {
                         logger.warn("Unable to remove job at " + job.getResourcePath(), pe);
                         result = false;
                     } finally {
@@ -322,18 +321,18 @@ public class JobManagerImpl
             buf.append(" = '");
             buf.append(id);
             buf.append("']");
-            if ( logger.isDebugEnabled() ) {
+            if (logger.isDebugEnabled()) {
                 logger.debug("Exceuting query: {}", buf.toString());
             }
             final Iterator<Resource> result = resolver.findResources(buf.toString(), "xpath");
 
-            while ( result.hasNext() ) {
+            while (result.hasNext()) {
                 final Resource jobResource = result.next();
                 // sanity check for the path
-                if ( this.configuration.isJob(jobResource.getPath()) ) {
+                if (this.configuration.isJob(jobResource.getPath())) {
                     final JobImpl job = Utility.readJob(logger, jobResource);
-                    if ( job != null ) {
-                        if ( logger.isDebugEnabled() ) {
+                    if (job != null) {
+                        if (logger.isDebugEnabled()) {
                             logger.debug("Found job with id {} = {}", id, Utility.toString(job));
                         }
                         return job;
@@ -356,13 +355,13 @@ public class JobManagerImpl
     @Override
     public Job getJob(final String topic, final Map<String, Object> template) {
         final Iterable<Job> iter;
-        if ( template == null ) {
-            iter = this.findJobs(QueryType.ALL, topic, 1, (Map<String, Object>[])null);
+        if (template == null) {
+            iter = this.findJobs(QueryType.ALL, topic, 1, (Map<String, Object>[]) null);
         } else {
             iter = this.findJobs(QueryType.ALL, topic, 1, template);
         }
         final Iterator<Job> i = iter.iterator();
-        if ( i.hasNext() ) {
+        if (i.hasNext()) {
             return i.next();
         }
         return null;
@@ -388,59 +387,58 @@ public class JobManagerImpl
      * @see org.apache.sling.event.jobs.JobManager#findJobs(org.apache.sling.event.jobs.JobManager.QueryType, java.lang.String, long, java.util.Map[])
      */
     @Override
-    public Collection<Job> findJobs(final QueryType type,
-            final String topic,
-            final long limit,
-            final Map<String, Object>... templates) {
+    public Collection<Job> findJobs(
+            final QueryType type, final String topic, final long limit, final Map<String, Object>... templates) {
         final boolean isHistoryQuery = type == QueryType.HISTORY
-                                       || type == QueryType.SUCCEEDED
-                                       || type == QueryType.CANCELLED
-                                       || type == QueryType.DROPPED
-                                       || type == QueryType.ERROR
-                                       || type == QueryType.GIVEN_UP
-                                       || type == QueryType.STOPPED;
+                || type == QueryType.SUCCEEDED
+                || type == QueryType.CANCELLED
+                || type == QueryType.DROPPED
+                || type == QueryType.ERROR
+                || type == QueryType.GIVEN_UP
+                || type == QueryType.STOPPED;
         final List<Job> result = new ArrayList<>();
         final ResourceResolver resolver = this.configuration.createResourceResolver();
         final StringBuilder buf = new StringBuilder(64);
         try {
             buf.append(buildBaseQuery(this.configuration.getJobsBasePathWithSlash(), topic, type, isHistoryQuery));
 
-            if ( templates != null && templates.length > 0 ) {
+            if (templates != null && templates.length > 0) {
                 int index = 0;
-                for (final Map<String,Object> template : templates) {
+                for (final Map<String, Object> template : templates) {
                     // skip empty templates
-                    if ( template.size() == 0 ) {
+                    if (template.size() == 0) {
                         continue;
                     }
-                    if ( index == 0 ) {
+                    if (index == 0) {
                         buf.append(" and (");
                     } else {
                         buf.append(" or ");
                     }
                     buf.append('(');
-                    final Iterator<Map.Entry<String, Object>> i = template.entrySet().iterator();
+                    final Iterator<Map.Entry<String, Object>> i =
+                            template.entrySet().iterator();
                     boolean first = true;
-                    while ( i.hasNext() ) {
+                    while (i.hasNext()) {
                         final Map.Entry<String, Object> current = i.next();
                         final String key = current.getKey();
                         final char firstChar = key.length() > 0 ? key.charAt(0) : 0;
                         String propName;
                         final Operation op;
-                        if ( firstChar == '=' ) {
+                        if (firstChar == '=') {
                             propName = key.substring(1);
-                            op  = Operation.EQUALS;
-                        } else if ( firstChar == '<' ) {
+                            op = Operation.EQUALS;
+                        } else if (firstChar == '<') {
                             final char secondChar = key.length() > 1 ? key.charAt(1) : 0;
-                            if ( secondChar == '=' ) {
+                            if (secondChar == '=') {
                                 op = Operation.LESS_OR_EQUALS;
                                 propName = key.substring(2);
                             } else {
                                 op = Operation.LESS;
                                 propName = key.substring(1);
                             }
-                        } else if ( firstChar == '>' ) {
+                        } else if (firstChar == '>') {
                             final char secondChar = key.length() > 1 ? key.charAt(1) : 0;
-                            if ( secondChar == '=' ) {
+                            if (secondChar == '=') {
                                 op = Operation.GREATER_OR_EQUALS;
                                 propName = key.substring(2);
                             } else {
@@ -449,12 +447,12 @@ public class JobManagerImpl
                             }
                         } else {
                             propName = key;
-                            op  = Operation.EQUALS;
+                            op = Operation.EQUALS;
                         }
 
                         propName = ISO9075.encode(propName);
 
-                        if ( first ) {
+                        if (first) {
                             first = false;
                             buf.append('@');
                         } else {
@@ -462,12 +460,22 @@ public class JobManagerImpl
                         }
                         buf.append(propName);
                         buf.append(' ');
-                        switch ( op ) {
-                            case EQUALS : buf.append('=');break;
-                            case LESS : buf.append('<'); break;
-                            case LESS_OR_EQUALS : buf.append("<="); break;
-                            case GREATER : buf.append('>'); break;
-                            case GREATER_OR_EQUALS : buf.append(">="); break;
+                        switch (op) {
+                            case EQUALS:
+                                buf.append('=');
+                                break;
+                            case LESS:
+                                buf.append('<');
+                                break;
+                            case LESS_OR_EQUALS:
+                                buf.append("<=");
+                                break;
+                            case GREATER:
+                                buf.append('>');
+                                break;
+                            case GREATER_OR_EQUALS:
+                                buf.append(">=");
+                                break;
                         }
                         buf.append(" '");
                         buf.append(current.getValue());
@@ -476,12 +484,12 @@ public class JobManagerImpl
                     buf.append(')');
                     index++;
                 }
-                if ( index > 0 ) {
+                if (index > 0) {
                     buf.append(')');
                 }
             }
             buf.append("] order by @");
-            if ( isHistoryQuery ) {
+            if (isHistoryQuery) {
                 buf.append(JobImpl.PROPERTY_FINISHED_DATE);
                 buf.append(" descending");
             } else {
@@ -491,17 +499,17 @@ public class JobManagerImpl
             final Iterator<Resource> iter = resolver.findResources(buf.toString(), "xpath");
             long count = 0;
 
-            while ( iter.hasNext() && (limit < 1 || count < limit) ) {
+            while (iter.hasNext() && (limit < 1 || count < limit)) {
                 final Resource jobResource = iter.next();
                 // sanity check for the path
-                if ( this.configuration.isJob(jobResource.getPath()) ) {
+                if (this.configuration.isJob(jobResource.getPath())) {
                     final JobImpl job = Utility.readJob(logger, jobResource);
-                    if ( job != null ) {
+                    if (job != null) {
                         count++;
                         result.add(job);
                     }
                 }
-             }
+            }
         } catch (final QuerySyntaxException qse) {
             logger.warn("Query syntax wrong " + buf.toString(), qse);
         } finally {
@@ -510,7 +518,8 @@ public class JobManagerImpl
         return result;
     }
 
-    protected static String buildBaseQuery(final String queryRoot, final String topic, final QueryType type, final boolean isHistoryQuery) {
+    protected static String buildBaseQuery(
+            final String queryRoot, final String topic, final QueryType type, final boolean isHistoryQuery) {
         StringBuilder buf = new StringBuilder();
         buf.append("/jcr:root");
         buf.append(queryRoot);
@@ -525,14 +534,18 @@ public class JobManagerImpl
         }
 
         // restricting on the type - history or unfinished
-        if ( isHistoryQuery ) {
+        if (isHistoryQuery) {
             buf.append(" and @");
             buf.append(ISO9075.encode(JobImpl.PROPERTY_FINISHED_STATE));
-            if ( type == QueryType.SUCCEEDED || type == QueryType.DROPPED || type == QueryType.ERROR || type == QueryType.GIVEN_UP || type == QueryType.STOPPED ) {
+            if (type == QueryType.SUCCEEDED
+                    || type == QueryType.DROPPED
+                    || type == QueryType.ERROR
+                    || type == QueryType.GIVEN_UP
+                    || type == QueryType.STOPPED) {
                 buf.append(" = '");
                 buf.append(type.name());
                 buf.append("'");
-            } else if ( type == QueryType.CANCELLED ) {
+            } else if (type == QueryType.CANCELLED) {
                 buf.append(" and (@");
                 buf.append(ISO9075.encode(JobImpl.PROPERTY_FINISHED_STATE));
                 buf.append(" = '");
@@ -555,10 +568,10 @@ public class JobManagerImpl
             buf.append(" and not(@");
             buf.append(ISO9075.encode(JobImpl.PROPERTY_FINISHED_STATE));
             buf.append(")");
-            if ( type == QueryType.ACTIVE ) {
+            if (type == QueryType.ACTIVE) {
                 buf.append(" and @");
                 buf.append(ISO9075.encode(Job.PROPERTY_JOB_STARTED_TIME));
-            } else if ( type == QueryType.QUEUED ) {
+            } else if (type == QueryType.QUEUED) {
                 buf.append(" and not(@");
                 buf.append(ISO9075.encode(Job.PROPERTY_JOB_STARTED_TIME));
                 buf.append(")");
@@ -574,42 +587,42 @@ public class JobManagerImpl
      * @param passedJobProperties The optional job properties
      * @return The persisted job or <code>null</code>.
      */
-    private Job addJobInternal(final String jobTopic,
-            final Map<String, Object> jobProperties,
-            final List<String> errors) {
+    private Job addJobInternal(
+            final String jobTopic, final Map<String, Object> jobProperties, final List<String> errors) {
         final QueueInfo info = this.configuration.getQueueConfigurationManager().getQueueInfo(jobTopic);
 
         final TopologyCapabilities caps = this.configuration.getTopologyCapabilities();
         info.targetId = (caps == null ? null : caps.detectTarget(jobTopic, jobProperties, info));
 
         if (info.targetId == null && logger.isInfoEnabled()) {
-            logger.info("Persisting job {} into queue {} with no assigned target",
-                    Utility.toString(jobTopic, jobProperties), info.queueName);
+            logger.info(
+                    "Persisting job {} into queue {} with no assigned target",
+                    Utility.toString(jobTopic, jobProperties),
+                    info.queueName);
         } else if (info.targetId != null && logger.isDebugEnabled()) {
-            logger.debug("Persisting job {} into queue {}, target={}",
-                    Utility.toString(jobTopic, jobProperties), info.queueName, info.targetId);
+            logger.debug(
+                    "Persisting job {} into queue {}, target={}",
+                    Utility.toString(jobTopic, jobProperties),
+                    info.queueName,
+                    info.targetId);
         }
         final ResourceResolver resolver = this.configuration.createResourceResolver();
         try {
-            final JobImpl job = this.writeJob(resolver,
-                    jobTopic,
-                    jobProperties,
-                    info);
-            if ( info.targetId != null ) {
-                this.configuration.getAuditLogger().debug("ASSIGN OK {} : {}",
-                        info.targetId, job.getId());
+            final JobImpl job = this.writeJob(resolver, jobTopic, jobProperties, info);
+            if (info.targetId != null) {
+                this.configuration.getAuditLogger().debug("ASSIGN OK {} : {}", info.targetId, job.getId());
             } else {
-                this.configuration.getAuditLogger().debug("UNASSIGN OK : {}",
-                        job.getId());
+                this.configuration.getAuditLogger().debug("UNASSIGN OK : {}", job.getId());
             }
             return job;
-        } catch (final PersistenceException re ) {
+        } catch (final PersistenceException re) {
             // something went wrong, so let's log it
-            this.logger.error("Exception during persisting new job '" + Utility.toString(jobTopic, jobProperties) + "'", re);
+            this.logger.error(
+                    "Exception during persisting new job '" + Utility.toString(jobTopic, jobProperties) + "'", re);
         } finally {
             resolver.close();
         }
-        if ( errors != null ) {
+        if (errors != null) {
             errors.add("Unable to persist new job.");
         }
 
@@ -623,21 +636,22 @@ public class JobManagerImpl
      * @param info The queue information (queue name etc.)
      * @throws PersistenceException
      */
-    private JobImpl writeJob(final ResourceResolver resolver,
+    private JobImpl writeJob(
+            final ResourceResolver resolver,
             final String jobTopic,
             final Map<String, Object> jobProperties,
             final QueueInfo info)
-    throws PersistenceException {
+            throws PersistenceException {
         final String jobId = this.configuration.getUniqueId(jobTopic);
         final String path = this.configuration.getUniquePath(info.targetId, jobTopic, jobId, jobProperties);
 
         // create properties
         final Map<String, Object> properties = new HashMap<>();
 
-        if ( jobProperties != null ) {
-            for(final Map.Entry<String, Object> entry : jobProperties.entrySet() ) {
+        if (jobProperties != null) {
+            for (final Map.Entry<String, Object> entry : jobProperties.entrySet()) {
                 final String propName = entry.getKey();
-                if ( !ResourceHelper.ignoreProperty(propName) ) {
+                if (!ResourceHelper.ignoreProperty(propName)) {
                     properties.put(propName, entry.getValue());
                 }
             }
@@ -652,7 +666,7 @@ public class JobManagerImpl
         properties.put(Job.PROPERTY_JOB_CREATED, Calendar.getInstance());
         properties.put(JobImpl.PROPERTY_JOB_QUEUED, Calendar.getInstance());
         properties.put(Job.PROPERTY_JOB_CREATED_INSTANCE, Environment.APPLICATION_ID);
-        if ( info.targetId != null ) {
+        if (info.targetId != null) {
             properties.put(Job.PROPERTY_JOB_TARGET_INSTANCE, info.targetId);
         } else {
             properties.remove(Job.PROPERTY_JOB_TARGET_INSTANCE);
@@ -660,12 +674,10 @@ public class JobManagerImpl
 
         // create path and resource
         properties.put(ResourceResolver.PROPERTY_RESOURCE_TYPE, ResourceHelper.RESOURCE_TYPE_JOB);
-        if ( logger.isDebugEnabled() ) {
+        if (logger.isDebugEnabled()) {
             logger.debug("Storing new job {} at {}", Utility.toString(jobTopic, properties), path);
         }
-        ResourceHelper.createAndCommitResource(resolver,
-                path,
-                properties);
+        ResourceHelper.createAndCommitResource(resolver, path, properties);
 
         // update property types - priority, add path and create job
         properties.put(JobImpl.PROPERTY_RESOURCE_PATH, path);
@@ -681,17 +693,18 @@ public class JobManagerImpl
     }
 
     private void stopJobById(final String jobId, final boolean forward) {
-        final JobImpl job = (JobImpl)this.getJobById(jobId);
-        if ( job != null && !this.configuration.isStoragePath(job.getResourcePath()) ) {
+        final JobImpl job = (JobImpl) this.getJobById(jobId);
+        if (job != null && !this.configuration.isStoragePath(job.getResourcePath())) {
             // get the queue configuration
-            final QueueInfo queueInfo = this.configuration.getQueueConfigurationManager().getQueueInfo(job.getTopic());
-            final JobQueueImpl queue = (JobQueueImpl)this.qManager.getQueue(queueInfo.queueName);
+            final QueueInfo queueInfo =
+                    this.configuration.getQueueConfigurationManager().getQueueInfo(job.getTopic());
+            final JobQueueImpl queue = (JobQueueImpl) this.qManager.getQueue(queueInfo.queueName);
 
             boolean stopped = false;
-            if ( queue != null ) {
+            if (queue != null) {
                 stopped = queue.stopJob(job);
             }
-            if ( forward && !stopped ) {
+            if (forward && !stopped) {
                 // mark the job as stopped
                 final JobHandler jh = new JobHandler(job, null, this.configuration);
                 jh.finished(JobState.STOPPED, true, null);
@@ -712,52 +725,46 @@ public class JobManagerImpl
      */
     @Override
     public Collection<ScheduledJobInfo> getScheduledJobs() {
-        return this.jobScheduler.getScheduledJobs(null, -1, (Map<String, Object>[])null);
+        return this.jobScheduler.getScheduledJobs(null, -1, (Map<String, Object>[]) null);
     }
 
     /**
      * @see org.apache.sling.event.jobs.JobManager#getScheduledJobs()
      */
     @Override
-    public Collection<ScheduledJobInfo> getScheduledJobs(final String topic,
-            final long limit,
-            final Map<String, Object>... templates) {
+    public Collection<ScheduledJobInfo> getScheduledJobs(
+            final String topic, final long limit, final Map<String, Object>... templates) {
         return this.jobScheduler.getScheduledJobs(topic, limit, templates);
     }
 
     /**
      * Internal method to add a job
      */
-    public Job addJob(final String topic,
-            final Map<String, Object> properties,
-            final List<String> errors) {
+    public Job addJob(final String topic, final Map<String, Object> properties, final List<String> errors) {
         final String errorMessage = Utility.checkJob(topic, properties);
-        if ( errorMessage != null ) {
+        if (errorMessage != null) {
             logger.warn("{}", errorMessage);
-            if ( errors != null ) {
+            if (errors != null) {
                 errors.add(errorMessage);
             }
-            this.configuration.getAuditLogger().debug("ADD FAILED topic={}, properties={} : {}",
-                    new Object[] {topic,
-                                  properties,
-                                  errorMessage});
+            this.configuration
+                    .getAuditLogger()
+                    .debug("ADD FAILED topic={}, properties={} : {}", new Object[] {topic, properties, errorMessage});
             return null;
         }
         final List<String> errorList = new ArrayList<>();
         Job result = this.addJobInternal(topic, properties, errorList);
-        if ( errors != null ) {
+        if (errors != null) {
             errors.addAll(errorList);
         }
-        if ( result == null ) {
-            this.configuration.getAuditLogger().debug("ADD FAILED topic={}, properties={} : {}",
-                    new Object[] {topic,
-                                  properties,
-                                  errorList});
+        if (result == null) {
+            this.configuration
+                    .getAuditLogger()
+                    .debug("ADD FAILED topic={}, properties={} : {}", new Object[] {topic, properties, errorList});
         } else {
-            this.configuration.getAuditLogger().debug("ADD OK topic={}, properties={} : {}",
-                    new Object[] {topic,
-                                  properties,
-                                  result.getId()});
+            this.configuration
+                    .getAuditLogger()
+                    .debug("ADD OK topic={}, properties={} : {}", new Object[] {topic, properties, result.getId()});
         }
 
         return result;
@@ -768,8 +775,8 @@ public class JobManagerImpl
      */
     @Override
     public Job retryJobById(final String jobId) {
-        final JobImpl job = (JobImpl)this.getJobById(jobId);
-        if ( job != null && this.configuration.isStoragePath(job.getResourcePath()) ) {
+        final JobImpl job = (JobImpl) this.getJobById(jobId);
+        if (job != null && this.configuration.isStoragePath(job.getResourcePath())) {
             this.internalRemoveJobById(jobId, true);
             return this.addJob(job.getTopic(), job.getProperties());
         }
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/JobTopicTraverser.java b/src/main/java/org/apache/sling/event/impl/jobs/JobTopicTraverser.java
index 1981e77..dfe26e6 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/JobTopicTraverser.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/JobTopicTraverser.java
@@ -80,9 +80,7 @@ public class JobTopicTraverser {
      * @param topicResource The topic resource
      * @param handler       The callback
      */
-    public static void traverse(final Logger logger,
-            final Resource topicResource,
-            final JobCallback handler) {
+    public static void traverse(final Logger logger, final Resource topicResource, final JobCallback handler) {
         traverse(logger, topicResource, handler, null);
     }
 
@@ -96,9 +94,7 @@ public class JobTopicTraverser {
      * @param topicResource The topic resource
      * @param handler       The callback
      */
-    public static void traverse(final Logger logger,
-            final Resource topicResource,
-            final ResourceCallback handler) {
+    public static void traverse(final Logger logger, final Resource topicResource, final ResourceCallback handler) {
         traverse(logger, topicResource, null, handler);
     }
 
@@ -109,29 +105,31 @@ public class JobTopicTraverser {
      * @param jobHandler    The job callback
      * @param resourceHandler    The resource callback
      */
-    private static void traverse(final Logger logger,
+    private static void traverse(
+            final Logger logger,
             final Resource topicResource,
             final JobCallback jobHandler,
             final ResourceCallback resourceHandler) {
         logger.debug("Processing topic {}", topicResource.getName().replace('.', '/'));
         // now years
-        for(final Resource yearResource: Utility.getSortedChildren(logger, "year", topicResource)) {
+        for (final Resource yearResource : Utility.getSortedChildren(logger, "year", topicResource)) {
             logger.debug("Processing year {}", yearResource.getName());
 
             // now months
-            for(final Resource monthResource: Utility.getSortedChildren(logger, "month", yearResource)) {
+            for (final Resource monthResource : Utility.getSortedChildren(logger, "month", yearResource)) {
                 logger.debug("Processing month {}", monthResource.getName());
 
                 // now days
-                for(final Resource dayResource: Utility.getSortedChildren(logger, "day", monthResource)) {
+                for (final Resource dayResource : Utility.getSortedChildren(logger, "day", monthResource)) {
                     logger.debug("Processing day {}", dayResource.getName());
 
                     // now hours
-                    for(final Resource hourResource: Utility.getSortedChildren(logger, "hour", dayResource)) {
+                    for (final Resource hourResource : Utility.getSortedChildren(logger, "hour", dayResource)) {
                         logger.debug("Processing hour {}", hourResource.getName());
 
                         // now minutes
-                        for(final Resource minuteResource: Utility.getSortedChildren(logger, "minute", hourResource)) {
+                        for (final Resource minuteResource :
+                                Utility.getSortedChildren(logger, "minute", hourResource)) {
                             logger.debug("Processing minute {}", minuteResource.getName());
 
                             // now jobs
@@ -139,31 +137,31 @@ public class JobTopicTraverser {
                             // we use an iterator to skip removed entries
                             // see SLING-4073
                             final Iterator<Resource> jobIter = minuteResource.listChildren();
-                            while ( jobIter.hasNext() ) {
+                            while (jobIter.hasNext()) {
                                 final Resource jobResource = jobIter.next();
-                                if ( resourceHandler != null ) {
-                                    if ( !resourceHandler.handle(jobResource) ) {
+                                if (resourceHandler != null) {
+                                    if (!resourceHandler.handle(jobResource)) {
                                         return;
                                     }
                                 } else {
                                     final JobImpl job = Utility.readJob(logger, jobResource);
-                                    if ( job != null ) {
+                                    if (job != null) {
                                         logger.debug("Found job {}", jobResource.getName());
                                         jobs.add(job);
                                     }
                                 }
                             }
 
-                            if ( jobHandler != null ) {
+                            if (jobHandler != null) {
                                 Collections.sort(jobs);
 
                                 boolean stop = false;
-                                for(final JobImpl job : jobs) {
-                                    if ( !jobHandler.handle(job) ) {
+                                for (final JobImpl job : jobs) {
+                                    if (!jobHandler.handle(job)) {
                                         stop = true;
                                     }
                                 }
-                                if ( stop ) {
+                                if (stop) {
                                     return;
                                 }
                             }
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/Utility.java b/src/main/java/org/apache/sling/event/impl/jobs/Utility.java
index 1add893..b605fc6 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/Utility.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/Utility.java
@@ -53,12 +53,12 @@ public abstract class Utility {
      */
     public static String checkJobTopic(final Object jobTopic) {
         String message = null;
-        if ( jobTopic != null ) {
-            if ( jobTopic instanceof String ) {
+        if (jobTopic != null) {
+            if (jobTopic instanceof String) {
                 try {
-                    new Event((String)jobTopic, (Dictionary<String, Object>)null);
+                    new Event((String) jobTopic, (Dictionary<String, Object>) null);
                 } catch (final IllegalArgumentException iae) {
-                	message = String.format("Discarding job - job has an illegal job topic '%s'",jobTopic);
+                    message = String.format("Discarding job - job has an illegal job topic '%s'", jobTopic);
                 }
 
             } else {
@@ -77,10 +77,10 @@ public abstract class Utility {
      */
     public static String checkJob(final Object jobTopic, final Map<String, Object> properties) {
         final String msg = checkJobTopic(jobTopic);
-        if ( msg == null ) {
-            if ( properties != null ) {
-                for(final Object val : properties.values()) {
-                    if ( val != null && !(val instanceof Serializable) ) {
+        if (msg == null) {
+            if (properties != null) {
+                for (final Object val : properties.values()) {
+                    if (val != null && !(val instanceof Serializable)) {
                         return "Discarding job - properties must be serializable: " + jobTopic + " : " + properties;
                     }
                 }
@@ -96,7 +96,7 @@ public abstract class Utility {
      */
     public static Event toEvent(final Job job) {
         final Map<String, Object> eventProps = new HashMap<>();
-        eventProps.putAll(((JobImpl)job).getProperties());
+        eventProps.putAll(((JobImpl) job).getProperties());
         eventProps.put(ResourceHelper.PROPERTY_JOB_ID, job.getId());
         eventProps.remove(JobConsumer.PROPERTY_JOB_ASYNC_HANDLER);
         return new Event(job.getTopic(), eventProps);
@@ -105,17 +105,16 @@ public abstract class Utility {
     /**
      * Append properties to the string builder
      */
-    private static void appendProperties(final StringBuilder sb,
-            final Map<String, Object> properties) {
-        if ( properties != null ) {
+    private static void appendProperties(final StringBuilder sb, final Map<String, Object> properties) {
+        if (properties != null) {
             sb.append(", properties=");
             boolean first = true;
-            for(final String propName : properties.keySet()) {
-                if ( propName.equals(ResourceHelper.PROPERTY_JOB_ID)
-                    || propName.equals(ResourceHelper.PROPERTY_JOB_TOPIC) ) {
-                   continue;
+            for (final String propName : properties.keySet()) {
+                if (propName.equals(ResourceHelper.PROPERTY_JOB_ID)
+                        || propName.equals(ResourceHelper.PROPERTY_JOB_TOPIC)) {
+                    continue;
                 }
-                if ( first ) {
+                if (first) {
                     first = false;
                 } else {
                     sb.append(",");
@@ -126,10 +125,10 @@ public abstract class Utility {
                 // the toString() method of Calendar is very verbose
                 // therefore we do a toString for these objects based
                 // on a date
-                if ( value instanceof Calendar ) {
+                if (value instanceof Calendar) {
                     sb.append(value.getClass().getName());
                     sb.append('(');
-                    sb.append(((Calendar)value).getTime());
+                    sb.append(((Calendar) value).getTime());
                     sb.append(')');
                 } else {
                     sb.append(value);
@@ -142,8 +141,7 @@ public abstract class Utility {
      * Improved toString method for a job.
      * This method prints out the job topic and all of the properties.
      */
-    public static String toString(final String jobTopic,
-            final Map<String, Object> properties) {
+    public static String toString(final String jobTopic, final Map<String, Object> properties) {
         final StringBuilder sb = new StringBuilder("Sling Job ");
         sb.append("[topic=");
         sb.append(jobTopic);
@@ -158,13 +156,13 @@ public abstract class Utility {
      * This method prints out the job topic and all of the properties.
      */
     public static String toString(final Job job) {
-        if ( job != null ) {
+        if (job != null) {
             final StringBuilder sb = new StringBuilder("Sling Job ");
             sb.append("[topic=");
             sb.append(job.getTopic());
             sb.append(", id=");
             sb.append(job.getId());
-            appendProperties(sb, ((JobImpl)job).getProperties());
+            appendProperties(sb, ((JobImpl) job).getProperties());
             sb.append("]");
             return sb.toString();
         }
@@ -176,67 +174,72 @@ public abstract class Utility {
      */
     public static JobImpl readJob(final Logger logger, final Resource resource) {
         JobImpl job = null;
-        if ( resource != null ) {
+        if (resource != null) {
             try {
                 final ValueMap vm = ResourceHelper.getValueMap(resource);
 
                 // check job topic and job id
                 final String errorMessage = Utility.checkJobTopic(vm.get(ResourceHelper.PROPERTY_JOB_TOPIC));
                 final String jobId = vm.get(ResourceHelper.PROPERTY_JOB_ID, String.class);
-                if ( errorMessage == null && jobId != null ) {
+                if (errorMessage == null && jobId != null) {
                     final String topic = vm.get(ResourceHelper.PROPERTY_JOB_TOPIC, String.class);
                     final Map<String, Object> jobProperties = ResourceHelper.cloneValueMap(vm);
 
                     jobProperties.put(JobImpl.PROPERTY_RESOURCE_PATH, resource.getPath());
                     // convert to integers (JCR supports only long...)
                     jobProperties.put(Job.PROPERTY_JOB_RETRIES, vm.get(Job.PROPERTY_JOB_RETRIES, Integer.class));
-                    jobProperties.put(Job.PROPERTY_JOB_RETRY_COUNT, vm.get(Job.PROPERTY_JOB_RETRY_COUNT, Integer.class));
-                    if ( vm.get(Job.PROPERTY_JOB_PROGRESS_STEPS) != null ) {
-                        jobProperties.put(Job.PROPERTY_JOB_PROGRESS_STEPS, vm.get(Job.PROPERTY_JOB_PROGRESS_STEPS, Integer.class));
+                    jobProperties.put(
+                            Job.PROPERTY_JOB_RETRY_COUNT, vm.get(Job.PROPERTY_JOB_RETRY_COUNT, Integer.class));
+                    if (vm.get(Job.PROPERTY_JOB_PROGRESS_STEPS) != null) {
+                        jobProperties.put(
+                                Job.PROPERTY_JOB_PROGRESS_STEPS,
+                                vm.get(Job.PROPERTY_JOB_PROGRESS_STEPS, Integer.class));
                     }
-                    if ( vm.get(Job.PROPERTY_JOB_PROGRESS_STEP) != null ) {
-                        jobProperties.put(Job.PROPERTY_JOB_PROGRESS_STEP, vm.get(Job.PROPERTY_JOB_PROGRESS_STEP, Integer.class));
+                    if (vm.get(Job.PROPERTY_JOB_PROGRESS_STEP) != null) {
+                        jobProperties.put(
+                                Job.PROPERTY_JOB_PROGRESS_STEP, vm.get(Job.PROPERTY_JOB_PROGRESS_STEP, Integer.class));
                     }
                     @SuppressWarnings("unchecked")
-                    final List<Exception> readErrorList = (List<Exception>) jobProperties.get(ResourceHelper.PROPERTY_MARKER_READ_ERROR_LIST);
-                    if ( readErrorList != null ) {
-                        for(final Exception e : readErrorList) {
+                    final List<Exception> readErrorList =
+                            (List<Exception>) jobProperties.get(ResourceHelper.PROPERTY_MARKER_READ_ERROR_LIST);
+                    if (readErrorList != null) {
+                        for (final Exception e : readErrorList) {
                             final int c = readErrorWarnCount.getAndIncrement();
                             final String prefix;
-                            if ( c == READ_ERROR_SILENCE_LIMIT ) {
-                                logger.warn("Too many 'Unable to read job from ' messages - silencing 99% of them from now on.");
+                            if (c == READ_ERROR_SILENCE_LIMIT) {
+                                logger.warn(
+                                        "Too many 'Unable to read job from ' messages - silencing 99% of them from now on.");
                                 continue;
-                            } else if ( c > READ_ERROR_SILENCE_LIMIT && c % 100 != 0 ) {
+                            } else if (c > READ_ERROR_SILENCE_LIMIT && c % 100 != 0) {
                                 // SLING-9906 : then silence the log altogether
                                 continue;
-                            } else if ( c > READ_ERROR_SILENCE_LIMIT ) {
+                            } else if (c > READ_ERROR_SILENCE_LIMIT) {
                                 prefix = "[unsilenced] ";
                             } else {
                                 prefix = "";
                             }
-                            if ( e.getCause() != null && e.getCause() instanceof ClassNotFoundException ) {
+                            if (e.getCause() != null && e.getCause() instanceof ClassNotFoundException) {
                                 // SLING-9906 : suppress exception in ClassNotFoundException case
                                 // as this can happen many times in case of a not deployed class.
-                                logger.warn(prefix + "Unable to read job from " + resource.getPath() + ", exception: " + e + ", cause: " + e.getCause());
+                                logger.warn(prefix + "Unable to read job from " + resource.getPath() + ", exception: "
+                                        + e + ", cause: " + e.getCause());
                             } else {
                                 logger.warn(prefix + "Unable to read job from " + resource.getPath(), e);
                             }
                         }
                     }
-                    job = new JobImpl(topic,
-                            jobId,
-                            jobProperties);
+                    job = new JobImpl(topic, jobId, jobProperties);
                 } else {
-                    if ( errorMessage != null ) {
+                    if (errorMessage != null) {
                         logger.warn("{} : {}", errorMessage, resource.getPath());
-                    } else if ( jobId == null ) {
+                    } else if (jobId == null) {
                         logger.warn("Discarding job - no job id found : {}", resource.getPath());
                     }
                     // remove the job as the topic is invalid anyway
                     try {
                         resource.getResourceResolver().delete(resource);
                         resource.getResourceResolver().commit();
-                    } catch ( final PersistenceException ignore) {
+                    } catch (final PersistenceException ignore) {
                         logger.debug("Unable to remove job resource.", ignore);
                     }
                 }
@@ -246,7 +249,6 @@ public abstract class Utility {
             } catch (final RuntimeException re) {
                 logger.debug("Unable to read resource.", re);
             }
-
         }
         return job;
     }
@@ -258,16 +260,16 @@ public abstract class Utility {
             Integer value1 = null;
             try {
                 value1 = Integer.valueOf(o1.getName());
-            } catch ( final NumberFormatException nfe) {
+            } catch (final NumberFormatException nfe) {
                 // ignore
             }
             Integer value2 = null;
             try {
                 value2 = Integer.valueOf(o2.getName());
-            } catch ( final NumberFormatException nfe) {
+            } catch (final NumberFormatException nfe) {
                 // ignore
             }
-            if ( value1 != null && value2 != null ) {
+            if (value1 != null && value2 != null) {
                 return value1.compareTo(value2);
             }
             return o1.getName().compareTo(o2.getName());
@@ -283,10 +285,10 @@ public abstract class Utility {
     public static List<Resource> getSortedChildren(final Logger logger, final String type, final Resource rsrc) {
         final List<Resource> children = new ArrayList<>();
         final Iterator<Resource> monthIter = rsrc.listChildren();
-        while ( monthIter.hasNext() ) {
+        while (monthIter.hasNext()) {
             final Resource monthResource = monthIter.next();
             children.add(monthResource);
-            logger.debug("Found {} : {}",  type, monthResource.getName());
+            logger.debug("Found {} : {}", type, monthResource.getName());
         }
         Collections.sort(children, RESOURCE_COMPARATOR);
         return children;
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/config/ConfigurationConstants.java b/src/main/java/org/apache/sling/event/impl/jobs/config/ConfigurationConstants.java
index d152782..2f69a64 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/config/ConfigurationConstants.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/config/ConfigurationConstants.java
@@ -40,5 +40,4 @@ public abstract class ConfigurationConstants {
     public static final String PROP_KEEP_JOBS = "queue.keepJobs";
     public static final String PROP_THREAD_POOL_SIZE = "queue.threadPoolSize";
     public static final String PROP_PREFER_RUN_ON_CREATION_INSTANCE = "queue.preferRunOnCreationInstance";
-
 }
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/config/InternalQueueConfiguration.java b/src/main/java/org/apache/sling/event/impl/jobs/config/InternalQueueConfiguration.java
index 537dd05..1e3eb17 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/config/InternalQueueConfiguration.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/config/InternalQueueConfiguration.java
@@ -35,97 +35,109 @@ import org.osgi.service.metatype.annotations.Option;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-@Component(service=InternalQueueConfiguration.class,
-           name="org.apache.sling.event.jobs.QueueConfiguration",
-           configurationPolicy=ConfigurationPolicy.REQUIRE,
-           property={
-                   Constants.SERVICE_VENDOR + "=The Apache Software Foundation"
-           })
+@Component(
+        service = InternalQueueConfiguration.class,
+        name = "org.apache.sling.event.jobs.QueueConfiguration",
+        configurationPolicy = ConfigurationPolicy.REQUIRE,
+        property = {Constants.SERVICE_VENDOR + "=The Apache Software Foundation"})
 @Designate(ocd = InternalQueueConfiguration.Config.class, factory = true)
-public class InternalQueueConfiguration
-    implements QueueConfiguration, Comparable<InternalQueueConfiguration> {
+public class InternalQueueConfiguration implements QueueConfiguration, Comparable<InternalQueueConfiguration> {
 
-    @ObjectClassDefinition(name = "Apache Sling Job Queue Configuration",
-            description="The configuration of a job processing queue.")
+    @ObjectClassDefinition(
+            name = "Apache Sling Job Queue Configuration",
+            description = "The configuration of a job processing queue.")
     public @interface Config {
 
-        @AttributeDefinition(name="Name",
-              description="The name of the queue. If matching is used the token {0} can be used to substitute the real value.")
+        @AttributeDefinition(
+                name = "Name",
+                description =
+                        "The name of the queue. If matching is used the token {0} can be used to substitute the real value.")
         String queue_name();
 
-        @AttributeDefinition(name="Topics",
-              description="This value is required and lists the topics processed by "
+        @AttributeDefinition(
+                name = "Topics",
+                description = "This value is required and lists the topics processed by "
                         + "this queue. The value is a list of strings. If a string ends with a dot, "
                         + "all topics in exactly this package match. If the string ends with a star, "
                         + "all topics in this package and all subpackages match. If the string neither "
                         + "ends with a dot nor with a star, this is assumed to define an exact topic.")
         String[] queue_topics();
 
-        @AttributeDefinition(name = "Type",
-              description="The queue type.",
-              options = {@Option(label="Parallel",value="UNORDERED"),
-                      @Option(label="Ordered",value="ORDERED"),
-                      @Option(label="Topic Round Robin",value="TOPIC_ROUND_ROBIN")})
+        @AttributeDefinition(
+                name = "Type",
+                description = "The queue type.",
+                options = {
+                    @Option(label = "Parallel", value = "UNORDERED"),
+                    @Option(label = "Ordered", value = "ORDERED"),
+                    @Option(label = "Topic Round Robin", value = "TOPIC_ROUND_ROBIN")
+                })
         String queue_type() default "UNORDERED";
 
         @AttributeDefinition(
-                 name="Priority",
-                 description="The priority for the threads used by this queue. Default is norm.",
-                 options = {
-                         @Option(label="Norm",value="NORM"),
-                         @Option(label="Min",value="MIN"),
-                         @Option(label="Max",value="MAX")
-                 })
-         String queue_priority() default ConfigurationConstants.DEFAULT_PRIORITY;
-
-         @AttributeDefinition(name="Maximum Retries",
-                 description="The maximum number of times a failed job slated "
-                         + "for retries is actually retried. If a job has been retried this number of "
-                         + "times and still fails, it is not rescheduled and assumed to have failed. The "
-                         + "default value is 10.")
-         int queue_retries() default ConfigurationConstants.DEFAULT_RETRIES;
-
-         @AttributeDefinition(name="Retry Delay",
-                 description="The number of milliseconds to sleep between two "
-                         + "consecutive retries of a job which failed and was set to be retried. The "
-                         + "default value is 2 seconds. This value is only relevant if there is a single "
-                         + "failed job in the queue. If there are multiple failed jobs, each job is "
-                         + "retried in turn without an intervening delay.")
-         long queue_retrydelay() default ConfigurationConstants.DEFAULT_RETRY_DELAY;
-
-         @AttributeDefinition(name="Maximum Parallel Jobs",
-                 description="The maximum number of parallel jobs started for this queue. "
-                         + "A value of -1 is substituted with the number of available processors. "
-                         + "Positive integer values specify number of processors to use.  Can be greater than number of processors. "
-                         + "A decimal number between 0.0 and 1.0 is treated as a fraction of available processors. "
-                         + "For example 0.5 means half of the available processors. For ordered queue types this value is ignored (always enforced to be 1).")
-         double queue_maxparallel() default ConfigurationConstants.DEFAULT_MAX_PARALLEL;
-
-         @AttributeDefinition(name="Keep History",
-              description="If this option is enabled, successful finished jobs are kept "
+                name = "Priority",
+                description = "The priority for the threads used by this queue. Default is norm.",
+                options = {
+                    @Option(label = "Norm", value = "NORM"),
+                    @Option(label = "Min", value = "MIN"),
+                    @Option(label = "Max", value = "MAX")
+                })
+        String queue_priority() default ConfigurationConstants.DEFAULT_PRIORITY;
+
+        @AttributeDefinition(
+                name = "Maximum Retries",
+                description = "The maximum number of times a failed job slated "
+                        + "for retries is actually retried. If a job has been retried this number of "
+                        + "times and still fails, it is not rescheduled and assumed to have failed. The "
+                        + "default value is 10.")
+        int queue_retries() default ConfigurationConstants.DEFAULT_RETRIES;
+
+        @AttributeDefinition(
+                name = "Retry Delay",
+                description = "The number of milliseconds to sleep between two "
+                        + "consecutive retries of a job which failed and was set to be retried. The "
+                        + "default value is 2 seconds. This value is only relevant if there is a single "
+                        + "failed job in the queue. If there are multiple failed jobs, each job is "
+                        + "retried in turn without an intervening delay.")
+        long queue_retrydelay() default ConfigurationConstants.DEFAULT_RETRY_DELAY;
+
+        @AttributeDefinition(
+                name = "Maximum Parallel Jobs",
+                description =
+                        "The maximum number of parallel jobs started for this queue. "
+                                + "A value of -1 is substituted with the number of available processors. "
+                                + "Positive integer values specify number of processors to use.  Can be greater than number of processors. "
+                                + "A decimal number between 0.0 and 1.0 is treated as a fraction of available processors. "
+                                + "For example 0.5 means half of the available processors. For ordered queue types this value is ignored (always enforced to be 1).")
+        double queue_maxparallel() default ConfigurationConstants.DEFAULT_MAX_PARALLEL;
+
+        @AttributeDefinition(
+                name = "Keep History",
+                description = "If this option is enabled, successful finished jobs are kept "
                         + "to provide a complete history.")
-         boolean queue_keepJobs() default false;
+        boolean queue_keepJobs() default false;
 
-         @AttributeDefinition(name="Prefer Creation Instance",
-              description="If this option is enabled, the jobs are tried to "
+        @AttributeDefinition(
+                name = "Prefer Creation Instance",
+                description = "If this option is enabled, the jobs are tried to "
                         + "be run on the instance where the job was created.")
-         boolean queue_preferRunOnCreationInstance() default false;
+        boolean queue_preferRunOnCreationInstance() default false;
 
-         @AttributeDefinition(name="Thread Pool Size",
-                 description="Optional configuration value for a thread pool to be used by "
-                         + "this queue. If this is value has a positive number of threads configuration, this queue uses "
-                         + "an own thread pool with the configured number of threads.")
-         int queue_threadPoolSize() default 0;
+        @AttributeDefinition(
+                name = "Thread Pool Size",
+                description = "Optional configuration value for a thread pool to be used by "
+                        + "this queue. If this is value has a positive number of threads configuration, this queue uses "
+                        + "an own thread pool with the configured number of threads.")
+        int queue_threadPoolSize() default 0;
 
-         @AttributeDefinition(name="Ranking",
-              description="Integer value defining the ranking of this queue configuration. "
+        @AttributeDefinition(
+                name = "Ranking",
+                description = "Integer value defining the ranking of this queue configuration. "
                         + "If more than one queue matches a job topic, the one with the highest ranking is used.")
-         int service_ranking() default 0;
+        int service_ranking() default 0;
 
-         // Internal Name hint for web console.
-         String webconsole_configurationFactory_nameHint() default "Queue: {" + ConfigurationConstants.PROP_NAME + "}";
-
-     }
+        // Internal Name hint for web console.
+        String webconsole_configurationFactory_nameHint() default "Queue: {" + ConfigurationConstants.PROP_NAME + "}";
+    }
 
     /** Logger. */
     private final Logger logger = LoggerFactory.getLogger(this.getClass());
@@ -192,13 +204,13 @@ public class InternalQueueConfiguration
         this.name = config.queue_name();
         try {
             this.priority = ThreadPriority.valueOf(config.queue_priority());
-        } catch ( final IllegalArgumentException iae) {
+        } catch (final IllegalArgumentException iae) {
             logger.warn("Invalid value for queue priority. Using default instead of : {}", config.queue_priority());
             this.priority = ThreadPriority.valueOf(ConfigurationConstants.DEFAULT_PRIORITY);
         }
         try {
             this.type = Type.valueOf(config.queue_type());
-        } catch ( final IllegalArgumentException iae) {
+        } catch (final IllegalArgumentException iae) {
             logger.error("Invalid value for queue type configuration: {}", config.queue_type());
             this.type = null;
         }
@@ -222,18 +234,18 @@ public class InternalQueueConfiguration
                 this.maxParallelProcesses = (int) Math.round(cores * inMaxParallel);
             } else {
                 logger.warn("Invalid queue max parallel value for queue {}. Using {}", this.name, cores);
-                this.maxParallelProcesses =  cores;
+                this.maxParallelProcesses = cores;
             }
         }
         logger.debug("Thread pool size for {} was set to {}", this.name, this.maxParallelProcesses);
 
         // ignore parallel setting for ordered queues
-        if ( this.type == Type.ORDERED ) {
+        if (this.type == Type.ORDERED) {
             this.maxParallelProcesses = 1;
         }
         final String[] topicsParam = config.queue_topics();
         this.matchers = TopicMatcherHelper.buildMatchers(topicsParam);
-        if ( this.matchers == null ) {
+        if (this.matchers == null) {
             this.topics = null;
         } else {
             this.topics = topicsParam;
@@ -242,7 +254,7 @@ public class InternalQueueConfiguration
         this.serviceRanking = config.service_ranking();
         this.ownThreadPoolSize = config.queue_threadPoolSize();
         this.preferCreationInstance = config.queue_preferRunOnCreationInstance();
-        this.pid = (String)props.get(Constants.SERVICE_PID);
+        this.pid = (String) props.get(Constants.SERVICE_PID);
         this.valid = this.checkIsValid();
     }
 
@@ -251,28 +263,28 @@ public class InternalQueueConfiguration
      * If it is invalid, it is ignored.
      */
     private boolean checkIsValid() {
-        if ( type == null ) {
+        if (type == null) {
             return false;
         }
         boolean hasMatchers = false;
-        if ( this.matchers != null ) {
-            for(final TopicMatcher m : this.matchers ) {
-                if ( m != null ) {
+        if (this.matchers != null) {
+            for (final TopicMatcher m : this.matchers) {
+                if (m != null) {
                     hasMatchers = true;
                     break;
                 }
             }
         }
-        if ( !hasMatchers ) {
+        if (!hasMatchers) {
             return false;
         }
-        if ( name == null || name.length() == 0 ) {
+        if (name == null || name.length() == 0) {
             return false;
         }
-        if ( retries < -1 ) {
+        if (retries < -1) {
             return false;
         }
-        if ( maxParallelProcesses < 1 ) {
+        if (maxParallelProcesses < 1) {
             return false;
         }
         return true;
@@ -288,11 +300,11 @@ public class InternalQueueConfiguration
      * @return The queue name or <code>null</code>
      */
     public String match(final String topic) {
-        if ( this.matchers != null ) {
-            for(final TopicMatcher m : this.matchers ) {
-                if ( m != null ) {
+        if (this.matchers != null) {
+            for (final TopicMatcher m : this.matchers) {
+                if (m != null) {
                     final String rep = m.match(topic);
-                    if ( rep != null ) {
+                    if (rep != null) {
                         return this.name.replace("{0}", rep);
                     }
                 }
@@ -377,26 +389,26 @@ public class InternalQueueConfiguration
 
     @Override
     public String toString() {
-        return "Queue-Configuration(" + this.hashCode() + ") : {" +
-            "name=" + this.name +
-            ", type=" + this.type +
-            ", topics=" + (this.matchers == null ? "[]" : Arrays.toString(this.matchers)) +
-            ", maxParallelProcesses=" + this.maxParallelProcesses +
-            ", retries=" + this.retries +
-            ", retryDelayInMs=" + this.retryDelay +
-            ", keepJobs=" + this.keepJobs +
-            ", preferRunOnCreationInstance=" + this.preferCreationInstance +
-            ", ownThreadPoolSize=" + this.ownThreadPoolSize +
-            ", serviceRanking=" + this.serviceRanking +
-            ", pid=" + this.pid +
-            ", isValid=" + this.isValid() + "}";
+        return "Queue-Configuration(" + this.hashCode() + ") : {" + "name="
+                + this.name + ", type="
+                + this.type + ", topics="
+                + (this.matchers == null ? "[]" : Arrays.toString(this.matchers)) + ", maxParallelProcesses="
+                + this.maxParallelProcesses + ", retries="
+                + this.retries + ", retryDelayInMs="
+                + this.retryDelay + ", keepJobs="
+                + this.keepJobs + ", preferRunOnCreationInstance="
+                + this.preferCreationInstance + ", ownThreadPoolSize="
+                + this.ownThreadPoolSize + ", serviceRanking="
+                + this.serviceRanking + ", pid="
+                + this.pid + ", isValid="
+                + this.isValid() + "}";
     }
 
     @Override
     public int compareTo(final InternalQueueConfiguration other) {
-        if ( this.serviceRanking < other.serviceRanking ) {
+        if (this.serviceRanking < other.serviceRanking) {
             return 1;
-        } else if ( this.serviceRanking > other.serviceRanking ) {
+        } else if (this.serviceRanking > other.serviceRanking) {
             return -1;
         }
         return 0;
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/config/JobManagerConfiguration.java b/src/main/java/org/apache/sling/event/impl/jobs/config/JobManagerConfiguration.java
index 4064cc2..1cba173 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/config/JobManagerConfiguration.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/config/JobManagerConfiguration.java
@@ -18,6 +18,16 @@
  */
 package org.apache.sling.event.impl.jobs.config;
 
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Timer;
+import java.util.TimerTask;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicLong;
+
 import org.apache.sling.api.resource.LoginException;
 import org.apache.sling.api.resource.PersistenceException;
 import org.apache.sling.api.resource.ResourceResolver;
@@ -51,55 +61,56 @@ import org.osgi.service.metatype.annotations.ObjectClassDefinition;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Timer;
-import java.util.TimerTask;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicLong;
-
 /**
  * Configuration of the job handling
  *
  */
-@Component(immediate=true,
-           service=JobManagerConfiguration.class,
-           name="org.apache.sling.event.impl.jobs.jcr.PersistenceHandler",
-           property = {
-                   Constants.SERVICE_VENDOR + "=The Apache Software Foundation",
-                   JobManagerConfiguration.PROPERTY_REPOSITORY_PATH + "=" + JobManagerConfiguration.DEFAULT_REPOSITORY_PATH,
-                   JobManagerConfiguration.PROPERTY_SCHEDULED_JOBS_PATH + "=" + JobManagerConfiguration.DEFAULT_SCHEDULED_JOBS_PATH,
-                   JobManagerConfiguration.PROPERTY_BACKGROUND_LOAD_DELAY + ":Long=" + JobManagerConfiguration.DEFAULT_BACKGROUND_LOAD_DELAY
-})
+@Component(
+        immediate = true,
+        service = JobManagerConfiguration.class,
+        name = "org.apache.sling.event.impl.jobs.jcr.PersistenceHandler",
+        property = {
+            Constants.SERVICE_VENDOR + "=The Apache Software Foundation",
+            JobManagerConfiguration.PROPERTY_REPOSITORY_PATH + "=" + JobManagerConfiguration.DEFAULT_REPOSITORY_PATH,
+            JobManagerConfiguration.PROPERTY_SCHEDULED_JOBS_PATH + "="
+                    + JobManagerConfiguration.DEFAULT_SCHEDULED_JOBS_PATH,
+            JobManagerConfiguration.PROPERTY_BACKGROUND_LOAD_DELAY + ":Long="
+                    + JobManagerConfiguration.DEFAULT_BACKGROUND_LOAD_DELAY
+        })
 @Designate(ocd = JobManagerConfiguration.Config.class)
 public class JobManagerConfiguration {
 
-    @ObjectClassDefinition(name = "Apache Sling Job Manager",
-            description="This is the central service of the job handling.")
+    @ObjectClassDefinition(
+            name = "Apache Sling Job Manager",
+            description = "This is the central service of the job handling.")
     public @interface Config {
 
-        @AttributeDefinition(name = "Disable Distribution",
-        description="If the distribution is disabled, all jobs will be processed on the leader only! "
-                + "Please use this switch with care.")
+        @AttributeDefinition(
+                name = "Disable Distribution",
+                description = "If the distribution is disabled, all jobs will be processed on the leader only! "
+                        + "Please use this switch with care.")
         boolean job_consumermanager_disableDistribution() default false;
 
-        @AttributeDefinition(name = "Startup Delay",
-              description="Specify amount in seconds that job manager waits on startup before starting with job handling. "
-                        + "This can be used to allow enough time to restart a cluster before jobs are eventually reassigned.")
+        @AttributeDefinition(
+                name = "Startup Delay",
+                description =
+                        "Specify amount in seconds that job manager waits on startup before starting with job handling. "
+                                + "This can be used to allow enough time to restart a cluster before jobs are eventually reassigned.")
         long startup_delay() default 30;
 
-        @AttributeDefinition(name = "Clean-up removed jobs period",
-            description = "Specify the periodic interval in minutes (default is 48h - use 0 to disable) after which " +
-                    "removed jobs (ERROR or DROPPED) should be cleaned from the repository.")
+        @AttributeDefinition(
+                name = "Clean-up removed jobs period",
+                description =
+                        "Specify the periodic interval in minutes (default is 48h - use 0 to disable) after which "
+                                + "removed jobs (ERROR or DROPPED) should be cleaned from the repository.")
         int cleanup_period() default 2880;
 
-        @AttributeDefinition(name = "Progress Log message's max count",
-                description = "Max number of log messages that can stored by consumer to add information about current state of Job.\n" +
-                        "Any attempt to add more information would result into purging of the least recent messages." +
-                        "Use 0 to discard all the logs. default is -1 (to indicate infinite). ")
+        @AttributeDefinition(
+                name = "Progress Log message's max count",
+                description =
+                        "Max number of log messages that can stored by consumer to add information about current state of Job.\n"
+                                + "Any attempt to add more information would result into purging of the least recent messages."
+                                + "Use 0 to discard all the logs. default is -1 (to indicate infinite). ")
         int progresslog_maxCount() default -1;
     }
     /** Logger. */
@@ -126,9 +137,11 @@ public class JobManagerConfiguration {
     /** Configuration property for the scheduled jobs path. */
     public static final String PROPERTY_SCHEDULED_JOBS_PATH = "job.scheduled.jobs.path";
 
-    static JobManagerConfiguration newForTest(ResourceResolverFactory resourceResolverFactory,
+    static JobManagerConfiguration newForTest(
+            ResourceResolverFactory resourceResolverFactory,
             QueueConfigurationManager queueConfigurationManager,
-            Map<String, Object> activateProps, Config config) {
+            Map<String, Object> activateProps,
+            Config config) {
         final JobManagerConfiguration jobMgrConfig = new JobManagerConfiguration();
         jobMgrConfig.resourceResolverFactory = resourceResolverFactory;
         jobMgrConfig.queueConfigManager = queueConfigurationManager;
@@ -187,13 +200,13 @@ public class JobManagerConfiguration {
     @Reference
     private EnvironmentComponent environment;
 
-    @Reference(policyOption=ReferencePolicyOption.GREEDY)
+    @Reference(policyOption = ReferencePolicyOption.GREEDY)
     private ResourceResolverFactory resourceResolverFactory;
 
     @Reference
     private QueueConfigurationManager queueConfigManager;
 
-    @Reference(policyOption=ReferencePolicyOption.GREEDY)
+    @Reference(policyOption = ReferencePolicyOption.GREEDY)
     private ServiceUserMapped serviceUserMapped;
 
     /** Is this still active? */
@@ -210,11 +223,10 @@ public class JobManagerConfiguration {
      * @param condition The condition being bound
      */
     @Reference(
-        target = "(osgi.condition.id=true)",
-        cardinality = ReferenceCardinality.OPTIONAL,
-        policy = ReferencePolicy.DYNAMIC,
-        policyOption = ReferencePolicyOption.GREEDY
-    )
+            target = "(osgi.condition.id=true)",
+            cardinality = ReferenceCardinality.OPTIONAL,
+            policy = ReferencePolicy.DYNAMIC,
+            policyOption = ReferencePolicyOption.GREEDY)
     protected void bindJobProcessingEnabledCondition(final Condition condition) {
         if (this.jobProcessingEnabledCondition != null) {
             logger.warn("Job processing readiness condition already set - ignoring new condition");
@@ -261,8 +273,8 @@ public class JobManagerConfiguration {
     @Activate
     protected void activate(final Map<String, Object> props, final Config config) {
         this.update(props, config);
-        this.jobsBasePathWithSlash = PropertiesUtil.toString(props.get(PROPERTY_REPOSITORY_PATH),
-                DEFAULT_REPOSITORY_PATH) + '/';
+        this.jobsBasePathWithSlash =
+                PropertiesUtil.toString(props.get(PROPERTY_REPOSITORY_PATH), DEFAULT_REPOSITORY_PATH) + '/';
 
         // create initial resources
         this.assignedJobsPath = this.jobsBasePathWithSlash + "assigned";
@@ -277,8 +289,8 @@ public class JobManagerConfiguration {
         this.storedCancelledJobsPath = this.jobsBasePathWithSlash + "cancelled";
         this.storedSuccessfulJobsPath = this.jobsBasePathWithSlash + "finished";
 
-        this.scheduledJobsPath = PropertiesUtil.toString(props.get(PROPERTY_SCHEDULED_JOBS_PATH),
-            DEFAULT_SCHEDULED_JOBS_PATH);
+        this.scheduledJobsPath =
+                PropertiesUtil.toString(props.get(PROPERTY_SCHEDULED_JOBS_PATH), DEFAULT_SCHEDULED_JOBS_PATH);
         this.scheduledJobsPathWithSlash = this.scheduledJobsPath + "/";
 
         this.historyCleanUpRemovedJobs = config.cleanup_period();
@@ -288,7 +300,7 @@ public class JobManagerConfiguration {
         try {
             ResourceHelper.getOrCreateBasePath(resolver, this.getLocalJobsPath());
             ResourceHelper.getOrCreateBasePath(resolver, this.getUnassignedJobsPath());
-        } catch ( final PersistenceException pe ) {
+        } catch (final PersistenceException pe) {
             logger.error("Unable to create default paths: " + pe.getMessage(), pe);
             throw new RuntimeException(pe);
         } finally {
@@ -299,15 +311,19 @@ public class JobManagerConfiguration {
         // SLING-5560 : use an InitDelayingTopologyEventListener
         if (this.startupDelay > 0) {
             logger.debug("activate: job manager will start in {} sec. ({})", this.startupDelay, config.startup_delay());
-            this.startupDelayListener = new InitDelayingTopologyEventListener(startupDelay, new TopologyEventListener() {
+            this.startupDelayListener =
+                    new InitDelayingTopologyEventListener(startupDelay, new TopologyEventListener() {
 
-                @Override
-                public void handleTopologyEvent(TopologyEvent event) {
-                    doHandleTopologyEvent(event);
-                }
-            });
+                        @Override
+                        public void handleTopologyEvent(TopologyEvent event) {
+                            doHandleTopologyEvent(event);
+                        }
+                    });
         } else {
-            logger.debug("activate: job manager will start without delay. ({}:{})", config.startup_delay(), this.startupDelay);
+            logger.debug(
+                    "activate: job manager will start without delay. ({}:{})",
+                    config.startup_delay(),
+                    this.startupDelay);
         }
     }
 
@@ -317,7 +333,8 @@ public class JobManagerConfiguration {
     @Modified
     protected void update(final Map<String, Object> props, final Config config) {
         this.disabledDistribution = config.job_consumermanager_disableDistribution();
-        this.backgroundLoadDelay = PropertiesUtil.toLong(props.get(PROPERTY_BACKGROUND_LOAD_DELAY), DEFAULT_BACKGROUND_LOAD_DELAY);
+        this.backgroundLoadDelay =
+                PropertiesUtil.toLong(props.get(PROPERTY_BACKGROUND_LOAD_DELAY), DEFAULT_BACKGROUND_LOAD_DELAY);
         // SLING-5560: note that currently you can't change the startupDelay to have
         // an immediate effect - it will only have an effect on next activation.
         // (as 'startup delay runnable' is already scheduled in activate)
@@ -328,7 +345,6 @@ public class JobManagerConfiguration {
         } else {
             this.progressLogMaxCount = config.progresslog_maxCount();
         }
-
     }
 
     /**
@@ -337,7 +353,7 @@ public class JobManagerConfiguration {
     @Deactivate
     protected void deactivate() {
         this.active.set(false);
-        if ( this.startupDelayListener != null) {
+        if (this.startupDelayListener != null) {
             this.startupDelayListener.dispose();
             this.startupDelayListener = null;
         }
@@ -360,17 +376,17 @@ public class JobManagerConfiguration {
      * The resolver needs to be closed by the client.
      * This ResourceResolver provides read and write access to all resources relevant for the event
      * and job handling.
-     * 
+     *
      * @return A resource resolver or {@code null} if the component is already deactivated.
      * @throws RuntimeException if the resolver can't be created.
      */
     public ResourceResolver createResourceResolver() {
         ResourceResolver resolver = null;
         final ResourceResolverFactory factory = this.resourceResolverFactory;
-        if ( factory != null ) {
+        if (factory != null) {
             try {
                 resolver = this.resourceResolverFactory.getServiceResourceResolver(null);
-            } catch ( final LoginException le) {
+            } catch (final LoginException le) {
                 logger.error("Unable to create new resource resolver: " + le.getMessage(), le);
                 throw new RuntimeException(le);
             }
@@ -428,13 +444,11 @@ public class JobManagerConfiguration {
     /**
      * Create a unique job path (folder and name) for the job.
      */
-    public String getUniquePath(final String targetId,
-            final String topic,
-            final String jobId,
-            final Map<String, Object> jobProperties) {
+    public String getUniquePath(
+            final String targetId, final String topic, final String jobId, final Map<String, Object> jobProperties) {
         final String topicName = topic.replace('/', '.');
         final StringBuilder sb = new StringBuilder();
-        if ( targetId != null ) {
+        if (targetId != null) {
             sb.append(this.getAssginedJobsPath());
             sb.append('/');
             sb.append(targetId);
@@ -518,7 +532,7 @@ public class JobManagerConfiguration {
     public String getStoragePath(final String topic, final String jobId, final boolean isSuccess) {
         final String topicName = topic.replace('/', '.');
         final StringBuilder sb = new StringBuilder();
-        if ( isSuccess ) {
+        if (isSuccess) {
             sb.append(this.getStoredSuccessfulJobsPath());
         } else {
             sb.append(this.getStoredCancelledJobsPath());
@@ -529,7 +543,6 @@ public class JobManagerConfiguration {
         sb.append(jobId);
 
         return sb.toString();
-
     }
 
     /**
@@ -555,7 +568,7 @@ public class JobManagerConfiguration {
         logger.debug("Stopping job processing...");
         final TopologyCapabilities caps = this.topologyCapabilities;
 
-        if ( caps != null ) {
+        if (caps != null) {
             // deactivate old capabilities - this stops all background processes
             caps.deactivate();
             this.topologyCapabilities = null;
@@ -577,7 +590,7 @@ public class JobManagerConfiguration {
         this.topologyCapabilities = newCaps;
 
         // before we propagate the new topology we do some maintenance
-        if ( eventType == Type.TOPOLOGY_INIT ) {
+        if (eventType == Type.TOPOLOGY_INIT) {
             final UpgradeTask task = new UpgradeTask(this);
             task.run();
 
@@ -592,21 +605,22 @@ public class JobManagerConfiguration {
             // and run checker again in some seconds (if leader)
             // notify listeners afterwards
             final Timer timer = new Timer();
-            timer.schedule(new TimerTask()
-            {
-
-                @Override
-                public void run() {
-                    if ( newCaps == topologyCapabilities && newCaps.isActive()) {
-                        // start listeners
-                        notifyListeners();
-                        if ( newCaps.isLeader() && newCaps.isActive() ) {
-                            final CheckTopologyTask mt = new CheckTopologyTask(JobManagerConfiguration.this);
-                            mt.fullRun();
+            timer.schedule(
+                    new TimerTask() {
+
+                        @Override
+                        public void run() {
+                            if (newCaps == topologyCapabilities && newCaps.isActive()) {
+                                // start listeners
+                                notifyListeners();
+                                if (newCaps.isLeader() && newCaps.isActive()) {
+                                    final CheckTopologyTask mt = new CheckTopologyTask(JobManagerConfiguration.this);
+                                    mt.fullRun();
+                                }
+                            }
                         }
-                    }
-                }
-            }, this.backgroundLoadDelay * 1000);
+                    },
+                    this.backgroundLoadDelay * 1000);
         }
         logger.debug("Job processing started");
     }
@@ -615,9 +629,9 @@ public class JobManagerConfiguration {
      * Notify all listeners
      */
     private void notifyListeners() {
-        synchronized ( this.listeners ) {
+        synchronized (this.listeners) {
             final TopologyCapabilities caps = this.topologyCapabilities;
-            for(final ConfigurationChangeListener l : this.listeners) {
+            for (final ConfigurationChangeListener l : this.listeners) {
                 l.configurationChanged(caps != null);
             }
         }
@@ -629,7 +643,7 @@ public class JobManagerConfiguration {
      * @see org.apache.sling.discovery.TopologyEventListener#handleTopologyEvent(org.apache.sling.discovery.TopologyEvent)
      */
     public void handleTopologyEvent(TopologyEvent event) {
-        if ( this.startupDelayListener != null ) {
+        if (this.startupDelayListener != null) {
             // with startup.delay > 0
             this.startupDelayListener.handleTopologyEvent(event);
         } else {
@@ -644,9 +658,9 @@ public class JobManagerConfiguration {
         // check if there is a change of properties which doesn't affect us
         // but we need to use the new view !
         boolean stopProcessing = true;
-        if ( event.getType() == Type.PROPERTIES_CHANGED ) {
+        if (event.getType() == Type.PROPERTIES_CHANGED) {
             final Map<String, String> newAllInstances = TopologyCapabilities.getAllInstancesMap(event.getNewView());
-            if ( this.topologyCapabilities != null && this.topologyCapabilities.isSame(newAllInstances) ) {
+            if (this.topologyCapabilities != null && this.topologyCapabilities.isSame(newAllInstances)) {
                 logger.debug("No changes in capabilities - updating topology capabilities with new view");
                 stopProcessing = false;
             }
@@ -654,14 +668,14 @@ public class JobManagerConfiguration {
 
         final TopologyEvent.Type eventType = event.getType();
 
-        if ( eventType == Type.TOPOLOGY_CHANGING ) {
-           this.stopProcessing();
+        if (eventType == Type.TOPOLOGY_CHANGING) {
+            this.stopProcessing();
 
-        } else if ( eventType == Type.TOPOLOGY_INIT
-            || event.getType() == Type.TOPOLOGY_CHANGED
-            || event.getType() == Type.PROPERTIES_CHANGED ) {
+        } else if (eventType == Type.TOPOLOGY_INIT
+                || event.getType() == Type.TOPOLOGY_CHANGED
+                || event.getType() == Type.PROPERTIES_CHANGED) {
 
-            if ( stopProcessing ) {
+            if (stopProcessing) {
                 this.stopProcessing();
             }
 
@@ -674,7 +688,7 @@ public class JobManagerConfiguration {
      * @param service Listener to notify about changes.
      */
     public void addListener(final ConfigurationChangeListener service) {
-        synchronized ( this.listeners ) {
+        synchronized (this.listeners) {
             this.listeners.add(service);
             service.configurationChanged(this.topologyCapabilities != null);
         }
@@ -685,7 +699,7 @@ public class JobManagerConfiguration {
      * @param service Listener to notify about changes.
      */
     public void removeListener(final ConfigurationChangeListener service) {
-        synchronized ( this.listeners )  {
+        synchronized (this.listeners) {
             this.listeners.remove(service);
         }
     }
@@ -693,14 +707,14 @@ public class JobManagerConfiguration {
     private final Map<String, Job> retryList = new HashMap<>();
 
     public void addJobToRetryList(final Job job) {
-        synchronized ( retryList ) {
+        synchronized (retryList) {
             retryList.put(job.getId(), job);
         }
     }
 
     public List<Job> clearJobRetryList() {
         final List<Job> result = new ArrayList<>();
-        synchronized ( this.retryList ) {
+        synchronized (this.retryList) {
             result.addAll(retryList.values());
             retryList.clear();
         }
@@ -708,13 +722,13 @@ public class JobManagerConfiguration {
     }
 
     public boolean removeJobFromRetryList(final Job job) {
-        synchronized ( retryList ) {
+        synchronized (retryList) {
             return retryList.remove(job.getId()) != null;
         }
     }
 
     public Job getJobFromRetryList(final String jobId) {
-        synchronized ( retryList ) {
+        synchronized (retryList) {
             return retryList.get(jobId);
         }
     }
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/config/MainQueueConfiguration.java b/src/main/java/org/apache/sling/event/impl/jobs/config/MainQueueConfiguration.java
index 3bcc120..000954a 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/config/MainQueueConfiguration.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/config/MainQueueConfiguration.java
@@ -32,50 +32,52 @@ import org.osgi.service.metatype.annotations.Option;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-
 /**
  * This is the configuration for the main queue.
  *
  */
-@Component(name="org.apache.sling.event.impl.jobs.DefaultJobManager",
-           service=MainQueueConfiguration.class,
-           property={
-                   Constants.SERVICE_VENDOR + "=The Apache Software Foundation"
-           })
-@Designate(ocd=MainQueueConfiguration.Config.class)
+@Component(
+        name = "org.apache.sling.event.impl.jobs.DefaultJobManager",
+        service = MainQueueConfiguration.class,
+        property = {Constants.SERVICE_VENDOR + "=The Apache Software Foundation"})
+@Designate(ocd = MainQueueConfiguration.Config.class)
 public class MainQueueConfiguration {
 
-    @ObjectClassDefinition(name = "Apache Sling Job Default Queue",
-           description="The configuration of the default job queue.")
+    @ObjectClassDefinition(
+            name = "Apache Sling Job Default Queue",
+            description = "The configuration of the default job queue.")
     public @interface Config {
 
         @AttributeDefinition(
-                name="Priority",
-                description="The priority for the threads used by this queue. Default is norm.",
+                name = "Priority",
+                description = "The priority for the threads used by this queue. Default is norm.",
                 options = {
-                        @Option(label="Norm",value="NORM"),
-                        @Option(label="Min",value="MIN"),
-                        @Option(label="Max",value="MAX")
+                    @Option(label = "Norm", value = "NORM"),
+                    @Option(label = "Min", value = "MIN"),
+                    @Option(label = "Max", value = "MAX")
                 })
         String queue_priority() default ConfigurationConstants.DEFAULT_PRIORITY;
 
-        @AttributeDefinition(name="Maximum Retries",
-              description="The maximum number of times a failed job slated "
+        @AttributeDefinition(
+                name = "Maximum Retries",
+                description = "The maximum number of times a failed job slated "
                         + "for retries is actually retried. If a job has been retried this number of "
                         + "times and still fails, it is not rescheduled and assumed to have failed. The "
                         + "default value is 10.")
         int queue_retries() default ConfigurationConstants.DEFAULT_RETRIES;
 
-        @AttributeDefinition(name="Retry Delay",
-              description="The number of milliseconds to sleep between two "
+        @AttributeDefinition(
+                name = "Retry Delay",
+                description = "The number of milliseconds to sleep between two "
                         + "consecutive retries of a job which failed and was set to be retried. The "
                         + "default value is 2 seconds. This value is only relevant if there is a single "
                         + "failed job in the queue. If there are multiple failed jobs, each job is "
                         + "retried in turn without an intervening delay.")
         long queue_retrydelay() default ConfigurationConstants.DEFAULT_RETRY_DELAY;
 
-        @AttributeDefinition(name="Maximum Parallel Jobs",
-              description="The maximum number of parallel jobs started for this queue. "
+        @AttributeDefinition(
+                name = "Maximum Parallel Jobs",
+                description = "The maximum number of parallel jobs started for this queue. "
                         + "A value of -1 is substituted with the number of available processors.")
         int queue_maxparallel() default ConfigurationConstants.DEFAULT_MAX_PARALLEL;
     }
@@ -104,74 +106,75 @@ public class MainQueueConfiguration {
     protected void update(final Config config) {
         logger.debug("properties for queue {}: {}", MAIN_QUEUE_NAME, config);
         this.mainConfiguration = InternalQueueConfiguration.fromConfiguration(
-                Collections.singletonMap(Constants.SERVICE_PID, (Object)"org.apache.sling.event.impl.jobs.DefaultJobManager"),
+                Collections.singletonMap(
+                        Constants.SERVICE_PID, (Object) "org.apache.sling.event.impl.jobs.DefaultJobManager"),
                 new InternalQueueConfiguration.Config() {
 
-            @Override
-            public Class<? extends Annotation> annotationType() {
-                return InternalQueueConfiguration.Config.class;
-            }
-
-            @Override
-            public int service_ranking() {
-                return 0;
-            }
-
-            @Override
-            public String queue_type() {
-                return InternalQueueConfiguration.Type.UNORDERED.name();
-            }
-
-            @Override
-            public String[] queue_topics() {
-                return new String[] {"*"};
-            }
-
-            @Override
-            public int queue_threadPoolSize() {
-                return 0;
-            }
-
-            @Override
-            public long queue_retrydelay() {
-                return config.queue_retrydelay();
-            }
-
-            @Override
-            public int queue_retries() {
-                return config.queue_retries();
-            }
-
-            @Override
-            public String queue_priority() {
-                return config.queue_priority();
-            }
-
-            @Override
-            public boolean queue_preferRunOnCreationInstance() {
-                return false;
-            }
-
-            @Override
-            public String queue_name() {
-                return MAIN_QUEUE_NAME;
-            }
-
-            @Override
-            public double queue_maxparallel() {
-                return config.queue_maxparallel();
-            }
-
-            @Override
-            public boolean queue_keepJobs() {
-                return false;
-            }
-
-            @Override
-            public String webconsole_configurationFactory_nameHint() {
-                return "Queue: {" + ConfigurationConstants.PROP_NAME + "}";
-            }
-        });
+                    @Override
+                    public Class<? extends Annotation> annotationType() {
+                        return InternalQueueConfiguration.Config.class;
+                    }
+
+                    @Override
+                    public int service_ranking() {
+                        return 0;
+                    }
+
+                    @Override
+                    public String queue_type() {
+                        return InternalQueueConfiguration.Type.UNORDERED.name();
+                    }
+
+                    @Override
+                    public String[] queue_topics() {
+                        return new String[] {"*"};
+                    }
+
+                    @Override
+                    public int queue_threadPoolSize() {
+                        return 0;
+                    }
+
+                    @Override
+                    public long queue_retrydelay() {
+                        return config.queue_retrydelay();
+                    }
+
+                    @Override
+                    public int queue_retries() {
+                        return config.queue_retries();
+                    }
+
+                    @Override
+                    public String queue_priority() {
+                        return config.queue_priority();
+                    }
+
+                    @Override
+                    public boolean queue_preferRunOnCreationInstance() {
+                        return false;
+                    }
+
+                    @Override
+                    public String queue_name() {
+                        return MAIN_QUEUE_NAME;
+                    }
+
+                    @Override
+                    public double queue_maxparallel() {
+                        return config.queue_maxparallel();
+                    }
+
+                    @Override
+                    public boolean queue_keepJobs() {
+                        return false;
+                    }
+
+                    @Override
+                    public String webconsole_configurationFactory_nameHint() {
+                        return "Queue: {" + ConfigurationConstants.PROP_NAME + "}";
+                    }
+                });
     }
 
     /**
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/config/QueueConfigurationManager.java b/src/main/java/org/apache/sling/event/impl/jobs/config/QueueConfigurationManager.java
index 753568b..c99bf37 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/config/QueueConfigurationManager.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/config/QueueConfigurationManager.java
@@ -29,14 +29,12 @@ import org.osgi.service.component.annotations.Reference;
 import org.osgi.service.component.annotations.ReferenceCardinality;
 import org.osgi.service.component.annotations.ReferencePolicy;
 
-
 /**
  * The queue manager manages queue configurations.
  */
-@Component(service = QueueConfigurationManager.class,
-property = {
-        Constants.SERVICE_VENDOR + "=The Apache Software Foundation"
-})
+@Component(
+        service = QueueConfigurationManager.class,
+        property = {Constants.SERVICE_VENDOR + "=The Apache Software Foundation"})
 public class QueueConfigurationManager {
 
     /** Empty configuration array. */
@@ -56,11 +54,13 @@ public class QueueConfigurationManager {
      * Add a new queue configuration.
      * @param config A new queue configuration.
      */
-    @Reference(service=InternalQueueConfiguration.class, policy=ReferencePolicy.DYNAMIC,
-            cardinality=ReferenceCardinality.MULTIPLE,
-            updated="updateConfig")
+    @Reference(
+            service = InternalQueueConfiguration.class,
+            policy = ReferencePolicy.DYNAMIC,
+            cardinality = ReferenceCardinality.MULTIPLE,
+            updated = "updateConfig")
     protected void bindConfig(final InternalQueueConfiguration config) {
-        synchronized ( configurations ) {
+        synchronized (configurations) {
             configurations.add(config);
             this.createConfigurationCache();
         }
@@ -71,7 +71,7 @@ public class QueueConfigurationManager {
      * @param config The queue configuration.
      */
     protected void unbindConfig(final InternalQueueConfiguration config) {
-        synchronized ( configurations ) {
+        synchronized (configurations) {
             configurations.remove(config);
             this.createConfigurationCache();
         }
@@ -84,7 +84,7 @@ public class QueueConfigurationManager {
     protected void updateConfig(final InternalQueueConfiguration config) {
         // InternalQueueConfiguration does not implement modified atm,
         // but we handle this case anyway
-        synchronized ( configurations ) {
+        synchronized (configurations) {
             this.createConfigurationCache();
         }
     }
@@ -93,7 +93,7 @@ public class QueueConfigurationManager {
      * Create the configurations cache used by clients.
      */
     private void createConfigurationCache() {
-        if ( this.configurations.isEmpty() ) {
+        if (this.configurations.isEmpty()) {
             this.orderedConfigs = EMPTY_CONFIGS;
         } else {
             Collections.sort(configurations);
@@ -134,11 +134,11 @@ public class QueueConfigurationManager {
 
         @Override
         public boolean equals(final Object obj) {
-            if ( obj == this ) {
+            if (obj == this) {
                 return true;
             }
-            if ( obj instanceof QueueInfo ) {
-                return ((QueueInfo)obj).queueName.equals(this.queueName);
+            if (obj instanceof QueueInfo) {
+                return ((QueueInfo) obj).queueName.equals(this.queueName);
             }
             return false;
         }
@@ -150,10 +150,10 @@ public class QueueConfigurationManager {
      */
     public QueueInfo getQueueInfo(final String topic) {
         final InternalQueueConfiguration[] configurations = this.getConfigurations();
-        for(final InternalQueueConfiguration config : configurations) {
-            if ( config.isValid() ) {
+        for (final InternalQueueConfiguration config : configurations) {
+            if (config.isValid()) {
                 final String qn = config.match(topic);
-                if ( qn != null ) {
+                if (qn != null) {
                     final QueueInfo result = new QueueInfo();
                     result.queueConfiguration = config;
                     result.queueName = ResourceHelper.filterName(qn);
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/config/TopologyCapabilities.java b/src/main/java/org/apache/sling/event/impl/jobs/config/TopologyCapabilities.java
index 75532fb..f338716 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/config/TopologyCapabilities.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/config/TopologyCapabilities.java
@@ -75,28 +75,29 @@ public class TopologyCapabilities {
 
         private final String localClusterId;
 
-
         public InstanceDescriptionComparator(final String clusterId) {
             this.localClusterId = clusterId;
         }
 
         @Override
         public int compare(final InstanceDescription o1, final InstanceDescription o2) {
-            if ( o1.getSlingId().equals(o2.getSlingId()) ) {
+            if (o1.getSlingId().equals(o2.getSlingId())) {
                 return 0;
             }
-            final boolean o1IsLocalCluster = localClusterId.equals(o1.getClusterView().getId());
-            final boolean o2IsLocalCluster = localClusterId.equals(o2.getClusterView().getId());
-            if ( o1IsLocalCluster && !o2IsLocalCluster ) {
+            final boolean o1IsLocalCluster =
+                    localClusterId.equals(o1.getClusterView().getId());
+            final boolean o2IsLocalCluster =
+                    localClusterId.equals(o2.getClusterView().getId());
+            if (o1IsLocalCluster && !o2IsLocalCluster) {
                 return -1;
             }
-            if ( !o1IsLocalCluster && o2IsLocalCluster ) {
+            if (!o1IsLocalCluster && o2IsLocalCluster) {
                 return 1;
             }
-            if ( o1IsLocalCluster ) {
-                if ( o1.isLeader() && !o2.isLeader() ) {
+            if (o1IsLocalCluster) {
+                if (o1.isLeader() && !o2.isLeader()) {
                     return -1;
-                } else if ( o2.isLeader() && !o1.isLeader() ) {
+                } else if (o2.isLeader() && !o1.isLeader()) {
                     return 1;
                 }
             }
@@ -107,9 +108,9 @@ public class TopologyCapabilities {
     public static Map<String, String> getAllInstancesMap(final TopologyView view) {
         final Map<String, String> allInstances = new TreeMap<String, String>();
 
-        for(final InstanceDescription desc : view.getInstances() ) {
+        for (final InstanceDescription desc : view.getInstances()) {
             final String topics = desc.getProperty(PROPERTY_TOPICS);
-            if ( topics != null && topics.length() > 0 ) {
+            if (topics != null && topics.length() > 0) {
                 allInstances.put(desc.getSlingId(), topics);
             } else {
                 allInstances.put(desc.getSlingId(), "");
@@ -123,20 +124,20 @@ public class TopologyCapabilities {
      * @param view The new view
      * @param config The current job manager configuration.
      */
-    public TopologyCapabilities(final TopologyView view,
-            final JobManagerConfiguration config) {
+    public TopologyCapabilities(final TopologyView view, final JobManagerConfiguration config) {
         this.jobManagerConfiguration = config;
-        this.instanceComparator = new InstanceDescriptionComparator(view.getLocalInstance().getClusterView().getId());
+        this.instanceComparator = new InstanceDescriptionComparator(
+                view.getLocalInstance().getClusterView().getId());
         this.isLeader = view.getLocalInstance().isLeader();
         this.allInstances = getAllInstancesMap(view);
         final Map<String, List<InstanceDescription>> newCaps = new HashMap<String, List<InstanceDescription>>();
-        for(final InstanceDescription desc : view.getInstances() ) {
+        for (final InstanceDescription desc : view.getInstances()) {
             final String topics = desc.getProperty(PROPERTY_TOPICS);
-            if ( topics != null && topics.length() > 0 ) {
+            if (topics != null && topics.length() > 0) {
                 this.logger.debug("Detected capabilities of {} : {}", desc.getSlingId(), topics);
-                for(final String topic : topics.split(",") ) {
+                for (final String topic : topics.split(",")) {
                     List<InstanceDescription> list = newCaps.get(topic);
-                    if ( list == null ) {
+                    if (list == null) {
                         list = new ArrayList<InstanceDescription>();
                         newCaps.put(topic, list);
                     }
@@ -194,16 +195,16 @@ public class TopologyCapabilities {
      * Add instances to the list if not already included
      */
     private void addAll(final List<InstanceDescription> potentialTargets, final List<InstanceDescription> newTargets) {
-        if ( newTargets != null ) {
-            for(final InstanceDescription desc : newTargets) {
+        if (newTargets != null) {
+            for (final InstanceDescription desc : newTargets) {
                 boolean found = false;
-                for(final InstanceDescription existingDesc : potentialTargets) {
-                    if ( desc.getSlingId().equals(existingDesc.getSlingId()) ) {
+                for (final InstanceDescription existingDesc : potentialTargets) {
+                    if (desc.getSlingId().equals(existingDesc.getSlingId())) {
                         found = true;
                         break;
                     }
                 }
-                if ( !found ) {
+                if (!found) {
                     potentialTargets.add(desc);
                 }
             }
@@ -223,7 +224,7 @@ public class TopologyCapabilities {
 
         // second: category targets - handling the topic category
         int pos = jobTopic.lastIndexOf('/');
-        if ( pos > 0 ) {
+        if (pos > 0) {
             final String category = jobTopic.substring(0, pos + 1).concat("*");
             addAll(potentialTargets, this.instanceCapabilities.get(category));
 
@@ -233,7 +234,7 @@ public class TopologyCapabilities {
                 addAll(potentialTargets, this.instanceCapabilities.get(subCategory));
 
                 pos = jobTopic.lastIndexOf('/', pos - 1);
-            } while ( pos > 0 );
+            } while (pos > 0);
         }
         Collections.sort(potentialTargets, this.instanceComparator);
 
@@ -243,52 +244,55 @@ public class TopologyCapabilities {
     /**
      * Detect the target instance.
      */
-    public String detectTarget(final String jobTopic, final Map<String, Object> jobProperties,
-            final QueueInfo queueInfo) {
+    public String detectTarget(
+            final String jobTopic, final Map<String, Object> jobProperties, final QueueInfo queueInfo) {
         final List<InstanceDescription> potentialTargets = this.getPotentialTargets(jobTopic);
         logger.debug("Potential targets for {} : {}", jobTopic, potentialTargets);
         String createdOn = null;
-        if ( jobProperties != null ) {
+        if (jobProperties != null) {
             createdOn = (String) jobProperties.get(org.apache.sling.event.jobs.Job.PROPERTY_JOB_CREATED_INSTANCE);
         }
-        if ( createdOn == null ) {
+        if (createdOn == null) {
             createdOn = Environment.APPLICATION_ID;
         }
         final InstanceDescription createdOnInstance = this.instanceMap.get(createdOn);
 
-        if ( potentialTargets != null && potentialTargets.size() > 0 ) {
-            if ( createdOnInstance != null ) {
+        if (potentialTargets != null && potentialTargets.size() > 0) {
+            if (createdOnInstance != null) {
                 // create a list with local targets first.
                 final List<InstanceDescription> localTargets = new ArrayList<InstanceDescription>();
-                for(final InstanceDescription desc : potentialTargets) {
-                    if ( desc.getClusterView().getId().equals(createdOnInstance.getClusterView().getId()) ) {
-                        if ( !this.jobManagerConfiguration.disableDistribution() || desc.isLeader() ) {
+                for (final InstanceDescription desc : potentialTargets) {
+                    if (desc.getClusterView()
+                            .getId()
+                            .equals(createdOnInstance.getClusterView().getId())) {
+                        if (!this.jobManagerConfiguration.disableDistribution() || desc.isLeader()) {
                             localTargets.add(desc);
                         }
                     }
                 }
-                if ( localTargets.size() > 0 ) {
+                if (localTargets.size() > 0) {
                     potentialTargets.clear();
                     potentialTargets.addAll(localTargets);
                     logger.debug("Potential targets filtered for {} : {}", jobTopic, potentialTargets);
                 }
             }
             // check prefer run on creation instance
-            if ( queueInfo.queueConfiguration.isPreferRunOnCreationInstance() ) {
+            if (queueInfo.queueConfiguration.isPreferRunOnCreationInstance()) {
                 InstanceDescription creationDesc = null;
-                for(final InstanceDescription desc : potentialTargets) {
-                    if ( desc.getSlingId().equals(createdOn) ) {
+                for (final InstanceDescription desc : potentialTargets) {
+                    if (desc.getSlingId().equals(createdOn)) {
                         creationDesc = desc;
                         break;
                     }
                 }
-                if ( creationDesc != null ) {
+                if (creationDesc != null) {
                     potentialTargets.clear();
                     potentialTargets.add(creationDesc);
-                    logger.debug("Potential targets reduced to creation instance for {} : {}", jobTopic, potentialTargets);
+                    logger.debug(
+                            "Potential targets reduced to creation instance for {} : {}", jobTopic, potentialTargets);
                 }
             }
-            if ( queueInfo.queueConfiguration.getType() == QueueConfiguration.Type.ORDERED ) {
+            if (queueInfo.queueConfiguration.getType() == QueueConfiguration.Type.ORDERED) {
                 // for ordered queues we always pick the first as we have to pick the same target on each cluster view
                 // on all instances (TODO - we could try to do some round robin of the whole queue)
                 final String result = potentialTargets.get(0).getSlingId();
@@ -299,10 +303,10 @@ public class TopologyCapabilities {
             // TODO - this is a simple round robin which is not based on the actual load
             //        of the instances
             Integer index = this.roundRobinMap.get(jobTopic);
-            if ( index == null ) {
+            if (index == null) {
                 index = 0;
             }
-            if ( index >= potentialTargets.size() ) {
+            if (index >= potentialTargets.size()) {
                 index = 0;
             }
             this.roundRobinMap.put(jobTopic, index + 1);
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/config/TopologyHandler.java b/src/main/java/org/apache/sling/event/impl/jobs/config/TopologyHandler.java
index 58da224..b922f87 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/config/TopologyHandler.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/config/TopologyHandler.java
@@ -36,10 +36,9 @@ import org.slf4j.LoggerFactory;
  * This topology handler is handling the topology change events asynchronously
  * and processes them by queuing them.
  */
-@Component(service = TopologyEventListener.class,
-    property = {
-            Constants.SERVICE_VENDOR + "=The Apache Software Foundation"
-    })
+@Component(
+        service = TopologyEventListener.class,
+        property = {Constants.SERVICE_VENDOR + "=The Apache Software Foundation"})
 public class TopologyHandler implements TopologyEventListener, Runnable {
 
     /** The logger. */
@@ -69,7 +68,7 @@ public class TopologyHandler implements TopologyEventListener, Runnable {
         this.queue.clear();
         try {
             this.queue.put(new QueueItem());
-        } catch ( final InterruptedException ie) {
+        } catch (final InterruptedException ie) {
             logger.warn("Thread got interrupted.", ie);
             Thread.currentThread().interrupt();
         }
@@ -81,7 +80,7 @@ public class TopologyHandler implements TopologyEventListener, Runnable {
         item.event = event;
         try {
             this.queue.put(item);
-        } catch ( final InterruptedException ie) {
+        } catch (final InterruptedException ie) {
             logger.warn("Thread got interrupted.", ie);
             Thread.currentThread().interrupt();
         }
@@ -89,18 +88,18 @@ public class TopologyHandler implements TopologyEventListener, Runnable {
 
     @Override
     public void run() {
-        while ( isActive.get() ) {
+        while (isActive.get()) {
             QueueItem item = null;
             try {
                 item = this.queue.take();
-            } catch ( final InterruptedException ie) {
+            } catch (final InterruptedException ie) {
                 logger.warn("Thread got interrupted.", ie);
                 Thread.currentThread().interrupt();
                 isActive.set(false);
             }
-            if ( isActive.get() && item != null && item.event != null ) {
+            if (isActive.get() && item != null && item.event != null) {
                 final JobManagerConfiguration config = this.configuration;
-                if ( config != null ) {
+                if (config != null) {
                     config.handleTopologyEvent(item.event);
                 }
             }
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/console/InventoryPlugin.java b/src/main/java/org/apache/sling/event/impl/jobs/console/InventoryPlugin.java
index 9f345c0..46b27b6 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/console/InventoryPlugin.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/console/InventoryPlugin.java
@@ -52,15 +52,16 @@ import org.osgi.service.component.annotations.Reference;
  * and the configurations.
  * @since 3.2
  */
-@Component(service={InventoryPrinter.class},
-    property = {
-        Constants.SERVICE_VENDOR + "=The Apache Software Foundation",
-        InventoryPrinter.NAME + "=slingjobs",
-        InventoryPrinter.TITLE + "=Sling Jobs",
-        InventoryPrinter.FORMAT + "=TEXT",
-        InventoryPrinter.FORMAT + "=JSON",
-        InventoryPrinter.WEBCONSOLE + ":Boolean=false"
-})
+@Component(
+        service = {InventoryPrinter.class},
+        property = {
+            Constants.SERVICE_VENDOR + "=The Apache Software Foundation",
+            InventoryPrinter.NAME + "=slingjobs",
+            InventoryPrinter.TITLE + "=Sling Jobs",
+            InventoryPrinter.FORMAT + "=TEXT",
+            InventoryPrinter.FORMAT + "=JSON",
+            InventoryPrinter.WEBCONSOLE + ":Boolean=false"
+        })
 public class InventoryPlugin implements InventoryPrinter {
 
     @Reference
@@ -76,17 +77,20 @@ public class InventoryPlugin implements InventoryPrinter {
      * Format an array.
      */
     private String formatArrayAsText(final String[] array) {
-        if ( array == null || array.length == 0 ) {
+        if (array == null || array.length == 0) {
             return "";
         }
         return Arrays.toString(array);
     }
 
     private String formatType(final QueueConfiguration.Type type) {
-        switch ( type ) {
-            case ORDERED : return "Ordered";
-            case TOPIC_ROUND_ROBIN : return "Topic Round Robin";
-            case UNORDERED : return "Parallel";
+        switch (type) {
+            case ORDERED:
+                return "Ordered";
+            case TOPIC_ROUND_ROBIN:
+                return "Topic Round Robin";
+            case UNORDERED:
+                return "Parallel";
         }
         return type.toString();
     }
@@ -98,7 +102,7 @@ public class InventoryPlugin implements InventoryPrinter {
      * Format a date
      */
     private synchronized String formatDate(final long time) {
-        if ( time == -1 ) {
+        if (time == -1) {
             return "-";
         }
         final Date d = new Date(time);
@@ -109,12 +113,12 @@ public class InventoryPlugin implements InventoryPrinter {
      * Format time (= duration)
      */
     private String formatTime(final long time) {
-        if ( time == 0 ) {
+        if (time == 0) {
             return "-";
         }
-        if ( time < 1000 ) {
+        if (time < 1000) {
             return time + " ms";
-        } else if ( time < 1000 * 60 ) {
+        } else if (time < 1000 * 60) {
             return time / 1000 + " secs";
         }
         final long min = time / 1000 / 60;
@@ -127,9 +131,9 @@ public class InventoryPlugin implements InventoryPrinter {
      */
     @Override
     public void print(final PrintWriter pw, final Format format, final boolean isZip) {
-        if ( format.equals(Format.TEXT) ) {
+        if (format.equals(Format.TEXT)) {
             printText(pw);
-        } else if ( format.equals(Format.JSON) ) {
+        } else if (format.equals(Format.JSON)) {
             printJson(pw);
         }
     }
@@ -139,7 +143,7 @@ public class InventoryPlugin implements InventoryPrinter {
         pw.println("-------------------------");
 
         String topics = this.jobConsumerManager.getTopics();
-        if ( topics == null ) {
+        if (topics == null) {
             topics = "";
         }
 
@@ -162,17 +166,17 @@ public class InventoryPlugin implements InventoryPrinter {
 
         pw.println("Topology Capabilities");
         final TopologyCapabilities cap = this.configuration.getTopologyCapabilities();
-        if ( cap == null ) {
+        if (cap == null) {
             pw.print("No topology information available !");
         } else {
             final Map<String, List<InstanceDescription>> instanceCaps = cap.getInstanceCapabilities();
-            for(final Map.Entry<String, List<InstanceDescription>> entry : instanceCaps.entrySet()) {
+            for (final Map.Entry<String, List<InstanceDescription>> entry : instanceCaps.entrySet()) {
                 final StringBuilder sb = new StringBuilder();
-                for(final InstanceDescription id : entry.getValue()) {
-                    if ( sb.length() > 0 ) {
+                for (final InstanceDescription id : entry.getValue()) {
+                    if (sb.length() > 0) {
                         sb.append(", ");
                     }
-                    if ( id.isLocal() ) {
+                    if (id.isLocal()) {
                         sb.append("local");
                     } else {
                         sb.append(id.getSlingId());
@@ -185,33 +189,43 @@ public class InventoryPlugin implements InventoryPrinter {
 
         pw.println("Scheduled Jobs");
         final Collection<ScheduledJobInfo> infos = this.jobManager.getScheduledJobs();
-        if ( infos.size() == 0 ) {
+        if (infos.size() == 0) {
             pw.print("No jobs currently scheduled");
         } else {
-            for(final ScheduledJobInfo info : infos) {
+            for (final ScheduledJobInfo info : infos) {
                 pw.println("Schedule");
                 pw.printf("Job Topic< : %s%n", info.getJobTopic());
                 pw.print("Schedules : ");
                 boolean first = true;
-                for(final ScheduleInfo si : info.getSchedules() ) {
-                    if ( !first ) {
+                for (final ScheduleInfo si : info.getSchedules()) {
+                    if (!first) {
                         pw.print(", ");
                     }
                     first = false;
-                    switch ( si.getType() ) {
-                    case YEARLY : pw.printf("YEARLY %s %s : %s:%s", si.getMonthOfYear(), si.getDayOfMonth(), si.getHourOfDay(), si.getMinuteOfHour());
-                                  break;
-                    case MONTHLY : pw.printf("MONTHLY %s : %s:%s", si.getDayOfMonth(), si.getHourOfDay(), si.getMinuteOfHour());
-                                  break;
-                    case WEEKLY : pw.printf("WEEKLY %s : %s:%s", si.getDayOfWeek(), si.getHourOfDay(), si.getMinuteOfHour());
-                                  break;
-                    case DAILY : pw.printf("DAILY %s:%s", si.getHourOfDay(), si.getMinuteOfHour());
-                                 break;
-                    case HOURLY : pw.printf("HOURLY %s", si.getMinuteOfHour());
-                                 break;
-                    case CRON : pw.printf("CRON %s", si.getExpression());
-                                 break;
-                    default : pw.printf("AT %s", si.getAt());
+                    switch (si.getType()) {
+                        case YEARLY:
+                            pw.printf(
+                                    "YEARLY %s %s : %s:%s",
+                                    si.getMonthOfYear(), si.getDayOfMonth(), si.getHourOfDay(), si.getMinuteOfHour());
+                            break;
+                        case MONTHLY:
+                            pw.printf(
+                                    "MONTHLY %s : %s:%s", si.getDayOfMonth(), si.getHourOfDay(), si.getMinuteOfHour());
+                            break;
+                        case WEEKLY:
+                            pw.printf("WEEKLY %s : %s:%s", si.getDayOfWeek(), si.getHourOfDay(), si.getMinuteOfHour());
+                            break;
+                        case DAILY:
+                            pw.printf("DAILY %s:%s", si.getHourOfDay(), si.getMinuteOfHour());
+                            break;
+                        case HOURLY:
+                            pw.printf("HOURLY %s", si.getMinuteOfHour());
+                            break;
+                        case CRON:
+                            pw.printf("CRON %s", si.getExpression());
+                            break;
+                        default:
+                            pw.printf("AT %s", si.getAt());
                     }
                 }
                 pw.println();
@@ -221,10 +235,9 @@ public class InventoryPlugin implements InventoryPrinter {
         pw.println();
 
         boolean isEmpty = true;
-        for(final Queue q : this.jobManager.getQueues()) {
+        for (final Queue q : this.jobManager.getQueues()) {
             isEmpty = false;
-            pw.printf("Active JobQueue: %s %s%n", q.getName(),
-                    q.isSuspended() ? "(SUSPENDED)" : "");
+            pw.printf("Active JobQueue: %s %s%n", q.getName(), q.isSuspended() ? "(SUSPENDED)" : "");
 
             s = q.getStatistics();
             final QueueConfiguration c = q.getConfiguration();
@@ -251,12 +264,12 @@ public class InventoryPlugin implements InventoryPrinter {
             pw.printf("Priority : %s%n", c.getThreadPriority());
             pw.println();
         }
-        if ( isEmpty ) {
+        if (isEmpty) {
             pw.println("No active queues.");
             pw.println();
         }
 
-        for(final TopicStatistics ts : this.jobManager.getTopicStatistics()) {
+        for (final TopicStatistics ts : this.jobManager.getTopicStatistics()) {
             pw.printf("Topic Statistics - %s%n", ts.getTopic());
             pw.printf("Last Activated : %s%n", formatDate(ts.getLastActivatedJobTime()));
             pw.printf("Last Finished : %s%n", formatDate(ts.getLastFinishedJobTime()));
@@ -271,16 +284,17 @@ public class InventoryPlugin implements InventoryPrinter {
 
         pw.println("Apache Sling Job Handling - Job Queue Configurations");
         pw.println("----------------------------------------------------");
-        this.printQueueConfiguration(pw, this.configuration.getQueueConfigurationManager().getMainQueueConfiguration());
-        final InternalQueueConfiguration[] configs = this.configuration.getQueueConfigurationManager().getConfigurations();
-        for(final InternalQueueConfiguration c : configs ) {
+        this.printQueueConfiguration(
+                pw, this.configuration.getQueueConfigurationManager().getMainQueueConfiguration());
+        final InternalQueueConfiguration[] configs =
+                this.configuration.getQueueConfigurationManager().getConfigurations();
+        for (final InternalQueueConfiguration c : configs) {
             this.printQueueConfiguration(pw, c);
         }
     }
 
     private void printQueueConfiguration(final PrintWriter pw, final InternalQueueConfiguration c) {
-        pw.printf("Job Queue Configuration: %s%n",
-                c.getName());
+        pw.printf("Job Queue Configuration: %s%n", c.getName());
         pw.printf("Valid : %s%n", c.isValid());
         pw.printf("Type : %s%n", formatType(c.getType()));
         pw.printf("Topics : %s%n", formatArrayAsText(c.getTopics()));
@@ -317,16 +331,17 @@ public class InventoryPlugin implements InventoryPrinter {
         pw.print("  }");
 
         final TopologyCapabilities cap = this.configuration.getTopologyCapabilities();
-        if ( cap != null ) {
+        if (cap != null) {
             pw.println(",");
             pw.println("  \"capabilities\" : [");
             final Map<String, List<InstanceDescription>> instanceCaps = cap.getInstanceCapabilities();
-            final Iterator<Map.Entry<String, List<InstanceDescription>>> iter = instanceCaps.entrySet().iterator();
-            while ( iter.hasNext() ) {
+            final Iterator<Map.Entry<String, List<InstanceDescription>>> iter =
+                    instanceCaps.entrySet().iterator();
+            while (iter.hasNext()) {
                 final Map.Entry<String, List<InstanceDescription>> entry = iter.next();
                 final List<String> instances = new ArrayList<>();
-                for(final InstanceDescription id : entry.getValue()) {
-                    if ( id.isLocal() ) {
+                for (final InstanceDescription id : entry.getValue()) {
+                    if (id.isLocal()) {
                         instances.add("local");
                     } else {
                         instances.add(id.getSlingId());
@@ -334,8 +349,10 @@ public class InventoryPlugin implements InventoryPrinter {
                 }
                 pw.println("    {");
                 pw.printf("       \"topic\" : \"%s\",%n", entry.getKey());
-                pw.printf("       \"instances\" : %s%n", formatArrayAsJson(instances.toArray(new String[instances.size()])));
-                if ( iter.hasNext() ) {
+                pw.printf(
+                        "       \"instances\" : %s%n",
+                        formatArrayAsJson(instances.toArray(new String[instances.size()])));
+                if (iter.hasNext()) {
                     pw.println("    },");
                 } else {
                     pw.println("    }");
@@ -346,9 +363,9 @@ public class InventoryPlugin implements InventoryPrinter {
 
         boolean first = true;
         final Collection<ScheduledJobInfo> infos = this.jobManager.getScheduledJobs();
-        for(final ScheduledJobInfo info : infos) {
+        for (final ScheduledJobInfo info : infos) {
             pw.println(",");
-            if ( first ) {
+            if (first) {
                 pw.println("  \"scheduledJobs\" : [");
                 first = false;
             }
@@ -357,41 +374,44 @@ public class InventoryPlugin implements InventoryPrinter {
             pw.printf("      \"jobTopic\" : \"%s\",%n", info.getJobTopic());
             pw.println("      \"schedules\" : [");
             boolean internalFirst = true;
-            for(final ScheduleInfo si : info.getSchedules() ) {
-                if ( !internalFirst ) {
+            for (final ScheduleInfo si : info.getSchedules()) {
+                if (!internalFirst) {
                     pw.println(", ");
                 }
                 internalFirst = false;
                 pw.println("        {");
-                switch ( si.getType() ) {
-                    case YEARLY :
+                switch (si.getType()) {
+                    case YEARLY:
                         pw.printf("          \"type\" : \"%s\",%n", "YEARLY");
-                        pw.printf("          \"schedule\" : \"%s %s : %s:%s\"%n", si.getMonthOfYear(),
-                                si.getDayOfMonth(), si.getHourOfDay(), si.getMinuteOfHour());
+                        pw.printf(
+                                "          \"schedule\" : \"%s %s : %s:%s\"%n",
+                                si.getMonthOfYear(), si.getDayOfMonth(), si.getHourOfDay(), si.getMinuteOfHour());
                         break;
-                    case MONTHLY :
+                    case MONTHLY:
                         pw.printf("          \"type\" : \"%s\",%n", "MONTHLY");
-                        pw.printf("          \"schedule\" : \"%s : %s:%s\"%n", si.getDayOfMonth(), si.getHourOfDay(),
-                                si.getMinuteOfHour());
+                        pw.printf(
+                                "          \"schedule\" : \"%s : %s:%s\"%n",
+                                si.getDayOfMonth(), si.getHourOfDay(), si.getMinuteOfHour());
                         break;
-                    case WEEKLY :
+                    case WEEKLY:
                         pw.printf("          \"type\" : \"%s\",%n", "WEEKLY");
-                        pw.printf("          \"schedule\" : \"%s : %s:%s\"%n", si.getDayOfWeek(), si.getHourOfDay(),
-                                si.getMinuteOfHour());
+                        pw.printf(
+                                "          \"schedule\" : \"%s : %s:%s\"%n",
+                                si.getDayOfWeek(), si.getHourOfDay(), si.getMinuteOfHour());
                         break;
-                    case DAILY :
+                    case DAILY:
                         pw.printf("          \"type\" : \"%s\",%n", "DAILY");
                         pw.printf("          \"schedule\" : \"%s:%s\"%n", si.getHourOfDay(), si.getMinuteOfHour());
                         break;
-                    case HOURLY :
+                    case HOURLY:
                         pw.printf("          \"type\" : \"%s\",%n", "HOURLY");
                         pw.printf("          \"schedule\" : \"%s\"%n", si.getMinuteOfHour());
                         break;
-                    case CRON :
+                    case CRON:
                         pw.printf("          \"type\" : \"%s\",%n", "CRON");
                         pw.printf("          \"schedule\" : \"%s\"%n", si.getExpression());
                         break;
-                    default :
+                    default:
                         pw.printf("          \"type\" : \"%s\",%n", "AT");
                         pw.printf("          \"schedule\" : \"%s\"%n", si.getAt());
                 }
@@ -401,14 +421,14 @@ public class InventoryPlugin implements InventoryPrinter {
             pw.println("      ]");
             pw.println("    }");
         }
-        if ( !first ) {
+        if (!first) {
             pw.print("  ]");
         }
 
         first = true;
-        for(final Queue q : this.jobManager.getQueues()) {
+        for (final Queue q : this.jobManager.getQueues()) {
             pw.println(",");
-            if ( first ) {
+            if (first) {
                 pw.println("  \"queues\" : [");
                 first = false;
             }
@@ -449,14 +469,14 @@ public class InventoryPlugin implements InventoryPrinter {
             pw.println("      }");
             pw.print("    }");
         }
-        if ( !first ) {
+        if (!first) {
             pw.print("  ]");
         }
 
         first = true;
-        for(final TopicStatistics ts : this.jobManager.getTopicStatistics()) {
+        for (final TopicStatistics ts : this.jobManager.getTopicStatistics()) {
             pw.println(",");
-            if ( first ) {
+            if (first) {
                 pw.println("  \"topicStatistics\" : [");
                 first = false;
             }
@@ -476,15 +496,17 @@ public class InventoryPlugin implements InventoryPrinter {
             pw.printf("      \"averageWaitingTimeText\" : \"%s\"%n", formatTime(ts.getAverageWaitingTime()));
             pw.print("    }");
         }
-        if ( !first ) {
+        if (!first) {
             pw.print("  ]");
         }
 
         pw.println(",");
         pw.println("  \"configurations\" : [");
-        this.printQueueConfigurationJson(pw, this.configuration.getQueueConfigurationManager().getMainQueueConfiguration());
-        final InternalQueueConfiguration[] configs = this.configuration.getQueueConfigurationManager().getConfigurations();
-        for(final InternalQueueConfiguration c : configs ) {
+        this.printQueueConfigurationJson(
+                pw, this.configuration.getQueueConfigurationManager().getMainQueueConfiguration());
+        final InternalQueueConfiguration[] configs =
+                this.configuration.getQueueConfigurationManager().getConfigurations();
+        for (final InternalQueueConfiguration c : configs) {
             pw.println(",");
             this.printQueueConfigurationJson(pw, c);
         }
@@ -511,13 +533,13 @@ public class InventoryPlugin implements InventoryPrinter {
      * Format an array.
      */
     private String formatArrayAsJson(final String[] array) {
-        if ( array == null || array.length == 0 ) {
+        if (array == null || array.length == 0) {
             return "[]";
         }
         final StringBuilder sb = new StringBuilder("[");
         boolean first = true;
-        for(final String s : array) {
-            if ( !first ) {
+        for (final String s : array) {
+            if (!first) {
                 sb.append(", ");
             }
             first = false;
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/console/WebConsolePlugin.java b/src/main/java/org/apache/sling/event/impl/jobs/console/WebConsolePlugin.java
index 558ee7a..62f5a7f 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/console/WebConsolePlugin.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/console/WebConsolePlugin.java
@@ -18,6 +18,11 @@
  */
 package org.apache.sling.event.impl.jobs.console;
 
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.net.URLEncoder;
@@ -28,11 +33,6 @@ import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
 import org.apache.sling.api.request.ResponseUtil;
 import org.apache.sling.discovery.InstanceDescription;
 import org.apache.sling.event.impl.jobs.JobConsumerManager;
@@ -59,14 +59,15 @@ import org.slf4j.LoggerFactory;
  * and the configurations.
  * @since 3.0
  */
-@Component(service={javax.servlet.Servlet.class, JobConsumer.class},
-property = {
-    Constants.SERVICE_VENDOR + "=The Apache Software Foundation",
-    "felix.webconsole.label=slingevent",
-    "felix.webconsole.title=Jobs",
-    "felix.webconsole.category=Sling",
-    JobConsumer.PROPERTY_TOPICS + "=sling/webconsole/test"
-})
+@Component(
+        service = {javax.servlet.Servlet.class, JobConsumer.class},
+        property = {
+            Constants.SERVICE_VENDOR + "=The Apache Software Foundation",
+            "felix.webconsole.label=slingevent",
+            "felix.webconsole.title=Jobs",
+            "felix.webconsole.category=Sling",
+            JobConsumer.PROPERTY_TOPICS + "=sling/webconsole/test"
+        })
 public class WebConsolePlugin extends HttpServlet implements JobConsumer {
 
     private static final String SLING_WEBCONSOLE_TEST_JOB_TOPIC = "sling/webconsole/test";
@@ -88,9 +89,9 @@ public class WebConsolePlugin extends HttpServlet implements JobConsumer {
 
     private Queue getQueue(final HttpServletRequest req) {
         final String name = req.getParameter(PAR_QUEUE);
-        if ( name != null ) {
-            for(final Queue q : this.jobManager.getQueues()) {
-                if ( name.equals(q.getName()) ) {
+        if (name != null) {
+            for (final Queue q : this.jobManager.getQueues()) {
+                if (name.equals(q.getName())) {
                     return q;
                 }
             }
@@ -100,7 +101,7 @@ public class WebConsolePlugin extends HttpServlet implements JobConsumer {
 
     private String getQueueErrorMessage(final HttpServletRequest req, final String command) {
         final String name = req.getParameter(PAR_QUEUE);
-        if ( name == null || name.length() == 0 ) {
+        if (name == null || name.length() == 0) {
             return "Queue parameter missing for operation " + command;
         }
         return "Queue with name '" + name + "' not found for operation " + command;
@@ -108,39 +109,40 @@ public class WebConsolePlugin extends HttpServlet implements JobConsumer {
 
     @Override
     protected void doPost(final HttpServletRequest req, final HttpServletResponse resp)
-    throws ServletException, IOException {
+            throws ServletException, IOException {
         String msg = null;
         final String cmd = req.getParameter("action");
-        if ( "suspend".equals(cmd) ) {
+        if ("suspend".equals(cmd)) {
             final Queue q = this.getQueue(req);
-            if ( q != null ) {
+            if (q != null) {
                 q.suspend();
             } else {
                 msg = this.getQueueErrorMessage(req, "suspend");
             }
-        } else if ( "resume".equals(cmd) ) {
+        } else if ("resume".equals(cmd)) {
             final Queue q = this.getQueue(req);
-            if ( q != null ) {
+            if (q != null) {
                 q.resume();
             } else {
                 msg = this.getQueueErrorMessage(req, "resume");
             }
-        } else if ( "reset".equals(cmd) ) {
-            if ( req.getParameter(PAR_QUEUE) == null || req.getParameter(PAR_QUEUE).length() == 0 ) {
+        } else if ("reset".equals(cmd)) {
+            if (req.getParameter(PAR_QUEUE) == null
+                    || req.getParameter(PAR_QUEUE).length() == 0) {
                 this.jobManager.getStatistics().reset();
             } else {
                 final Queue q = this.getQueue(req);
-                if ( q != null ) {
+                if (q != null) {
                     q.getStatistics().reset();
                 } else {
                     msg = this.getQueueErrorMessage(req, "reset");
                 }
             }
-        } else if ( "test".equals(cmd) ) {
+        } else if ("test".equals(cmd)) {
             this.startTestJob();
-        } else if ( "dropall".equals(cmd) ) {
+        } else if ("dropall".equals(cmd)) {
             final Queue q = this.getQueue(req);
-            if ( q != null ) {
+            if (q != null) {
                 q.removeAll();
             } else {
                 msg = this.getQueueErrorMessage(req, "drop all");
@@ -150,7 +152,7 @@ public class WebConsolePlugin extends HttpServlet implements JobConsumer {
         }
         final String path = req.getContextPath() + req.getServletPath() + req.getPathInfo();
         final String redirectTo;
-        if ( msg == null ) {
+        if (msg == null) {
             redirectTo = path;
         } else {
             redirectTo = path + "?message=" + URLEncoder.encode(msg, "UTF-8");
@@ -165,22 +167,21 @@ public class WebConsolePlugin extends HttpServlet implements JobConsumer {
 
     @Override
     protected void doGet(final HttpServletRequest req, final HttpServletResponse res)
-     throws ServletException, IOException {
+            throws ServletException, IOException {
         final String msg = req.getParameter("message");
         final PrintWriter pw = res.getWriter();
 
-        pw.println("<form method='POST' name='eventingcmd'>" +
-        		     "<input type='hidden' name='action' value=''/>"+
-                     "<input type='hidden' name='queue' value=''/>" +
-                   "</form>");
+        pw.println("<form method='POST' name='eventingcmd'>" + "<input type='hidden' name='action' value=''/>"
+                + "<input type='hidden' name='queue' value=''/>"
+                + "</form>");
         pw.println("<script type='text/javascript'>");
-        pw.println("function eventingsubmit(action, queue) {" +
-                   " document.forms['eventingcmd'].action.value = action;" +
-                   " document.forms['eventingcmd'].queue.value = queue;" +
-                   " document.forms['eventingcmd'].submit();" +
-                   "} </script>");
+        pw.println("function eventingsubmit(action, queue) {" + " document.forms['eventingcmd'].action.value = action;"
+                + " document.forms['eventingcmd'].queue.value = queue;"
+                + " document.forms['eventingcmd'].submit();"
+                + "} </script>");
 
-        pw.printf("<p class='statline ui-state-highlight'>Apache Sling Job Handling%s%n</p>",
+        pw.printf(
+                "<p class='statline ui-state-highlight'>Apache Sling Job Handling%s%n</p>",
                 msg != null ? " : " + ResponseUtil.escapeXml(msg) : "");
         pw.println("<div class='ui-widget-header ui-corner-top buttonGroup'>");
         pw.println("<span style='float: left; margin-left: 1em'>Apache Sling Job Handling: Overall Statistics</span>");
@@ -189,14 +190,14 @@ public class WebConsolePlugin extends HttpServlet implements JobConsumer {
 
         pw.println("<table class='nicetable'><tbody>");
         String topics = this.jobConsumerManager.getTopics();
-        if ( topics == null ) {
+        if (topics == null) {
             topics = "";
         } else {
             final String[] allTopics = topics.split(",");
             final StringBuilder sb = new StringBuilder();
             boolean first = true;
-            for(final String t : allTopics) {
-                if ( first) {
+            for (final String t : allTopics) {
+                if (first) {
                     first = false;
                 } else {
                     sb.append("<br/>");
@@ -225,17 +226,17 @@ public class WebConsolePlugin extends HttpServlet implements JobConsumer {
         pw.println("<table class='nicetable'><tbody>");
         pw.println("<tr><th colspan='2'>Topology Capabilities</th></tr>");
         final TopologyCapabilities cap = this.configuration.getTopologyCapabilities();
-        if ( cap == null ) {
+        if (cap == null) {
             pw.print("<tr><td colspan='2'>No topology information available !</td></tr>");
         } else {
             final Map<String, List<InstanceDescription>> instanceCaps = cap.getInstanceCapabilities();
-            for(final Map.Entry<String, List<InstanceDescription>> entry : instanceCaps.entrySet()) {
+            for (final Map.Entry<String, List<InstanceDescription>> entry : instanceCaps.entrySet()) {
                 final StringBuilder sb = new StringBuilder();
-                for(final InstanceDescription id : entry.getValue()) {
-                    if ( sb.length() > 0 ) {
+                for (final InstanceDescription id : entry.getValue()) {
+                    if (sb.length() > 0) {
                         sb.append("<br/>");
                     }
-                    if ( id.isLocal() ) {
+                    if (id.isLocal()) {
                         sb.append("<b>local</b>");
                     } else {
                         sb.append(ResponseUtil.escapeXml(id.getSlingId()));
@@ -250,34 +251,45 @@ public class WebConsolePlugin extends HttpServlet implements JobConsumer {
         pw.println("<p class='statline'>Scheduled Jobs</p>");
         pw.println("<table class='nicetable'><tbody>");
         final Collection<ScheduledJobInfo> infos = this.jobManager.getScheduledJobs();
-        if ( infos.size() == 0 ) {
+        if (infos.size() == 0) {
             pw.print("<tr><td colspan='5'>No jobs currently scheduled.</td></tr>");
         } else {
             pw.println("<tr><th>Schedule</th><th>Job Topic</th><th>Schedules</th></tr>");
             int index = 1;
-            for(final ScheduledJobInfo info : infos) {
-                pw.printf("<tr><td><b>%s</b></td><td>%s</td><td>",
+            for (final ScheduledJobInfo info : infos) {
+                pw.printf(
+                        "<tr><td><b>%s</b></td><td>%s</td><td>",
                         String.valueOf(index), ResponseUtil.escapeXml(info.getJobTopic()));
                 boolean first = true;
-                for(final ScheduleInfo si : info.getSchedules() ) {
-                    if ( !first ) {
+                for (final ScheduleInfo si : info.getSchedules()) {
+                    if (!first) {
                         pw.print("<br/>");
                     }
                     first = false;
-                    switch ( si.getType() ) {
-                    case YEARLY : pw.printf("YEARLY %s %s : %s:%s", si.getMonthOfYear(), si.getDayOfMonth(), si.getHourOfDay(), si.getMinuteOfHour());
-                                  break;
-                    case MONTHLY : pw.printf("MONTHLY %s : %s:%s", si.getDayOfMonth(), si.getHourOfDay(), si.getMinuteOfHour());
-                                  break;
-                    case WEEKLY : pw.printf("WEEKLY %s : %s:%s", si.getDayOfWeek(), si.getHourOfDay(), si.getMinuteOfHour());
-                                  break;
-                    case DAILY : pw.printf("DAILY %s:%s", si.getHourOfDay(), si.getMinuteOfHour());
-                                 break;
-                    case HOURLY : pw.printf("HOURLY %s", si.getMinuteOfHour());
-                                 break;
-                    case CRON : pw.printf("CRON %s", ResponseUtil.escapeXml(si.getExpression()));
-                                  break;
-                    default : pw.printf("AT %s", si.getAt());
+                    switch (si.getType()) {
+                        case YEARLY:
+                            pw.printf(
+                                    "YEARLY %s %s : %s:%s",
+                                    si.getMonthOfYear(), si.getDayOfMonth(), si.getHourOfDay(), si.getMinuteOfHour());
+                            break;
+                        case MONTHLY:
+                            pw.printf(
+                                    "MONTHLY %s : %s:%s", si.getDayOfMonth(), si.getHourOfDay(), si.getMinuteOfHour());
+                            break;
+                        case WEEKLY:
+                            pw.printf("WEEKLY %s : %s:%s", si.getDayOfWeek(), si.getHourOfDay(), si.getMinuteOfHour());
+                            break;
+                        case DAILY:
+                            pw.printf("DAILY %s:%s", si.getHourOfDay(), si.getMinuteOfHour());
+                            break;
+                        case HOURLY:
+                            pw.printf("HOURLY %s", si.getMinuteOfHour());
+                            break;
+                        case CRON:
+                            pw.printf("CRON %s", ResponseUtil.escapeXml(si.getExpression()));
+                            break;
+                        default:
+                            pw.printf("AT %s", si.getAt());
                     }
                 }
                 pw.print("</td></tr>");
@@ -288,14 +300,15 @@ public class WebConsolePlugin extends HttpServlet implements JobConsumer {
         pw.println("<br/>");
 
         boolean isEmpty = true;
-        for(final Queue q : this.jobManager.getQueues()) {
+        for (final Queue q : this.jobManager.getQueues()) {
             isEmpty = false;
             final String queueName = q.getName();
             pw.println("<div class='ui-widget-header ui-corner-top buttonGroup'>");
-            pw.printf("<span style='float: left; margin-left: 1em'>Active JobQueue: %s %s</span>", ResponseUtil.escapeXml(queueName),
-                    q.isSuspended() ? "(SUSPENDED)" : "");
+            pw.printf(
+                    "<span style='float: left; margin-left: 1em'>Active JobQueue: %s %s</span>",
+                    ResponseUtil.escapeXml(queueName), q.isSuspended() ? "(SUSPENDED)" : "");
             this.printForm(pw, queueName, "Reset Stats", "reset");
-            if ( q.isSuspended() ) {
+            if (q.isSuspended()) {
                 this.printForm(pw, queueName, "Resume", "resume");
             } else {
                 this.printForm(pw, queueName, "Suspend", "suspend");
@@ -308,28 +321,50 @@ public class WebConsolePlugin extends HttpServlet implements JobConsumer {
             s = q.getStatistics();
             final QueueConfiguration c = q.getConfiguration();
             pw.println("<tr><th colspan='2'>Statistics</th><th colspan='2'>Configuration</th></tr>");
-            pw.printf("<tr><td>Start Time</td><td>%s</td><td>Type</td><td>%s</td></tr>", formatDate(s.getStartTime()), formatType(c.getType()));
-            pw.printf("<tr><td>Last Activated</td><td>%s</td><td>Topics</td><td>%s</td></tr>", formatDate(s.getLastActivatedJobTime()), formatArray(c.getTopics()));
-            pw.printf("<tr><td>Last Finished</td><td>%s</td><td>Max Parallel</td><td>%s</td></tr>", formatDate(s.getLastFinishedJobTime()), c.getMaxParallel());
-            pw.printf("<tr><td>Queued Jobs</td><td>%s</td><td>Max Retries</td><td>%s</td></tr>", s.getNumberOfQueuedJobs(), c.getMaxRetries());
-            pw.printf("<tr><td>Active Jobs</td><td>%s</td><td>Retry Delay</td><td>%s ms</td></tr>", s.getNumberOfActiveJobs(), c.getRetryDelayInMs());
-            pw.printf("<tr><td>Jobs</td><td>%s</td><td>Priority</td><td>%s</td></tr>", s.getNumberOfJobs(), c.getThreadPriority());
-            pw.printf("<tr><td>Finished Jobs</td><td>%s</td><td colspan='2'>&nbsp</td></tr>", s.getNumberOfFinishedJobs());
+            pw.printf(
+                    "<tr><td>Start Time</td><td>%s</td><td>Type</td><td>%s</td></tr>",
+                    formatDate(s.getStartTime()), formatType(c.getType()));
+            pw.printf(
+                    "<tr><td>Last Activated</td><td>%s</td><td>Topics</td><td>%s</td></tr>",
+                    formatDate(s.getLastActivatedJobTime()), formatArray(c.getTopics()));
+            pw.printf(
+                    "<tr><td>Last Finished</td><td>%s</td><td>Max Parallel</td><td>%s</td></tr>",
+                    formatDate(s.getLastFinishedJobTime()), c.getMaxParallel());
+            pw.printf(
+                    "<tr><td>Queued Jobs</td><td>%s</td><td>Max Retries</td><td>%s</td></tr>",
+                    s.getNumberOfQueuedJobs(), c.getMaxRetries());
+            pw.printf(
+                    "<tr><td>Active Jobs</td><td>%s</td><td>Retry Delay</td><td>%s ms</td></tr>",
+                    s.getNumberOfActiveJobs(), c.getRetryDelayInMs());
+            pw.printf(
+                    "<tr><td>Jobs</td><td>%s</td><td>Priority</td><td>%s</td></tr>",
+                    s.getNumberOfJobs(), c.getThreadPriority());
+            pw.printf(
+                    "<tr><td>Finished Jobs</td><td>%s</td><td colspan='2'>&nbsp</td></tr>",
+                    s.getNumberOfFinishedJobs());
             pw.printf("<tr><td>Failed Jobs</td><td>%s</td><td colspan='2'>&nbsp</td></tr>", s.getNumberOfFailedJobs());
-            pw.printf("<tr><td>Cancelled Jobs</td><td>%s</td><td colspan='2'>&nbsp</td></tr>", s.getNumberOfCancelledJobs());
-            pw.printf("<tr><td>Processed Jobs</td><td>%s</td><td colspan='2'>&nbsp</td></tr>", s.getNumberOfProcessedJobs());
-            pw.printf("<tr><td>Average Processing Time</td><td>%s</td><td colspan='2'>&nbsp</td></tr>", formatTime(s.getAverageProcessingTime()));
-            pw.printf("<tr><td>Average Waiting Time</td><td>%s</td><td colspan='2'>&nbsp</td></tr>", formatTime(s.getAverageWaitingTime()));
+            pw.printf(
+                    "<tr><td>Cancelled Jobs</td><td>%s</td><td colspan='2'>&nbsp</td></tr>",
+                    s.getNumberOfCancelledJobs());
+            pw.printf(
+                    "<tr><td>Processed Jobs</td><td>%s</td><td colspan='2'>&nbsp</td></tr>",
+                    s.getNumberOfProcessedJobs());
+            pw.printf(
+                    "<tr><td>Average Processing Time</td><td>%s</td><td colspan='2'>&nbsp</td></tr>",
+                    formatTime(s.getAverageProcessingTime()));
+            pw.printf(
+                    "<tr><td>Average Waiting Time</td><td>%s</td><td colspan='2'>&nbsp</td></tr>",
+                    formatTime(s.getAverageWaitingTime()));
             pw.printf("<tr><td>Status Info</td><td colspan='3'>%s</td></tr>", ResponseUtil.escapeXml(q.getStateInfo()));
             pw.println("</tbody></table>");
             pw.println("<br/>");
         }
-        if ( isEmpty ) {
+        if (isEmpty) {
             pw.println("<p>No active queues.</p>");
             pw.println("<br/>");
         }
 
-        for(final TopicStatistics ts : this.jobManager.getTopicStatistics()) {
+        for (final TopicStatistics ts : this.jobManager.getTopicStatistics()) {
             pw.println("<table class='nicetable'><tbody>");
             pw.printf("<tr><th colspan='2'>Topic Statistics: %s</th></tr>", ResponseUtil.escapeXml(ts.getTopic()));
 
@@ -339,25 +374,31 @@ public class WebConsolePlugin extends HttpServlet implements JobConsumer {
             pw.printf("<tr><td>Failed Jobs</td><td>%s</td></tr>", ts.getNumberOfFailedJobs());
             pw.printf("<tr><td>Cancelled Jobs</td><td>%s</td></tr>", ts.getNumberOfCancelledJobs());
             pw.printf("<tr><td>Processed Jobs</td><td>%s</td></tr>", ts.getNumberOfProcessedJobs());
-            pw.printf("<tr><td>Average Processing Time</td><td>%s</td></tr>", formatTime(ts.getAverageProcessingTime()));
+            pw.printf(
+                    "<tr><td>Average Processing Time</td><td>%s</td></tr>", formatTime(ts.getAverageProcessingTime()));
             pw.printf("<tr><td>Average Waiting Time</td><td>%s</td></tr>", formatTime(ts.getAverageWaitingTime()));
             pw.println("</tbody></table>");
             pw.println("<br/>");
         }
 
         pw.println("<p class='statline'>Apache Sling Job Handling - Job Queue Configurations</p>");
-        this.printQueueConfiguration(req, pw, this.configuration.getQueueConfigurationManager().getMainQueueConfiguration());
-        final InternalQueueConfiguration[] configs = this.configuration.getQueueConfigurationManager().getConfigurations();
-        for(final InternalQueueConfiguration c : configs ) {
+        this.printQueueConfiguration(
+                req, pw, this.configuration.getQueueConfigurationManager().getMainQueueConfiguration());
+        final InternalQueueConfiguration[] configs =
+                this.configuration.getQueueConfigurationManager().getConfigurations();
+        for (final InternalQueueConfiguration c : configs) {
             this.printQueueConfiguration(req, pw, c);
         }
     }
 
-    private void printQueueConfiguration(final HttpServletRequest req, final PrintWriter pw, final InternalQueueConfiguration c) {
+    private void printQueueConfiguration(
+            final HttpServletRequest req, final PrintWriter pw, final InternalQueueConfiguration c) {
         pw.println("<div class='ui-widget-header ui-corner-top buttonGroup'>");
-        pw.printf("<span style='float: left; margin-left: 1em'>Job Queue Configuration: %s</span>%n",
+        pw.printf(
+                "<span style='float: left; margin-left: 1em'>Job Queue Configuration: %s</span>%n",
                 ResponseUtil.escapeXml(c.getName()));
-        pw.printf("<button id='edit' class='ui-state-default ui-corner-all' onclick='javascript:window.location=\"%s%s/configMgr/%s\";'>Edit</button>",
+        pw.printf(
+                "<button id='edit' class='ui-state-default ui-corner-all' onclick='javascript:window.location=\"%s%s/configMgr/%s\";'>Edit</button>",
                 req.getContextPath(), req.getServletPath(), c.getPid());
         this.printForm(pw, c.getName(), "Test", "test");
 
@@ -381,13 +422,13 @@ public class WebConsolePlugin extends HttpServlet implements JobConsumer {
      * Format an array for html rendering.
      */
     private String formatArray(final String[] array) {
-        if ( array == null || array.length == 0 ) {
+        if (array == null || array.length == 0) {
             return "";
         }
         final StringBuilder sb = new StringBuilder();
         boolean first = true;
-        for(final String s : array ) {
-            if ( !first ) {
+        for (final String s : array) {
+            if (!first) {
                 sb.append('\n');
             }
             first = false;
@@ -397,10 +438,13 @@ public class WebConsolePlugin extends HttpServlet implements JobConsumer {
     }
 
     private String formatType(final QueueConfiguration.Type type) {
-        switch ( type ) {
-            case ORDERED : return "Ordered";
-            case TOPIC_ROUND_ROBIN : return "Topic Round Robin";
-            case UNORDERED : return "Parallel";
+        switch (type) {
+            case ORDERED:
+                return "Ordered";
+            case TOPIC_ROUND_ROBIN:
+                return "Topic Round Robin";
+            case UNORDERED:
+                return "Parallel";
         }
         return type.toString();
     }
@@ -411,7 +455,7 @@ public class WebConsolePlugin extends HttpServlet implements JobConsumer {
      * Format a date
      */
     private synchronized String formatDate(final long time) {
-        if ( time == -1 ) {
+        if (time == -1) {
             return "-";
         }
         final Date d = new Date(time);
@@ -422,12 +466,12 @@ public class WebConsolePlugin extends HttpServlet implements JobConsumer {
      * Format time (= duration)
      */
     private String formatTime(final long time) {
-        if ( time == 0 ) {
+        if (time == 0) {
             return "-";
         }
-        if ( time < 1000 ) {
+        if (time < 1000) {
             return time + " ms";
-        } else if ( time < 1000 * 60 ) {
+        } else if (time < 1000 * 60) {
             return time / 1000 + " secs";
         }
         final long min = time / 1000 / 60;
@@ -435,12 +479,13 @@ public class WebConsolePlugin extends HttpServlet implements JobConsumer {
         return min + " min " + secs / 1000 + " secs";
     }
 
-    private void printForm(final PrintWriter pw,
-            final String qeueName,
-            final String buttonLabel,
-            final String cmd) {
-        pw.printf("<button class='ui-state-default ui-corner-all' onclick='javascript:eventingsubmit(\"%s\", \"%s\");'>" +
-                "%s</button>", ResponseUtil.escapeXml(cmd), (qeueName != null ? ResponseUtil.escapeXml(qeueName) : ""), ResponseUtil.escapeXml(buttonLabel));
+    private void printForm(final PrintWriter pw, final String qeueName, final String buttonLabel, final String cmd) {
+        pw.printf(
+                "<button class='ui-state-default ui-corner-all' onclick='javascript:eventingsubmit(\"%s\", \"%s\");'>"
+                        + "%s</button>",
+                ResponseUtil.escapeXml(cmd),
+                (qeueName != null ? ResponseUtil.escapeXml(qeueName) : ""),
+                ResponseUtil.escapeXml(buttonLabel));
     }
 
     @Override
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/jmx/AbstractJobStatistics.java b/src/main/java/org/apache/sling/event/impl/jobs/jmx/AbstractJobStatistics.java
index 8bf4033..c296539 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/jmx/AbstractJobStatistics.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/jmx/AbstractJobStatistics.java
@@ -1,31 +1,31 @@
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
+ * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
- * regarding copyright ownership. The SF licenses this file
+ * regarding copyright ownership.  The ASF licenses this file
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
+ * with the License.  You may obtain a copy of the License at
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.sling.event.impl.jobs.jmx;
 
-import java.util.Date;
-
 import javax.management.StandardMBean;
 
+import java.util.Date;
+
 import org.apache.sling.event.jobs.Statistics;
 import org.apache.sling.event.jobs.jmx.StatisticsMBean;
 
-public abstract class AbstractJobStatistics extends StandardMBean implements
-        StatisticsMBean {
+public abstract class AbstractJobStatistics extends StandardMBean implements StatisticsMBean {
 
     public AbstractJobStatistics() {
         super(StatisticsMBean.class, false);
@@ -96,5 +96,4 @@ public abstract class AbstractJobStatistics extends StandardMBean implements
     public Date getLastFinishedJobDate() {
         return new Date(getStatistics().getLastFinishedJobTime());
     }
-
 }
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/jmx/AllJobStatisticsMBean.java b/src/main/java/org/apache/sling/event/impl/jobs/jmx/AllJobStatisticsMBean.java
index 154a926..1119a42 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/jmx/AllJobStatisticsMBean.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/jmx/AllJobStatisticsMBean.java
@@ -1,19 +1,20 @@
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
+ * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
- * regarding copyright ownership. The SF licenses this file
+ * regarding copyright ownership.  The ASF licenses this file
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
+ * with the License.  You may obtain a copy of the License at
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.sling.event.impl.jobs.jmx;
 
@@ -24,11 +25,12 @@ import org.osgi.framework.Constants;
 import org.osgi.service.component.annotations.Component;
 import org.osgi.service.component.annotations.Reference;
 
-@Component(service =  StatisticsMBean.class,
-    property = {
+@Component(
+        service = StatisticsMBean.class,
+        property = {
             "jmx.objectname=org.apache.sling:type=queues,name=AllQueues",
             Constants.SERVICE_VENDOR + "=The Apache Software Foundation"
-})
+        })
 public class AllJobStatisticsMBean extends AbstractJobStatistics {
 
     private static final long TTL = 1000L;
@@ -54,5 +56,4 @@ public class AllJobStatisticsMBean extends AbstractJobStatistics {
     public String getName() {
         return "All Queues";
     }
-
 }
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/jmx/EmptyStatistics.java b/src/main/java/org/apache/sling/event/impl/jobs/jmx/EmptyStatistics.java
index 35772ba..ff492c9 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/jmx/EmptyStatistics.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/jmx/EmptyStatistics.java
@@ -1,19 +1,20 @@
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
+ * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
- * regarding copyright ownership. The SF licenses this file
+ * regarding copyright ownership.  The ASF licenses this file
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
+ * with the License.  You may obtain a copy of the License at
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.sling.event.impl.jobs.jmx;
 
@@ -73,7 +74,5 @@ public class EmptyStatistics implements Statistics {
         return 0;
     }
 
-    public void reset() {
-    }
-
+    public void reset() {}
 }
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/jmx/QueueMBeanImpl.java b/src/main/java/org/apache/sling/event/impl/jobs/jmx/QueueMBeanImpl.java
index d623515..1d25798 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/jmx/QueueMBeanImpl.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/jmx/QueueMBeanImpl.java
@@ -1,19 +1,20 @@
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
+ * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
- * regarding copyright ownership. The SF licenses this file
+ * regarding copyright ownership.  The ASF licenses this file
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
+ * with the License.  You may obtain a copy of the License at
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.sling.event.impl.jobs.jmx;
 
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/jmx/QueueStatusEvent.java b/src/main/java/org/apache/sling/event/impl/jobs/jmx/QueueStatusEvent.java
index dca3e33..0a7e0ae 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/jmx/QueueStatusEvent.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/jmx/QueueStatusEvent.java
@@ -1,19 +1,20 @@
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
+ * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
- * regarding copyright ownership. The SF licenses this file
+ * regarding copyright ownership.  The ASF licenses this file
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
+ * with the License.  You may obtain a copy of the License at
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.sling.event.impl.jobs.jmx;
 
@@ -24,11 +25,11 @@ public class QueueStatusEvent {
     private final Queue queue;
     private final Queue oldqueue;
 
-
     public QueueStatusEvent(final Queue queue, final Queue oldqueue) {
         this.queue = queue;
         this.oldqueue = oldqueue;
     }
+
     public boolean isNew() {
         return this.oldqueue == null;
     }
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/jmx/QueuesMBeanImpl.java b/src/main/java/org/apache/sling/event/impl/jobs/jmx/QueuesMBeanImpl.java
index 3227266..78cace9 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/jmx/QueuesMBeanImpl.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/jmx/QueuesMBeanImpl.java
@@ -1,22 +1,29 @@
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
+ * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
- * regarding copyright ownership. The SF licenses this file
+ * regarding copyright ownership.  The ASF licenses this file
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
+ * with the License.  You may obtain a copy of the License at
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.sling.event.impl.jobs.jmx;
 
+import javax.management.AttributeChangeNotification;
+import javax.management.MBeanNotificationInfo;
+import javax.management.Notification;
+import javax.management.NotificationBroadcasterSupport;
+import javax.management.StandardEmitterMBean;
+
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Dictionary;
@@ -26,12 +33,6 @@ import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.atomic.AtomicLong;
 
-import javax.management.AttributeChangeNotification;
-import javax.management.MBeanNotificationInfo;
-import javax.management.Notification;
-import javax.management.NotificationBroadcasterSupport;
-import javax.management.StandardEmitterMBean;
-
 import org.apache.sling.event.jobs.Queue;
 import org.apache.sling.event.jobs.jmx.QueuesMBean;
 import org.apache.sling.event.jobs.jmx.StatisticsMBean;
@@ -42,15 +43,16 @@ import org.osgi.service.component.annotations.Activate;
 import org.osgi.service.component.annotations.Component;
 import org.osgi.service.component.annotations.Deactivate;
 
-@Component(service =  QueuesMBean.class,
-property = {
-        "jmx.objectname=org.apache.sling:type=queues,name=QueueNames",
-        Constants.SERVICE_VENDOR + "=The Apache Software Foundation"
-})
+@Component(
+        service = QueuesMBean.class,
+        property = {
+            "jmx.objectname=org.apache.sling:type=queues,name=QueueNames",
+            Constants.SERVICE_VENDOR + "=The Apache Software Foundation"
+        })
 public class QueuesMBeanImpl extends StandardEmitterMBean implements QueuesMBean {
 
     private static final String QUEUE_NOTIFICATION = "org.apache.sling.event.queue";
-    private static final String[] NOTIFICATION_TYPES = { QUEUE_NOTIFICATION };
+    private static final String[] NOTIFICATION_TYPES = {QUEUE_NOTIFICATION};
     private Map<String, QueueMBeanHolder> queues = new ConcurrentHashMap<>();
     private String[] names;
     private AtomicLong sequence = new AtomicLong(System.currentTimeMillis());
@@ -58,8 +60,7 @@ public class QueuesMBeanImpl extends StandardEmitterMBean implements QueuesMBean
 
     class QueueMBeanHolder {
 
-        QueueMBeanHolder(String name, QueueMBeanImpl queueMBean,
-                ServiceRegistration registration) {
+        QueueMBeanHolder(String name, QueueMBeanImpl queueMBean, ServiceRegistration registration) {
             this.name = name;
             this.queueMBean = queueMBean;
             this.registration = registration;
@@ -68,14 +69,14 @@ public class QueuesMBeanImpl extends StandardEmitterMBean implements QueuesMBean
         QueueMBeanImpl queueMBean;
         ServiceRegistration registration;
         String name;
-
     }
 
     public QueuesMBeanImpl() {
-        super(QueuesMBean.class, false, new NotificationBroadcasterSupport(
-                new MBeanNotificationInfo(NOTIFICATION_TYPES,
-                        Notification.class.getName(),
-                        "Notifications about queues")));
+        super(
+                QueuesMBean.class,
+                false,
+                new NotificationBroadcasterSupport(new MBeanNotificationInfo(
+                        NOTIFICATION_TYPES, Notification.class.getName(), "Notifications about queues")));
     }
 
     @Activate
@@ -103,10 +104,15 @@ public class QueuesMBeanImpl extends StandardEmitterMBean implements QueuesMBean
         if (queueMBeanHolder != null) {
             String[] oldQueue = getQueueNames();
             names = null;
-            this.sendNotification(new AttributeChangeNotification(this,
-                    sequence.incrementAndGet(), System.currentTimeMillis(),
+            this.sendNotification(new AttributeChangeNotification(
+                    this,
+                    sequence.incrementAndGet(),
+                    System.currentTimeMillis(),
                     "Queue " + e.getQueue().getName() + " updated ",
-                    "queueNames", "String[]", oldQueue, getQueueNames()));
+                    "queueNames",
+                    "String[]",
+                    oldQueue,
+                    getQueueNames()));
         }
     }
 
@@ -129,40 +135,53 @@ public class QueuesMBeanImpl extends StandardEmitterMBean implements QueuesMBean
         String[] oldQueue = getQueueNames();
         QueueMBeanHolder queueMBeanHolder = add(queue);
         names = null;
-        this.sendNotification(new AttributeChangeNotification(this, sequence
-                .incrementAndGet(), System.currentTimeMillis(), "Queue "
-                + queueMBeanHolder.name + " added ", "queueNames", "String[]",
-                oldQueue, getQueueNames()));
+        this.sendNotification(new AttributeChangeNotification(
+                this,
+                sequence.incrementAndGet(),
+                System.currentTimeMillis(),
+                "Queue " + queueMBeanHolder.name + " added ",
+                "queueNames",
+                "String[]",
+                oldQueue,
+                getQueueNames()));
     }
 
     private void removeAndNotify(QueueMBeanHolder queueMBeanHolder) {
         String[] oldQueue = getQueueNames();
         remove(queueMBeanHolder);
         names = null;
-        this.sendNotification(new AttributeChangeNotification(this, sequence
-                .incrementAndGet(), System.currentTimeMillis(), "Queue "
-                + queueMBeanHolder.name + " removed ", "queueNames",
-                "String[]", oldQueue, getQueueNames()));
+        this.sendNotification(new AttributeChangeNotification(
+                this,
+                sequence.incrementAndGet(),
+                System.currentTimeMillis(),
+                "Queue " + queueMBeanHolder.name + " removed ",
+                "queueNames",
+                "String[]",
+                oldQueue,
+                getQueueNames()));
     }
 
     private QueueMBeanHolder add(Queue queue) {
         QueueMBeanImpl queueMBean = new QueueMBeanImpl(queue);
-        ServiceRegistration<?> serviceRegistration = bundleContext
-                .registerService(StatisticsMBean.class.getName(), queueMBean,
-                        createProperties(
-                                "jmx.objectname","org.apache.sling:type=queues,name="+queue.getName(),
-                                Constants.SERVICE_DESCRIPTION, "QueueMBean for queue "+queue.getName(),
-                                Constants.SERVICE_VENDOR, "The Apache Software Foundation"));
-        QueueMBeanHolder queueMBeanHolder = new QueueMBeanHolder(
-                queue.getName(), queueMBean, serviceRegistration);
+        ServiceRegistration<?> serviceRegistration = bundleContext.registerService(
+                StatisticsMBean.class.getName(),
+                queueMBean,
+                createProperties(
+                        "jmx.objectname",
+                        "org.apache.sling:type=queues,name=" + queue.getName(),
+                        Constants.SERVICE_DESCRIPTION,
+                        "QueueMBean for queue " + queue.getName(),
+                        Constants.SERVICE_VENDOR,
+                        "The Apache Software Foundation"));
+        QueueMBeanHolder queueMBeanHolder = new QueueMBeanHolder(queue.getName(), queueMBean, serviceRegistration);
         queues.put(queueMBeanHolder.name, queueMBeanHolder);
         return queueMBeanHolder;
     }
 
-    private Dictionary<String, Object> createProperties(Object ... values) {
+    private Dictionary<String, Object> createProperties(Object... values) {
         Dictionary<String, Object> props = new Hashtable<>();
-        for ( int i = 0; i < values.length; i+=2) {
-            props.put((String) values[i], values[i+1]);
+        for (int i = 0; i < values.length; i += 2) {
+            props.put((String) values[i], values[i + 1]);
         }
         return props;
     }
@@ -181,5 +200,4 @@ public class QueuesMBeanImpl extends StandardEmitterMBean implements QueuesMBean
         }
         return names;
     }
-
 }
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/notifications/NewJobSender.java b/src/main/java/org/apache/sling/event/impl/jobs/notifications/NewJobSender.java
index 668508d..e4828b1 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/notifications/NewJobSender.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/notifications/NewJobSender.java
@@ -57,7 +57,7 @@ public class NewJobSender implements ResourceChangeListener, ExternalResourceCha
     private JobManagerConfiguration configuration;
 
     /** The event admin. */
-    @Reference(policyOption=ReferencePolicyOption.GREEDY)
+    @Reference(policyOption = ReferencePolicyOption.GREEDY)
     private EventAdmin eventAdmin;
 
     /** Service registration for the event handler. */
@@ -85,7 +85,7 @@ public class NewJobSender implements ResourceChangeListener, ExternalResourceCha
      */
     @Deactivate
     protected void deactivate() {
-        if ( this.listenerRegistration != null ) {
+        if (this.listenerRegistration != null) {
             this.listenerRegistration.unregister();
             this.listenerRegistration = null;
         }
@@ -93,26 +93,27 @@ public class NewJobSender implements ResourceChangeListener, ExternalResourceCha
     }
 
     @Override
-	public void onChange(final List<ResourceChange> resourceChanges) {
-    	for(final ResourceChange resourceChange : resourceChanges) {
+    public void onChange(final List<ResourceChange> resourceChanges) {
+        for (final ResourceChange resourceChange : resourceChanges) {
             final String path = resourceChange.getPath();
 
             logger.debug("Received event {} : {}", resourceChange.getType().name(), path);
 
-    		final int topicStart = this.configuration.getLocalJobsPath().length() + 1;
-    		final int topicEnd = path.indexOf('/', topicStart);
-    		if ( topicEnd != -1 ) {
-    			final String topic = path.substring(topicStart, topicEnd).replace('.', '/');
+            final int topicStart = this.configuration.getLocalJobsPath().length() + 1;
+            final int topicEnd = path.indexOf('/', topicStart);
+            if (topicEnd != -1) {
+                final String topic = path.substring(topicStart, topicEnd).replace('.', '/');
                 final String jobId = path.substring(topicEnd + 1);
 
-                if ( path.indexOf("_", topicEnd + 1) != -1 ) {
-                	// only job id and topic are guaranteed
-                	final Dictionary<String, Object> properties = new Hashtable<>();
-                	properties.put(NotificationConstants.NOTIFICATION_PROPERTY_JOB_ID, jobId);
+                if (path.indexOf("_", topicEnd + 1) != -1) {
+                    // only job id and topic are guaranteed
+                    final Dictionary<String, Object> properties = new Hashtable<>();
+                    properties.put(NotificationConstants.NOTIFICATION_PROPERTY_JOB_ID, jobId);
                     properties.put(NotificationConstants.NOTIFICATION_PROPERTY_JOB_TOPIC, topic);
 
-                     // we also set internally the queue name
-                    final String queueName = this.configuration.getQueueConfigurationManager().getQueueInfo(topic).queueName;
+                    // we also set internally the queue name
+                    final String queueName =
+                            this.configuration.getQueueConfigurationManager().getQueueInfo(topic).queueName;
                     properties.put(Job.PROPERTY_JOB_QUEUE_NAME, queueName);
 
                     final Event jobEvent = new Event(NotificationConstants.TOPIC_JOB_ADDED, properties);
@@ -120,8 +121,7 @@ public class NewJobSender implements ResourceChangeListener, ExternalResourceCha
                     logger.debug("Sending event {} : {}", topic, jobId);
                     this.eventAdmin.sendEvent(jobEvent);
                 }
-    		}
-    	}
-
-	}
+            }
+        }
+    }
 }
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/notifications/NotificationUtility.java b/src/main/java/org/apache/sling/event/impl/jobs/notifications/NotificationUtility.java
index d45d818..f7c9c02 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/notifications/NotificationUtility.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/notifications/NotificationUtility.java
@@ -37,13 +37,11 @@ public abstract class NotificationUtility {
     /**
      * Helper method for sending the notification events.
      */
-    public static void sendNotification(final EventAdmin eventAdmin,
-            final String eventTopic,
-            final Job job,
-            final Long time) {
-        if ( eventAdmin != null ) {
+    public static void sendNotification(
+            final EventAdmin eventAdmin, final String eventTopic, final Job job, final Long time) {
+        if (eventAdmin != null) {
             // create new copy of job object
-            final Job jobCopy = new JobImpl(job.getTopic(), job.getId(), ((JobImpl)job).getProperties());
+            final Job jobCopy = new JobImpl(job.getTopic(), job.getId(), ((JobImpl) job).getProperties());
             sendNotificationInternal(eventAdmin, eventTopic, jobCopy, time);
         }
     }
@@ -51,16 +49,14 @@ public abstract class NotificationUtility {
     /**
      * Helper method for sending the notification events.
      */
-    private static void sendNotificationInternal(final EventAdmin eventAdmin,
-            final String eventTopic,
-            final Job job,
-            final Long time) {
+    private static void sendNotificationInternal(
+            final EventAdmin eventAdmin, final String eventTopic, final Job job, final Long time) {
         final Dictionary<String, Object> eventProps = new Hashtable<String, Object>();
         // add basic job properties
         eventProps.put(NotificationConstants.NOTIFICATION_PROPERTY_JOB_ID, job.getId());
         eventProps.put(NotificationConstants.NOTIFICATION_PROPERTY_JOB_TOPIC, job.getTopic());
         // copy payload
-        for(final String name : job.getPropertyNames()) {
+        for (final String name : job.getPropertyNames()) {
             eventProps.put(name, job.getProperty(name));
         }
         // remove async handler
@@ -68,10 +64,9 @@ public abstract class NotificationUtility {
         // add timestamp
         eventProps.put(EventConstants.TIMESTAMP, System.currentTimeMillis());
         // add internal time information
-        if ( time != null ) {
+        if (time != null) {
             eventProps.put(PROPERTY_TIME, time);
         }
         eventAdmin.postEvent(new Event(eventTopic, eventProps));
     }
-
 }
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/queues/JobExecutionContextImpl.java b/src/main/java/org/apache/sling/event/impl/jobs/queues/JobExecutionContextImpl.java
index f3989ab..3acb0ad 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/queues/JobExecutionContextImpl.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/queues/JobExecutionContextImpl.java
@@ -53,8 +53,7 @@ public class JobExecutionContextImpl implements JobExecutionContext {
 
     private final JobHandler handler;
 
-    public JobExecutionContextImpl(final JobHandler handler,
-            final ASyncHandler asyncHandler) {
+    public JobExecutionContextImpl(final JobHandler handler, final ASyncHandler asyncHandler) {
         this.handler = handler;
         this.asyncHandler = asyncHandler;
     }
@@ -64,36 +63,35 @@ public class JobExecutionContextImpl implements JobExecutionContext {
     }
 
     @Override
-    public void initProgress(final int steps,
-            final long eta) {
-        if ( initProgressIsCalled.compareAndSet(false, true) ) {
+    public void initProgress(final int steps, final long eta) {
+        if (initProgressIsCalled.compareAndSet(false, true)) {
             handler.persistJobProperties(handler.getJob().startProgress(steps, eta));
         }
     }
 
     @Override
     public void incrementProgressCount(final int steps) {
-        if ( initProgressIsCalled.get() ) {
+        if (initProgressIsCalled.get()) {
             handler.persistJobProperties(handler.getJob().setProgress(steps));
         }
     }
 
     @Override
     public void updateProgress(final long eta) {
-        if ( initProgressIsCalled.get() ) {
+        if (initProgressIsCalled.get()) {
             handler.persistJobProperties(handler.getJob().update(eta));
         }
     }
 
     @Override
     public void setProperty(@NotNull final String name, final Object value) {
-        if ( name == null ) {
+        if (name == null) {
             throw new IllegalArgumentException("Name must not be null");
         }
-        if ( value == null ) {
+        if (value == null) {
             throw new IllegalArgumentException("Value must not be null");
         }
-        if ( name.startsWith("slingevent:") || name.startsWith(":slingevent:")) {
+        if (name.startsWith("slingevent:") || name.startsWith(":slingevent:")) {
             throw new IllegalArgumentException("Property name must not start with slingevent: or :slingevent: " + name);
         }
 
@@ -114,15 +112,15 @@ public class JobExecutionContextImpl implements JobExecutionContext {
 
     @Override
     public void asyncProcessingFinished(final JobExecutionResult result) {
-        synchronized ( this ) {
-            if ( isAsync.compareAndSet(true, false) ) {
+        synchronized (this) {
+            if (isAsync.compareAndSet(true, false)) {
                 Job.JobState state = null;
-                if ( result.succeeded() ) {
+                if (result.succeeded()) {
                     state = Job.JobState.SUCCEEDED;
-                } else if ( result.failed() ) {
+                } else if (result.failed()) {
                     state = Job.JobState.QUEUED;
-                } else if ( result.cancelled() ) {
-                    if ( handler.isStopped() ) {
+                } else if (result.cancelled()) {
+                    if (handler.isStopped()) {
                         state = Job.JobState.STOPPED;
                     } else {
                         state = Job.JobState.ERROR;
@@ -130,7 +128,8 @@ public class JobExecutionContextImpl implements JobExecutionContext {
                 }
                 asyncHandler.finished(state);
             } else {
-                throw new IllegalStateException("Job is not processed async or is already finished: " + handler.getJob().getId());
+                throw new IllegalStateException("Job is not processed async or is already finished: "
+                        + handler.getJob().getId());
             }
         }
     }
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/queues/JobExecutionResultImpl.java b/src/main/java/org/apache/sling/event/impl/jobs/queues/JobExecutionResultImpl.java
index 28083e4..b87c3b7 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/queues/JobExecutionResultImpl.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/queues/JobExecutionResultImpl.java
@@ -27,9 +27,11 @@ import org.apache.sling.event.jobs.consumer.JobExecutionResult;
 public class JobExecutionResultImpl implements JobExecutionResult {
 
     /** Constant object for the success case. */
-    public static final JobExecutionResultImpl SUCCEEDED = new JobExecutionResultImpl(InternalJobState.SUCCEEDED, null, null);
+    public static final JobExecutionResultImpl SUCCEEDED =
+            new JobExecutionResultImpl(InternalJobState.SUCCEEDED, null, null);
     /** Constant object for the cancelled case. */
-    public static final JobExecutionResultImpl CANCELLED = new JobExecutionResultImpl(InternalJobState.CANCELLED, null, null);
+    public static final JobExecutionResultImpl CANCELLED =
+            new JobExecutionResultImpl(InternalJobState.CANCELLED, null, null);
     /** Constant object for the failed case. */
     public static final JobExecutionResultImpl FAILED = new JobExecutionResultImpl(InternalJobState.FAILED, null, null);
 
@@ -48,9 +50,7 @@ public class JobExecutionResultImpl implements JobExecutionResult {
      * @param message Optional Message
      * @param retryDelayInMs Optional retry delay
      */
-    public JobExecutionResultImpl(final InternalJobState state,
-            final String message,
-            final Long retryDelayInMs) {
+    public JobExecutionResultImpl(final InternalJobState state, final String message, final Long retryDelayInMs) {
         this.state = state;
         this.message = message;
         this.retryDelayInMs = retryDelayInMs;
@@ -91,7 +91,7 @@ public class JobExecutionResultImpl implements JobExecutionResult {
 
     @Override
     public String toString() {
-        return "JobExecutionResultImpl [state=" + state + ", message="
-                + message + ", retryDelayInMs=" + retryDelayInMs + "]";
+        return "JobExecutionResultImpl [state=" + state + ", message=" + message + ", retryDelayInMs=" + retryDelayInMs
+                + "]";
     }
 }
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/queues/JobQueueImpl.java b/src/main/java/org/apache/sling/event/impl/jobs/queues/JobQueueImpl.java
index 15192fd..4447da1 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/queues/JobQueueImpl.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/queues/JobQueueImpl.java
@@ -57,8 +57,7 @@ import org.slf4j.LoggerFactory;
  * The job blocking queue extends the blocking queue by some
  * functionality for the job event handling.
  */
-public class JobQueueImpl
-    implements Queue {
+public class JobQueueImpl implements Queue {
 
     /** Default timeout for suspend. */
     private static final long MAX_SUSPEND_TIME = 1000 * 60 * 60; // 60 mins
@@ -134,27 +133,28 @@ public class JobQueueImpl
      *
      * @return {@code JobQueueImpl} if there are jobs to process, {@code null} otherwise.
      */
-    public static JobQueueImpl createQueue(final String name,
-                        final InternalQueueConfiguration config,
-                        final QueueServices services,
-                        final Set<String> topics,
-                        final Set<String> haltedTopicsBackRef,
-                        final OutdatedJobQueueInfo outdatedQueueInfo) {
-        final QueueJobCache cache = new QueueJobCache(services.configuration, name, services.statisticsManager, config.getType(), topics);
+    public static JobQueueImpl createQueue(
+            final String name,
+            final InternalQueueConfiguration config,
+            final QueueServices services,
+            final Set<String> topics,
+            final Set<String> haltedTopicsBackRef,
+            final OutdatedJobQueueInfo outdatedQueueInfo) {
+        final QueueJobCache cache =
+                new QueueJobCache(services.configuration, name, services.statisticsManager, config.getType(), topics);
         // the cache might contain newly halted topics.
         // these we need to retain, to avoid scanning them going forward.
         // but since the cache might be empty and thus discarded,
         // we pass them back explicitly in provided haltedTopicsRef
-        if ( !cache.getNewlyHaltedTopics().isEmpty() ) {
-            for (String haltedTopic : cache.getNewlyHaltedTopics() ) {
+        if (!cache.getNewlyHaltedTopics().isEmpty()) {
+            for (String haltedTopic : cache.getNewlyHaltedTopics()) {
                 if (haltedTopicsBackRef.add(haltedTopic)) {
                     LoggerFactory.getLogger(JobQueueImpl.class.getName() + '.' + name)
-                            .warn("createQueue : topic halted due to ClassNotFoundExceptions : "
-                                    + haltedTopic);
+                            .warn("createQueue : topic halted due to ClassNotFoundExceptions : " + haltedTopic);
                 }
             }
         }
-        if ( cache.isEmpty() ) {
+        if (cache.isEmpty()) {
             return null;
         }
         return new JobQueueImpl(name, config, services, cache, outdatedQueueInfo);
@@ -169,12 +169,13 @@ public class JobQueueImpl
      * @param cache The job cache
      * @param outdatedQueue
      */
-    protected JobQueueImpl(final String name,
-                        final InternalQueueConfiguration config,
-                        final QueueServices services,
-                        final QueueJobCache cache,
-                        final OutdatedJobQueueInfo outdatedQueue) {
-        if ( config.getOwnThreadPoolSize() > 0 ) {
+    protected JobQueueImpl(
+            final String name,
+            final InternalQueueConfiguration config,
+            final QueueServices services,
+            final QueueJobCache cache,
+            final OutdatedJobQueueInfo outdatedQueue) {
+        if (config.getOwnThreadPoolSize() > 0) {
             this.threadPool = new EventingThreadPool(services.threadPoolManager, config.getOwnThreadPoolSize());
         } else {
             this.threadPool = services.eventingThreadPool;
@@ -213,11 +214,17 @@ public class JobQueueImpl
                     this.drainage.release(-netNewPermits);
                 }
             }
-            logger.info("<init> reused outdated queue info: queueName : {}"
-                    + ", old available : {}, old drainage : {}, old maxParallel : {}"
-                    + ", new available : {}, new drainage : {}, new maxParallel : {}",
-                    queueName, drainedOldAvailable, drainedOldDrainage, oldMaxParallel,
-                    available.availablePermits(), drainage.availablePermits(), this.maxParallel);
+            logger.info(
+                    "<init> reused outdated queue info: queueName : {}"
+                            + ", old available : {}, old drainage : {}, old maxParallel : {}"
+                            + ", new available : {}, new drainage : {}, new maxParallel : {}",
+                    queueName,
+                    drainedOldAvailable,
+                    drainedOldDrainage,
+                    oldMaxParallel,
+                    available.availablePermits(),
+                    drainage.availablePermits(),
+                    this.maxParallel);
         }
         logger.info("Starting job queue {}", queueName);
         logger.debug("Configuration for job queue={}", configuration);
@@ -256,15 +263,18 @@ public class JobQueueImpl
             logger.debug("Job processing is disabled, skipping job starts for queue {}", queueName);
             return;
         }
-        if ( this.startJobsGuard.compareAndSet(false, true) ) {
+        if (this.startJobsGuard.compareAndSet(false, true)) {
             // we start as many jobs in parallel as possible
-            while ( this.running && !this.isOutdated.get() && !this.isSuspended() && this.available.tryAcquire() ) {
+            while (this.running && !this.isOutdated.get() && !this.isSuspended() && this.available.tryAcquire()) {
                 boolean started = false;
                 this.lock.writeLock().lock();
                 try {
-                    final JobHandler handler = this.cache.getNextJob(this.services.jobConsumerManager,
-                            this.services.statisticsManager, this, this.doFullCacheSearch.getAndSet(false));
-                    if ( handler != null ) {
+                    final JobHandler handler = this.cache.getNextJob(
+                            this.services.jobConsumerManager,
+                            this.services.statisticsManager,
+                            this,
+                            this.doFullCacheSearch.getAndSet(false));
+                    if (handler != null) {
                         started = true;
                         this.threadPool.execute(new Runnable() {
 
@@ -275,15 +285,20 @@ public class JobQueueImpl
                                 final String oldName = currentThread.getName();
                                 final int oldPriority = currentThread.getPriority();
 
-                                currentThread.setName(oldName + "-" + handler.getJob().getQueueName() + "(" + handler.getJob().getTopic() + ")");
-                                if ( configuration.getThreadPriority() != null ) {
-                                    switch ( configuration.getThreadPriority() ) {
-                                        case NORM : currentThread.setPriority(Thread.NORM_PRIORITY);
-                                                    break;
-                                        case MIN  : currentThread.setPriority(Thread.MIN_PRIORITY);
-                                                    break;
-                                        case MAX  : currentThread.setPriority(Thread.MAX_PRIORITY);
-                                                    break;
+                                currentThread.setName(
+                                        oldName + "-" + handler.getJob().getQueueName() + "("
+                                                + handler.getJob().getTopic() + ")");
+                                if (configuration.getThreadPriority() != null) {
+                                    switch (configuration.getThreadPriority()) {
+                                        case NORM:
+                                            currentThread.setPriority(Thread.NORM_PRIORITY);
+                                            break;
+                                        case MIN:
+                                            currentThread.setPriority(Thread.MIN_PRIORITY);
+                                            break;
+                                        case MAX:
+                                            currentThread.setPriority(Thread.MAX_PRIORITY);
+                                            break;
                                     }
                                 }
 
@@ -303,7 +318,7 @@ public class JobQueueImpl
                     }
 
                 } finally {
-                    if ( !started ) {
+                    if (!started) {
                         this.available.release();
                     }
                     this.lock.writeLock().unlock();
@@ -315,7 +330,10 @@ public class JobQueueImpl
 
     private void startJob(final JobHandler handler) {
         if (!services.configuration.isJobProcessingEnabled()) {
-            logger.debug("Job processing is disabled, stopping job {} in queue {}", handler.getJob().getId(), queueName);
+            logger.debug(
+                    "Job processing is disabled, stopping job {} in queue {}",
+                    handler.getJob().getId(),
+                    queueName);
             return;
         }
         try {
@@ -327,7 +345,7 @@ public class JobQueueImpl
                 this.services.configuration.getAuditLogger().debug("START OK : {}", job.getId());
                 // sanity check for the queued property
                 Calendar queued = job.getProperty(JobImpl.PROPERTY_JOB_QUEUED, Calendar.class);
-                if ( queued == null ) {
+                if (queued == null) {
                     // we simply use a date of ten seconds ago
                     queued = Calendar.getInstance();
                     queued.setTimeInMillis(System.currentTimeMillis() - 10000);
@@ -336,38 +354,40 @@ public class JobQueueImpl
                 // update statistics
                 this.services.statisticsManager.jobStarted(this.queueName, job.getTopic(), queueTime);
                 // send notification
-                NotificationUtility.sendNotification(this.services.eventAdmin, NotificationConstants.TOPIC_JOB_STARTED, job, queueTime);
+                NotificationUtility.sendNotification(
+                        this.services.eventAdmin, NotificationConstants.TOPIC_JOB_STARTED, job, queueTime);
 
-                synchronized ( this.processingJobsLists ) {
+                synchronized (this.processingJobsLists) {
                     this.processingJobsLists.put(job.getId(), handler);
                 }
 
                 JobExecutionResultImpl result = JobExecutionResultImpl.CANCELLED;
                 Job.JobState resultState = Job.JobState.ERROR;
-                final JobExecutionContextImpl ctx = new JobExecutionContextImpl(handler, new JobExecutionContextImpl.ASyncHandler() {
+                final JobExecutionContextImpl ctx =
+                        new JobExecutionContextImpl(handler, new JobExecutionContextImpl.ASyncHandler() {
 
-                    @Override
-                    public void finished(final JobState state) {
-                        services.jobConsumerManager.unregisterListener(job.getId());
-                        finishedJob(job.getId(), state, true);
-                        asyncCounter.decrementAndGet();
-                    }
-                });
+                            @Override
+                            public void finished(final JobState state) {
+                                services.jobConsumerManager.unregisterListener(job.getId());
+                                finishedJob(job.getId(), state, true);
+                                asyncCounter.decrementAndGet();
+                            }
+                        });
 
                 try {
-                    synchronized ( ctx ) {
-                        result = (JobExecutionResultImpl)handler.getConsumer().process(job, ctx);
-                        if ( result == null ) { // ASYNC processing
+                    synchronized (ctx) {
+                        result = (JobExecutionResultImpl) handler.getConsumer().process(job, ctx);
+                        if (result == null) { // ASYNC processing
                             services.jobConsumerManager.registerListener(job.getId(), handler.getConsumer(), ctx);
                             asyncCounter.incrementAndGet();
                             ctx.markAsync();
                         } else {
-                            if ( result.succeeded() ) {
+                            if (result.succeeded()) {
                                 resultState = Job.JobState.SUCCEEDED;
-                            } else if ( result.failed() ) {
+                            } else if (result.failed()) {
                                 resultState = Job.JobState.QUEUED;
-                            } else if ( result.cancelled() ) {
-                                if ( handler.isStopped() ) {
+                            } else if (result.cancelled()) {
+                                if (handler.isStopped()) {
                                     resultState = Job.JobState.STOPPED;
                                 } else {
                                     resultState = Job.JobState.ERROR;
@@ -375,18 +395,21 @@ public class JobQueueImpl
                             }
                         }
                     }
-                } catch (final Throwable t) { //NOSONAR
-                    logger.error("Unhandled error occured in job processor " + t.getMessage() + " while processing job " + Utility.toString(job), t);
+                } catch (final Throwable t) { // NOSONAR
+                    logger.error(
+                            "Unhandled error occured in job processor " + t.getMessage() + " while processing job "
+                                    + Utility.toString(job),
+                            t);
                     // we don't reschedule if an exception occurs
                     result = JobExecutionResultImpl.CANCELLED;
                     resultState = Job.JobState.ERROR;
                 } finally {
-                    if ( result != null ) {
-                        if ( result.getRetryDelayInMs() != null ) {
+                    if (result != null) {
+                        if (result.getRetryDelayInMs() != null) {
                             job.setProperty(JobImpl.PROPERTY_DELAY_OVERRIDE, result.getRetryDelayInMs());
                         }
-                        if ( result.getMessage() != null ) {
-                           job.setProperty(Job.PROPERTY_RESULT_MESSAGE, result.getMessage());
+                        if (result.getMessage() != null) {
+                            job.setProperty(Job.PROPERTY_RESULT_MESSAGE, result.getMessage());
                         }
                         this.finishedJob(job.getId(), resultState, false);
                     }
@@ -402,8 +425,8 @@ public class JobQueueImpl
                 // got reconfigured and we are not releasing a permit to
                 // available here, but instead reduce drainage.
                 final int approxPermits = this.drainage.availablePermits();
-                this.logger.debug("startJobHandler: drained 1 permit for {}, approx left to drain: {}",
-                        queueName, approxPermits);
+                this.logger.debug(
+                        "startJobHandler: drained 1 permit for {}, approx left to drain: {}", queueName, approxPermits);
             } else {
                 // otherwise release as usual
                 this.available.release();
@@ -415,7 +438,7 @@ public class JobQueueImpl
      * Outdate this queue.
      */
     public void outdate() {
-        if ( this.isOutdated.compareAndSet(false, true) ) {
+        if (this.isOutdated.compareAndSet(false, true)) {
             final String name = this.getName() + "<outdated>(" + this.hashCode() + ")";
             this.logger.info("Outdating queue {}, renaming to {}.", this.queueName, name);
             this.queueName = name;
@@ -431,8 +454,8 @@ public class JobQueueImpl
         this.lock.writeLock().lock();
         try {
             // check if possible
-            if ( this.canBeClosed() ) {
-                if ( this.closeMarker.get() ) {
+            if (this.canBeClosed()) {
+                if (this.closeMarker.get()) {
                     this.close();
                     return true;
                 }
@@ -449,9 +472,9 @@ public class JobQueueImpl
      */
     private boolean canBeClosed() {
         return !this.isSuspended()
-            && this.asyncCounter.get() == 0
-            && this.waitCounter.get() == 0
-            && this.available.availablePermits() == this.configuration.getMaxParallel();
+                && this.asyncCounter.get() == 0
+                && this.waitCounter.get() == 0
+                && this.available.availablePermits() == this.configuration.getMaxParallel();
     }
 
     /**
@@ -462,11 +485,11 @@ public class JobQueueImpl
         this.logger.debug("Shutting down job queue {}", queueName);
         this.resume();
 
-        synchronized ( this.processingJobsLists ) {
+        synchronized (this.processingJobsLists) {
             this.processingJobsLists.clear();
         }
-        if ( this.configuration.getOwnThreadPoolSize() > 0 ) {
-            ((EventingThreadPool)this.threadPool).release();
+        if (this.configuration.getOwnThreadPoolSize() > 0) {
+            ((EventingThreadPool) this.threadPool).release();
         }
 
         this.logger.info("Stopped job queue {}", this.queueName);
@@ -482,7 +505,7 @@ public class JobQueueImpl
         }
         // check suspended
         final long since = this.suspendedSince.get();
-        if ( since != -1 && since + MAX_SUSPEND_TIME < System.currentTimeMillis() ) {
+        if (since != -1 && since + MAX_SUSPEND_TIME < System.currentTimeMillis()) {
             logger.info("Waking up suspended queue. It has been suspended for more than {}ms", MAX_SUSPEND_TIME);
             this.resume();
         }
@@ -511,32 +534,33 @@ public class JobQueueImpl
     }
 
     private static final class RescheduleInfo {
-        public boolean      reschedule = false;
+        public boolean reschedule = false;
         // processing time is only set of state is SUCCEEDED
-        public long         processingTime;
+        public long processingTime;
         public Job.JobState state;
-        public InternalJobState       finalState;
+        public InternalJobState finalState;
     }
 
     private RescheduleInfo handleReschedule(final JobHandler handler, final Job.JobState resultState) {
         final RescheduleInfo info = new RescheduleInfo();
         info.state = resultState;
-        switch ( resultState ) {
-            case SUCCEEDED : // job is finished
-                if ( this.logger.isDebugEnabled() ) {
+        switch (resultState) {
+            case SUCCEEDED: // job is finished
+                if (this.logger.isDebugEnabled()) {
                     this.logger.debug("Finished job {}", Utility.toString(handler.getJob()));
                 }
                 info.processingTime = System.currentTimeMillis() - handler.started;
                 info.finalState = InternalJobState.SUCCEEDED;
                 break;
-            case QUEUED : // check if we exceeded the number of retries
+            case QUEUED: // check if we exceeded the number of retries
                 final int retries = handler.getJob().getProperty(Job.PROPERTY_JOB_RETRIES, 0);
                 int retryCount = handler.getJob().getProperty(Job.PROPERTY_JOB_RETRY_COUNT, 0);
 
                 retryCount++;
-                if ( retries != -1 && retryCount > retries ) {
-                    if ( this.logger.isDebugEnabled() ) {
-                        this.logger.error("Cancelled job {} after {} unsuccessful retries",
+                if (retries != -1 && retryCount > retries) {
+                    if (this.logger.isDebugEnabled()) {
+                        this.logger.error(
+                                "Cancelled job {} after {} unsuccessful retries",
                                 Utility.toString(handler.getJob()),
                                 retries);
                     }
@@ -544,22 +568,23 @@ public class JobQueueImpl
                 } else {
                     info.reschedule = true;
                     handler.getJob().retry();
-                    this.logger.warn("Failed job {}, will retry {} more time(s), retryCount={}",
+                    this.logger.warn(
+                            "Failed job {}, will retry {} more time(s), retryCount={}",
                             Utility.toString(handler.getJob()),
-                            retries-retryCount,
+                            retries - retryCount,
                             retryCount);
                     info.finalState = InternalJobState.FAILED;
                 }
                 break;
-            default : // consumer cancelled the job (STOPPED, GIVEN_UP, ERROR)
-                if ( this.logger.isDebugEnabled() ) {
+            default: // consumer cancelled the job (STOPPED, GIVEN_UP, ERROR)
+                if (this.logger.isDebugEnabled()) {
                     this.logger.debug("Cancelled job {}", Utility.toString(handler.getJob()));
                 }
                 info.finalState = InternalJobState.CANCELLED;
                 break;
         }
 
-        if ( info.state == Job.JobState.QUEUED && !info.reschedule ) {
+        if (info.state == Job.JobState.QUEUED && !info.reschedule) {
             info.state = Job.JobState.GIVEN_UP;
         }
         return info;
@@ -568,25 +593,23 @@ public class JobQueueImpl
     /**
      * Handle job finish and determine whether to reschedule or cancel the job
      */
-    private boolean finishedJob(final String jobId,
-                                final Job.JobState resultState,
-                                final boolean isAsync) {
+    private boolean finishedJob(final String jobId, final Job.JobState resultState, final boolean isAsync) {
         this.services.configuration.getAuditLogger().debug("FINISHED {} : {}", resultState, jobId);
         this.logger.debug("Received finish for job {}, resultState={}", jobId, resultState);
 
         // get job handler
         final JobHandler handler;
         // let's remove the event from our processing list
-        synchronized ( this.processingJobsLists ) {
+        synchronized (this.processingJobsLists) {
             handler = this.processingJobsLists.remove(jobId);
         }
 
-        if ( !this.running ) {
+        if (!this.running) {
             this.logger.warn("Queue is not running anymore. Discarding finish for {}", jobId);
             return false;
         }
 
-        if ( handler == null ) {
+        if (handler == null) {
             this.logger.warn("This job has never been started by this queue: {}", jobId);
             return false;
         }
@@ -594,7 +617,7 @@ public class JobQueueImpl
         // handle the rescheduling of the job
         final RescheduleInfo rescheduleInfo = this.handleReschedule(handler, resultState);
 
-        if ( !rescheduleInfo.reschedule ) {
+        if (!rescheduleInfo.reschedule) {
             // we keep cancelled jobs and succeeded jobs if the queue is configured like this.
             final boolean keepJobs = rescheduleInfo.state != Job.JobState.SUCCEEDED || this.configuration.isKeepJobs();
             handler.finished(rescheduleInfo.state, keepJobs, rescheduleInfo.processingTime);
@@ -602,14 +625,14 @@ public class JobQueueImpl
             this.reschedule(handler);
         }
         // update statistics
-        this.services.statisticsManager.jobEnded(this.queueName,
-                handler.getJob().getTopic(),
-                rescheduleInfo.finalState,
-                rescheduleInfo.processingTime);
+        this.services.statisticsManager.jobEnded(
+                this.queueName, handler.getJob().getTopic(), rescheduleInfo.finalState, rescheduleInfo.processingTime);
         // send notification
-        NotificationUtility.sendNotification(this.services.eventAdmin,
+        NotificationUtility.sendNotification(
+                this.services.eventAdmin,
                 rescheduleInfo.finalState.getTopic(),
-                handler.getJob(), rescheduleInfo.processingTime);
+                handler.getJob(),
+                rescheduleInfo.processingTime);
 
         return rescheduleInfo.reschedule;
     }
@@ -619,7 +642,7 @@ public class JobQueueImpl
      */
     @Override
     public void resume() {
-        if ( this.suspendedSince.getAndSet(-1) != -1 ) {
+        if (this.suspendedSince.getAndSet(-1) != -1) {
             this.logger.debug("Waking up suspended queue {}", queueName);
             this.startJobs();
         }
@@ -630,7 +653,7 @@ public class JobQueueImpl
      */
     @Override
     public void suspend() {
-        if ( this.suspendedSince.compareAndSet(-1, System.currentTimeMillis()) ) {
+        if (this.suspendedSince.compareAndSet(-1, System.currentTimeMillis())) {
             this.logger.debug("Suspending queue {}", queueName);
         }
     }
@@ -651,29 +674,30 @@ public class JobQueueImpl
         final Set<String> topics = this.cache.getTopics();
         logger.debug("Removing all jobs for queue {} : {}", queueName, topics);
 
-        if ( !topics.isEmpty() ) {
+        if (!topics.isEmpty()) {
 
             final ResourceResolver resolver = this.services.configuration.createResourceResolver();
             try {
                 final Resource baseResource = resolver.getResource(this.services.configuration.getLocalJobsPath());
 
                 // sanity check - should never be null
-                if ( baseResource != null ) {
+                if (baseResource != null) {
                     final BatchResourceRemover brr = new BatchResourceRemover();
 
-                    for(final String t : topics) {
+                    for (final String t : topics) {
                         final Resource topicResource = baseResource.getChild(t.replace('/', '.'));
-                        if ( topicResource != null ) {
+                        if (topicResource != null) {
                             JobTopicTraverser.traverse(logger, topicResource, new JobTopicTraverser.JobCallback() {
 
                                 @Override
                                 public boolean handle(final JobImpl job) {
-                                    final Resource jobResource = topicResource.getResourceResolver().getResource(job.getResourcePath());
+                                    final Resource jobResource =
+                                            topicResource.getResourceResolver().getResource(job.getResourcePath());
                                     // sanity check
-                                    if ( jobResource != null ) {
+                                    if (jobResource != null) {
                                         try {
                                             brr.delete(jobResource);
-                                        } catch ( final PersistenceException ignore) {
+                                        } catch (final PersistenceException ignore) {
                                             logger.error("Unable to remove job " + job, ignore);
                                             topicResource.getResourceResolver().revert();
                                             topicResource.getResourceResolver().refresh();
@@ -686,7 +710,7 @@ public class JobQueueImpl
                     }
                     try {
                         resolver.commit();
-                    } catch ( final PersistenceException ignore) {
+                    } catch (final PersistenceException ignore) {
                         logger.error("Unable to remove jobs", ignore);
                     }
                 }
@@ -701,8 +725,8 @@ public class JobQueueImpl
      */
     @Override
     public Object getState(final String key) {
-        if ( this.configuration.getType() == Type.ORDERED ) {
-            if ( "isSleepingUntil".equals(key) ) {
+        if (this.configuration.getType() == Type.ORDERED) {
+            if ("isSleepingUntil".equals(key)) {
                 return this.isSleepingUntil;
             }
         }
@@ -714,12 +738,15 @@ public class JobQueueImpl
      */
     @Override
     public String getStateInfo() {
-        return "outdated=" + this.isOutdated.get() +
-                ", suspendedSince=" + this.suspendedSince.get() +
-                ", asyncJobs=" + this.asyncCounter.get() +
-                ", waitCount=" + this.waitCounter.get() +
-                ", jobCount=" + String.valueOf(this.configuration.getMaxParallel() - this.available.availablePermits() +
-                (this.configuration.getType() == Type.ORDERED ? ", isSleepingUntil=" + this.isSleepingUntil : ""));
+        return "outdated=" + this.isOutdated.get() + ", suspendedSince="
+                + this.suspendedSince.get() + ", asyncJobs="
+                + this.asyncCounter.get() + ", waitCount="
+                + this.waitCounter.get() + ", jobCount="
+                + String.valueOf(this.configuration.getMaxParallel()
+                        - this.available.availablePermits()
+                        + (this.configuration.getType() == Type.ORDERED
+                                ? ", isSleepingUntil=" + this.isSleepingUntil
+                                : ""));
     }
 
     /**
@@ -729,9 +756,9 @@ public class JobQueueImpl
      */
     private long getRetryDelay(final JobHandler handler) {
         long delay = this.configuration.getRetryDelayInMs();
-        if ( handler.getJob().getProperty(JobImpl.PROPERTY_DELAY_OVERRIDE) != null ) {
+        if (handler.getJob().getProperty(JobImpl.PROPERTY_DELAY_OVERRIDE) != null) {
             delay = handler.getJob().getProperty(JobImpl.PROPERTY_DELAY_OVERRIDE, Long.class);
-        } else  if ( handler.getJob().getProperty(Job.PROPERTY_JOB_RETRY_DELAY) != null ) {
+        } else if (handler.getJob().getProperty(Job.PROPERTY_JOB_RETRY_DELAY) != null) {
             delay = handler.getJob().getProperty(Job.PROPERTY_JOB_RETRY_DELAY, Long.class);
         }
         return delay;
@@ -739,10 +766,10 @@ public class JobQueueImpl
 
     public boolean stopJob(final JobImpl job) {
         final JobHandler handler;
-        synchronized ( this.processingJobsLists ) {
+        synchronized (this.processingJobsLists) {
             handler = this.processingJobsLists.get(job.getId());
         }
-        if ( handler != null ) {
+        if (handler != null) {
             handler.stop();
         }
         return handler != null;
@@ -753,7 +780,7 @@ public class JobQueueImpl
      */
     public void stopAllJobs() {
         logger.debug("Stopping all running jobs in queue {}", queueName);
-        synchronized ( this.processingJobsLists ) {
+        synchronized (this.processingJobsLists) {
             for (final JobHandler handler : this.processingJobsLists.values()) {
                 handler.stop();
             }
@@ -764,14 +791,14 @@ public class JobQueueImpl
     private void reschedule(final JobHandler handler) {
         // we delay putting back the job until the retry delay is over
         final long delay = this.getRetryDelay(handler);
-        if ( delay > 0 ) {
-            if ( this.configuration.getType() == Type.ORDERED ) {
+        if (delay > 0) {
+            if (this.configuration.getType() == Type.ORDERED) {
                 this.cache.setIsBlocked(true);
             }
             handler.addToRetryList();
             final Date fireDate = new Date();
             fireDate.setTime(System.currentTimeMillis() + delay);
-            if ( this.configuration.getType() == Type.ORDERED ) {
+            if (this.configuration.getType() == Type.ORDERED) {
                 this.isSleepingUntil = fireDate.getTime();
             }
 
@@ -779,12 +806,12 @@ public class JobQueueImpl
                 @Override
                 public void run() {
                     try {
-                        if ( handler.removeFromRetryList() ) {
+                        if (handler.removeFromRetryList()) {
                             requeue(handler);
                         }
                         waitCounter.decrementAndGet();
                     } finally {
-                        if ( configuration.getType() == Type.ORDERED ) {
+                        if (configuration.getType() == Type.ORDERED) {
                             isSleepingUntil = -1;
                             cache.setIsBlocked(false);
                             startJobs();
@@ -794,13 +821,15 @@ public class JobQueueImpl
             };
             this.waitCounter.incrementAndGet();
             final Timer timer = new Timer();
-            timer.schedule(new TimerTask() {
+            timer.schedule(
+                    new TimerTask() {
 
-                @Override
-                public void run() {
-                    t.run();
-                }
-            }, delay);
+                        @Override
+                        public void run() {
+                            t.run();
+                        }
+                    },
+                    delay);
         } else {
             // put directly into queue
             this.requeue(handler);
@@ -823,4 +852,3 @@ public class JobQueueImpl
         return running;
     }
 }
-
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/queues/QueueJobCache.java b/src/main/java/org/apache/sling/event/impl/jobs/queues/QueueJobCache.java
index f4190e6..d5a7a58 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/queues/QueueJobCache.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/queues/QueueJobCache.java
@@ -86,7 +86,8 @@ public class QueueJobCache {
      * @param queueType The queue type
      * @param topics The topics handled by this queue.
      */
-    public QueueJobCache(final JobManagerConfiguration configuration,
+    public QueueJobCache(
+            final JobManagerConfiguration configuration,
             final String queueName,
             final StatisticsManager statisticsManager,
             final QueueConfiguration.Type queueType,
@@ -111,11 +112,11 @@ public class QueueJobCache {
      */
     public boolean isEmpty() {
         boolean result = true;
-        synchronized ( this.cache ) {
+        synchronized (this.cache) {
             result = this.cache.isEmpty();
         }
-        if ( result ) {
-            synchronized ( this.topicsWithNewJobs ) {
+        if (result) {
+            synchronized (this.topicsWithNewJobs) {
                 result = this.topicsWithNewJobs.isEmpty();
             }
         }
@@ -123,7 +124,7 @@ public class QueueJobCache {
     }
 
     Set<String> getNewlyHaltedTopics() {
-        synchronized ( this.topicsWithNewJobs ) {
+        synchronized (this.topicsWithNewJobs) {
             return new HashSet<>(this.newlyHaltedTopics);
         }
     }
@@ -139,7 +140,7 @@ public class QueueJobCache {
     private void fillCache(final String queueName, final StatisticsManager statisticsManager) {
         final Set<String> checkingTopics = new HashSet<String>();
         checkingTopics.addAll(this.topics);
-        if ( !checkingTopics.isEmpty() ) {
+        if (!checkingTopics.isEmpty()) {
             this.loadJobs(queueName, checkingTopics, statisticsManager);
         }
     }
@@ -155,57 +156,59 @@ public class QueueJobCache {
      * @param doFull Whether to do a full scan
      * @return The job handler or {@code null}.
      */
-    public JobHandler getNextJob(final JobConsumerManager jobConsumerManager,
+    public JobHandler getNextJob(
+            final JobConsumerManager jobConsumerManager,
             final StatisticsManager statisticsManager,
             final Queue queue,
             final boolean doFull) {
         JobHandler handler = null;
 
-        if ( !this.queueIsBlocked.get() ) {
-            synchronized ( this.cache ) {
+        if (!this.queueIsBlocked.get()) {
+            synchronized (this.cache) {
                 boolean retry;
                 do {
                     retry = false;
-                    if ( this.cache.isEmpty() ) {
+                    if (this.cache.isEmpty()) {
                         final Set<String> checkingTopics = new HashSet<String>();
-                        synchronized ( this.topicsWithNewJobs ) {
+                        synchronized (this.topicsWithNewJobs) {
                             checkingTopics.addAll(this.topicsWithNewJobs);
                             this.topicsWithNewJobs.clear();
                         }
-                        if ( doFull ) {
+                        if (doFull) {
                             checkingTopics.addAll(this.topics);
                         }
                         checkingTopics.removeAll(newlyHaltedTopics);
-                        if ( !checkingTopics.isEmpty() ) {
+                        if (!checkingTopics.isEmpty()) {
                             this.loadJobs(queue.getName(), checkingTopics, statisticsManager);
                         }
                     }
 
-                    if ( !this.cache.isEmpty() ) {
+                    if (!this.cache.isEmpty()) {
                         final JobImpl job = this.cache.remove(0);
                         final JobExecutor consumer = jobConsumerManager.getExecutor(job.getTopic());
 
                         handler = new JobHandler(job, consumer, this.configuration);
-                        if ( consumer != null ) {
-                            if ( !handler.startProcessing(queue) ) {
-                                statisticsManager.jobDequeued(queue.getName(), handler.getJob().getTopic());
-                                if ( logger.isDebugEnabled() ) {
+                        if (consumer != null) {
+                            if (!handler.startProcessing(queue)) {
+                                statisticsManager.jobDequeued(
+                                        queue.getName(), handler.getJob().getTopic());
+                                if (logger.isDebugEnabled()) {
                                     logger.debug("Discarding removed job {}", Utility.toString(job));
                                 }
                                 handler = null;
                                 retry = true;
                             }
                         } else {
-                            statisticsManager.jobDequeued(queue.getName(), handler.getJob().getTopic());
+                            statisticsManager.jobDequeued(
+                                    queue.getName(), handler.getJob().getTopic());
                             // no consumer on this instance, assign to another instance
                             handler.reassign();
 
                             handler = null;
                             retry = true;
                         }
-
                     }
-                } while ( handler == null && retry);
+                } while (handler == null && retry);
             }
         }
         return handler;
@@ -215,8 +218,8 @@ public class QueueJobCache {
      * Load the next N x numberOf(topics) jobs
      * @param checkingTopics The set of topics to check.
      */
-    private void loadJobs( final String queueName, final Set<String> checkingTopics,
-            final StatisticsManager statisticsManager) {
+    private void loadJobs(
+            final String queueName, final Set<String> checkingTopics, final StatisticsManager statisticsManager) {
         logger.debug("Starting jobs loading from {}...", checkingTopics);
 
         final Map<String, List<JobImpl>> topicCache = new HashMap<String, List<JobImpl>>();
@@ -225,11 +228,11 @@ public class QueueJobCache {
         try {
             final Resource baseResource = resolver.getResource(this.configuration.getLocalJobsPath());
             // sanity check - should never be null
-            if ( baseResource != null ) {
-                for(final String topic : checkingTopics) {
+            if (baseResource != null) {
+                for (final String topic : checkingTopics) {
 
                     final Resource topicResource = baseResource.getChild(topic.replace('/', '.'));
-                    if ( topicResource != null ) {
+                    if (topicResource != null) {
                         topicCache.put(topic, loadJobs(queueName, topic, topicResource, statisticsManager));
                     }
                 }
@@ -247,9 +250,8 @@ public class QueueJobCache {
      * @param topicCache The topic based cache
      */
     private void orderTopics(final Map<String, List<JobImpl>> topicCache) {
-        if ( this.queueType == Type.ORDERED
-             || this.queueType == Type.UNORDERED) {
-            for(final List<JobImpl> list : topicCache.values()) {
+        if (this.queueType == Type.ORDERED || this.queueType == Type.UNORDERED) {
+            for (final List<JobImpl> list : topicCache.values()) {
                 this.cache.addAll(list);
             }
             Collections.sort(this.cache);
@@ -258,15 +260,15 @@ public class QueueJobCache {
             boolean done = true;
             do {
                 done = true;
-                for(final Map.Entry<String, List<JobImpl>> entry : topicCache.entrySet()) {
-                    if ( !entry.getValue().isEmpty() ) {
+                for (final Map.Entry<String, List<JobImpl>> entry : topicCache.entrySet()) {
+                    if (!entry.getValue().isEmpty()) {
                         this.cache.add(entry.getValue().remove(0));
-                        if ( !entry.getValue().isEmpty() ) {
+                        if (!entry.getValue().isEmpty()) {
                             done = false;
                         }
                     }
                 }
-            } while ( !done ) ;
+            } while (!done);
         }
     }
 
@@ -276,7 +278,9 @@ public class QueueJobCache {
      * @param topicResource The parent resource of the jobs
      * @return The cache which will be filled with the jobs.
      */
-    private List<JobImpl> loadJobs(final String queueName, final String topic,
+    private List<JobImpl> loadJobs(
+            final String queueName,
+            final String topic,
             final Resource topicResource,
             final StatisticsManager statisticsManager) {
         logger.debug("Loading jobs from topic {}", topic);
@@ -289,43 +293,43 @@ public class QueueJobCache {
 
             @Override
             public boolean handle(final JobImpl job) {
-                if ( job.getProcessingStarted() == null && !job.hasReadErrors() ) {
+                if (job.getProcessingStarted() == null && !job.hasReadErrors()) {
                     list.add(job);
                     statisticsManager.jobQueued(queueName, topic);
-                    if ( list.size() == maxPreloadLimit ) {
+                    if (list.size() == maxPreloadLimit) {
                         scanTopic.set(true);
                     }
-                } else if ( job.getProcessingStarted() != null ) {
+                } else if (job.getProcessingStarted() != null) {
                     logger.debug("Ignoring job {} - processing already started.", job);
                 } else {
                     // error reading job
-                    switch( job.getReadErrorType() ) {
-                    case CLASSNOTFOUNDEXCEPTION : {
-                        haltTopic.set(true);
-                        break;
-                    }
-                    case RUNTIMEEXCEPTION : {
-                        scanTopic.set(true);
-                        logger.debug("Failing job {} due to unrecoverable read errors.", job);
-                        final JobHandler handler = new JobHandler(job, null, configuration);
-                        handler.finished(JobState.ERROR, true, null);
-                        break;
-                    }
-                    default: {
-                        scanTopic.set(true);
-                        logger.debug("Ignoring job {} due to recoverable read errors.", job);
-                    }
+                    switch (job.getReadErrorType()) {
+                        case CLASSNOTFOUNDEXCEPTION: {
+                            haltTopic.set(true);
+                            break;
+                        }
+                        case RUNTIMEEXCEPTION: {
+                            scanTopic.set(true);
+                            logger.debug("Failing job {} due to unrecoverable read errors.", job);
+                            final JobHandler handler = new JobHandler(job, null, configuration);
+                            handler.finished(JobState.ERROR, true, null);
+                            break;
+                        }
+                        default: {
+                            scanTopic.set(true);
+                            logger.debug("Ignoring job {} due to recoverable read errors.", job);
+                        }
                     }
                 }
                 return list.size() < maxPreloadLimit;
             }
         });
-        if ( haltTopic.get() ) {
-            synchronized ( this.topicsWithNewJobs ) {
+        if (haltTopic.get()) {
+            synchronized (this.topicsWithNewJobs) {
                 this.newlyHaltedTopics.add(topic);
             }
-        } else if ( scanTopic.get() ) {
-            synchronized ( this.topicsWithNewJobs ) {
+        } else if (scanTopic.get()) {
+            synchronized (this.topicsWithNewJobs) {
                 this.topicsWithNewJobs.add(topic);
             }
         }
@@ -340,10 +344,11 @@ public class QueueJobCache {
      */
     public void handleNewTopics(final Set<String> topics) {
         logger.debug("Update cache to handle new event for topics {}", topics);
-        synchronized ( this.topicsWithNewJobs ) {
+        synchronized (this.topicsWithNewJobs) {
             final Set<String> nonHaltedTopics = new HashSet<>(topics);
             if (!Collections.disjoint(topics, newlyHaltedTopics)) {
-                logger.warn("handleNewTopics : sets not disjoint as expected. topics: " + topics + ", newlyHaltedTopics: " + newlyHaltedTopics);
+                logger.warn("handleNewTopics : sets not disjoint as expected. topics: " + topics
+                        + ", newlyHaltedTopics: " + newlyHaltedTopics);
                 nonHaltedTopics.removeAll(newlyHaltedTopics);
             }
             this.topicsWithNewJobs.addAll(nonHaltedTopics);
@@ -358,10 +363,11 @@ public class QueueJobCache {
      * @param handler The job handler
      * @param statisticsManager The statistics manager
      */
-    public void reschedule(final String queueName, final JobHandler handler, final StatisticsManager statisticsManager) {
-        synchronized ( this.cache ) {
-            if ( handler.reschedule() ) {
-                if ( this.queueType == Type.ORDERED ) {
+    public void reschedule(
+            final String queueName, final JobHandler handler, final StatisticsManager statisticsManager) {
+        synchronized (this.cache) {
+            if (handler.reschedule()) {
+                if (this.queueType == Type.ORDERED) {
                     this.cache.add(0, handler.getJob());
                 } else {
                     this.cache.add(handler.getJob());
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/queues/QueueManager.java b/src/main/java/org/apache/sling/event/impl/jobs/queues/QueueManager.java
index d1fbd7f..127def4 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/queues/QueueManager.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/queues/QueueManager.java
@@ -66,25 +66,29 @@ import org.osgi.service.event.EventHandler;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-
 /**
  * Implementation of the queue manager.
  */
-@Component(immediate=true,
-           service={Runnable.class, QueueManager.class, EventHandler.class},
-           property={
-                   Scheduler.PROPERTY_SCHEDULER_PERIOD + ":Long=60",
-                   Scheduler.PROPERTY_SCHEDULER_CONCURRENT + ":Boolean=false",
-                   Scheduler.PROPERTY_SCHEDULER_THREAD_POOL + "=" + ScheduleInfoImpl.EVENTING_THREADPOOL_NAME,
-                   EventConstants.EVENT_TOPIC + "=" + NotificationConstants.TOPIC_JOB_ADDED,
-                   Constants.SERVICE_VENDOR + "=The Apache Software Foundation"
-           })
-public class QueueManager
-    implements Runnable, EventHandler, ConfigurationChangeListener {
-
-    public static QueueManager newForTest(EventAdmin eventAdmin, JobConsumerManager jobConsumerManager,
-            QueuesMBean queuesMBean, ThreadPoolManager threadPoolManager, ThreadPool threadPool,
-            JobManagerConfiguration configuration, StatisticsManager statisticsManager) {
+@Component(
+        immediate = true,
+        service = {Runnable.class, QueueManager.class, EventHandler.class},
+        property = {
+            Scheduler.PROPERTY_SCHEDULER_PERIOD + ":Long=60",
+            Scheduler.PROPERTY_SCHEDULER_CONCURRENT + ":Boolean=false",
+            Scheduler.PROPERTY_SCHEDULER_THREAD_POOL + "=" + ScheduleInfoImpl.EVENTING_THREADPOOL_NAME,
+            EventConstants.EVENT_TOPIC + "=" + NotificationConstants.TOPIC_JOB_ADDED,
+            Constants.SERVICE_VENDOR + "=The Apache Software Foundation"
+        })
+public class QueueManager implements Runnable, EventHandler, ConfigurationChangeListener {
+
+    public static QueueManager newForTest(
+            EventAdmin eventAdmin,
+            JobConsumerManager jobConsumerManager,
+            QueuesMBean queuesMBean,
+            ThreadPoolManager threadPoolManager,
+            ThreadPool threadPool,
+            JobManagerConfiguration configuration,
+            StatisticsManager statisticsManager) {
         final QueueManager qm = new QueueManager();
         qm.eventAdmin = eventAdmin;
         qm.jobConsumerManager = jobConsumerManager;
@@ -99,7 +103,7 @@ public class QueueManager
     /** Default logger. */
     private final Logger logger = LoggerFactory.getLogger(this.getClass());
 
-    @Reference(policyOption=ReferencePolicyOption.GREEDY)
+    @Reference(policyOption = ReferencePolicyOption.GREEDY)
     private EventAdmin eventAdmin;
 
     @Reference
@@ -108,13 +112,13 @@ public class QueueManager
     @Reference
     private QueuesMBean queuesMBean;
 
-    @Reference(policyOption=ReferencePolicyOption.GREEDY)
+    @Reference(policyOption = ReferencePolicyOption.GREEDY)
     private ThreadPoolManager threadPoolManager;
 
     /**
      * Our thread pool.
      */
-    @Reference(service=EventingThreadPool.class)
+    @Reference(service = EventingThreadPool.class)
     private ThreadPool threadPool;
 
     /** The job manager configuration. */
@@ -173,11 +177,11 @@ public class QueueManager
 
         this.configuration.removeListener(this);
         final Iterator<JobQueueImpl> i = this.queues.values().iterator();
-        while ( i.hasNext() ) {
+        while (i.hasNext()) {
             final JobQueueImpl jbq = i.next();
             jbq.close();
             // update mbeans
-            ((QueuesMBeanImpl)queuesMBean).sendEvent(new QueueStatusEvent(null, jbq));
+            ((QueuesMBeanImpl) queuesMBean).sendEvent(new QueueStatusEvent(null, jbq));
         }
         this.queues.clear();
         this.queueServices = null;
@@ -195,36 +199,37 @@ public class QueueManager
         logger.debug("Queue manager maintenance: Starting #{}", this.schedulerRuns);
 
         // queue maintenance
-        if ( this.isActive.get() ) {
-            for(final JobQueueImpl jbq : this.queues.values() ) {
+        if (this.isActive.get()) {
+            for (final JobQueueImpl jbq : this.queues.values()) {
                 jbq.maintain();
             }
         }
 
         // full topic scan is done every third run
-        if ( schedulerRuns % 3 == 0 && this.isActive.get() ) {
+        if (schedulerRuns % 3 == 0 && this.isActive.get()) {
             this.fullTopicScan();
         }
 
         // we only do a full clean up on every fifth run
         final boolean doFullCleanUp = (schedulerRuns % 5 == 0);
 
-        if ( doFullCleanUp ) {
+        if (doFullCleanUp) {
             // check for idle queue
             logger.debug("Checking for idle queues...");
 
-           // we synchronize to avoid creating a queue which is about to be removed during cleanup
-            synchronized ( queuesLock ) {
-                final Iterator<Map.Entry<String, JobQueueImpl>> i = this.queues.entrySet().iterator();
-                while ( i.hasNext() ) {
+            // we synchronize to avoid creating a queue which is about to be removed during cleanup
+            synchronized (queuesLock) {
+                final Iterator<Map.Entry<String, JobQueueImpl>> i =
+                        this.queues.entrySet().iterator();
+                while (i.hasNext()) {
                     final Map.Entry<String, JobQueueImpl> current = i.next();
                     final JobQueueImpl jbq = current.getValue();
-                    if ( jbq.tryToClose() ) {
+                    if (jbq.tryToClose()) {
                         logger.debug("Removing idle job queue {}", jbq);
                         // remove
                         i.remove();
                         // update mbeans
-                        ((QueuesMBeanImpl)queuesMBean).sendEvent(new QueueStatusEvent(null, jbq));
+                        ((QueuesMBeanImpl) queuesMBean).sendEvent(new QueueStatusEvent(null, jbq));
                     }
                 }
             }
@@ -240,8 +245,7 @@ public class QueueManager
      * @param queueInfo The queue info
      * @param topics The topics
      */
-    private void start(final QueueInfo queueInfo,
-                       final Set<String> topics) {
+    private void start(final QueueInfo queueInfo, final Set<String> topics) {
         final InternalQueueConfiguration config = queueInfo.queueConfiguration;
         final Set<String> filteredTopics = new HashSet<String>(topics);
         filteredTopics.removeAll(haltedTopics);
@@ -250,28 +254,29 @@ public class QueueManager
         boolean isNewQueue = false;
         JobQueueImpl queue = null;
         // we synchronize to avoid creating a queue which is about to be removed during cleanup
-        synchronized ( queuesLock ) {
+        synchronized (queuesLock) {
             queue = this.queues.get(queueInfo.queueName);
             // check for reconfiguration, we really do an identity check here(!)
-            if ( queue != null && queue.getConfiguration() != config ) {
+            if (queue != null && queue.getConfiguration() != config) {
                 this.outdateQueue(queue);
                 // we use a new queue with the configuration
                 queue = null;
             }
-            if ( queue == null ) {
+            if (queue == null) {
                 final OutdatedJobQueueInfo outdatedQueueInfo = outdatedQueues.get(queueInfo.queueName);
-                queue = JobQueueImpl.createQueue(queueInfo.queueName, config, queueServices, filteredTopics, haltedTopics, outdatedQueueInfo);
+                queue = JobQueueImpl.createQueue(
+                        queueInfo.queueName, config, queueServices, filteredTopics, haltedTopics, outdatedQueueInfo);
                 // on startup the queue might be empty and we get null back from createQueue
-                if ( queue != null ) {
+                if (queue != null) {
                     isNewQueue = true;
                     queues.put(queueInfo.queueName, queue);
-                    ((QueuesMBeanImpl)queuesMBean).sendEvent(new QueueStatusEvent(queue, null));
+                    ((QueuesMBeanImpl) queuesMBean).sendEvent(new QueueStatusEvent(queue, null));
                 }
             }
         }
-        if ( queue != null ) {
+        if (queue != null) {
             logger.debug("Starting queue {}", queueInfo.queueName);
-            if ( !isNewQueue ) {
+            if (!isNewQueue) {
                 queue.wakeUpQueue(filteredTopics);
             }
             queue.startJobs();
@@ -297,21 +302,21 @@ public class QueueManager
             outdatedQueues.put(oldName, oldQueue.getOutdatedJobQueueInfo());
         }
         // check if we can close or have to rename
-        if ( queue.tryToClose() ) {
+        if (queue.tryToClose()) {
             // copy statistics
             // update mbeans
-            ((QueuesMBeanImpl)queuesMBean).sendEvent(new QueueStatusEvent(null, queue));
+            ((QueuesMBeanImpl) queuesMBean).sendEvent(new QueueStatusEvent(null, queue));
         } else {
             queue.outdate();
             // readd with new name
             String newName = ResourceHelper.filterName(queue.getName());
             int index = 0;
-            while ( this.queues.containsKey(newName) ) {
+            while (this.queues.containsKey(newName)) {
                 newName = ResourceHelper.filterName(queue.getName()) + '$' + String.valueOf(index++);
             }
             this.queues.put(newName, queue);
             // update mbeans
-            ((QueuesMBeanImpl)queuesMBean).sendEvent(new QueueStatusEvent(queue, queue));
+            ((QueuesMBeanImpl) queuesMBean).sendEvent(new QueueStatusEvent(queue, queue));
         }
     }
 
@@ -320,18 +325,18 @@ public class QueueManager
      */
     private void restart() {
         // let's rename/close all queues and clear them
-        synchronized ( queuesLock ) {
+        synchronized (queuesLock) {
             final List<JobQueueImpl> queues = new ArrayList<>(this.queues.values());
-            for(final JobQueueImpl queue : queues ) {
+            for (final JobQueueImpl queue : queues) {
                 this.outdateQueue(queue);
             }
         }
         // check if we're still active
         final JobManagerConfiguration config = this.configuration;
-        if ( config != null ) {
+        if (config != null) {
             final List<Job> rescheduleList = this.configuration.clearJobRetryList();
-            for(final Job j : rescheduleList) {
-                final JobHandler jh = new JobHandler((JobImpl)j, null, this.configuration);
+            for (final Job j : rescheduleList) {
+                final JobHandler jh = new JobHandler((JobImpl) j, null, this.configuration);
                 jh.reschedule();
             }
         }
@@ -384,12 +389,13 @@ public class QueueManager
     @Override
     public void configurationChanged(final boolean active) {
         // are we still active?
-        if ( this.configuration != null ) {
+        if (this.configuration != null) {
             boolean isActive = active && configuration.isJobProcessingEnabled();
-            logger.debug("Topology changed {}, job processing enabled: {}", active, configuration.isJobProcessingEnabled());
+            logger.debug(
+                    "Topology changed {}, job processing enabled: {}", active, configuration.isJobProcessingEnabled());
             this.isActive.set(isActive);
             clearHaltedTopics("configurationChanged : unhalted topics due to configuration change");
-            if ( isActive ) {
+            if (isActive) {
                 fullTopicScan();
             } else {
                 // Only stop jobs if readiness condition is not met
@@ -416,8 +422,8 @@ public class QueueManager
         final String haltedTopicsToString;
         // Note: the synchronized below is just to avoid wrong logging about unhalting,
         // the haltedTopics access itself isn't prevented by this (and it is a concurrent set)
-        synchronized( haltedTopics ) {
-            if ( haltedTopics.isEmpty() ) {
+        synchronized (haltedTopics) {
+            if (haltedTopics.isEmpty()) {
                 return;
             }
             haltedTopicsToString = haltedTopics.toString();
@@ -431,7 +437,7 @@ public class QueueManager
         final Set<String> topics = this.scanTopics();
         final Map<QueueInfo, Set<String>> mapping = this.updateTopicMapping(topics);
         // start queues
-        for(final Map.Entry<QueueInfo, Set<String>> entry : mapping.entrySet() ) {
+        for (final Map.Entry<QueueInfo, Set<String>> entry : mapping.entrySet()) {
             this.start(entry.getKey(), entry.getValue());
         }
     }
@@ -447,9 +453,9 @@ public class QueueManager
             final Resource baseResource = resolver.getResource(this.configuration.getLocalJobsPath());
 
             // sanity check - should never be null
-            if ( baseResource != null ) {
+            if (baseResource != null) {
                 final Iterator<Resource> topicIter = baseResource.listChildren();
-                while ( topicIter.hasNext() ) {
+                while (topicIter.hasNext()) {
                     final Resource topicResource = topicIter.next();
                     final String topic = topicResource.getName().replace('.', '/');
                     logger.debug("Found topic {}", topic);
@@ -467,14 +473,15 @@ public class QueueManager
      */
     @Override
     public void handleEvent(final Event event) {
-        if ( ResourceHelper.BUNDLE_EVENT_STARTED.equals(event.getTopic())
-                || ResourceHelper.BUNDLE_EVENT_UPDATED.equals(event.getTopic()) ) {
+        if (ResourceHelper.BUNDLE_EVENT_STARTED.equals(event.getTopic())
+                || ResourceHelper.BUNDLE_EVENT_UPDATED.equals(event.getTopic())) {
             clearHaltedTopics("handleEvent: unhalted topics due to bundle started/updated event");
-       }
-        final String topic = (String)event.getProperty(NotificationConstants.NOTIFICATION_PROPERTY_JOB_TOPIC);
-        if ( this.isActive.get() && topic != null ) {
+        }
+        final String topic = (String) event.getProperty(NotificationConstants.NOTIFICATION_PROPERTY_JOB_TOPIC);
+        if (this.isActive.get() && topic != null) {
             logger.debug("Received event {}", topic);
-            final QueueInfo info = this.configuration.getQueueConfigurationManager().getQueueInfo(topic);
+            final QueueInfo info =
+                    this.configuration.getQueueConfigurationManager().getQueueInfo(topic);
             this.start(info, Collections.singleton(topic));
         }
     }
@@ -484,10 +491,11 @@ public class QueueManager
      */
     private Map<QueueInfo, Set<String>> updateTopicMapping(final Set<String> topics) {
         final Map<QueueInfo, Set<String>> mapping = new HashMap<>();
-        for(final String topic : topics) {
-            final QueueInfo queueInfo = this.configuration.getQueueConfigurationManager().getQueueInfo(topic);
+        for (final String topic : topics) {
+            final QueueInfo queueInfo =
+                    this.configuration.getQueueConfigurationManager().getQueueInfo(topic);
             Set<String> queueTopics = mapping.get(queueInfo);
-            if ( queueTopics == null ) {
+            if (queueTopics == null) {
                 queueTopics = new HashSet<>();
                 mapping.put(queueInfo, queueTopics);
             }
@@ -503,7 +511,7 @@ public class QueueManager
     }
 
     protected void unbindThreadPool(final EventingThreadPool etp) {
-        if ( this.threadPool == etp ) {
+        if (this.threadPool == etp) {
             this.threadPool = null;
         }
     }
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/scheduling/JobScheduleBuilderImpl.java b/src/main/java/org/apache/sling/event/impl/jobs/scheduling/JobScheduleBuilderImpl.java
index 27f83c7..24c3592 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/scheduling/JobScheduleBuilderImpl.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/scheduling/JobScheduleBuilderImpl.java
@@ -26,15 +26,15 @@ import java.util.Map;
 
 import org.apache.sling.event.impl.support.ScheduleInfoImpl;
 import org.apache.sling.event.jobs.JobBuilder.ScheduleBuilder;
+import org.apache.sling.event.jobs.ScheduledJobInfo;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.apache.sling.event.jobs.ScheduledJobInfo;
 
 /**
  * The builder implementation for scheduled jobs.
  */
 public final class JobScheduleBuilderImpl implements ScheduleBuilder {
-    
+
     private final Logger logger = LoggerFactory.getLogger(JobScheduleBuilderImpl.class);
 
     private final String topic;
@@ -113,12 +113,7 @@ public final class JobScheduleBuilderImpl implements ScheduleBuilder {
         if (scheduleName == null) {
             finalScheduleName = deriveScheduleName();
         }
-        return this.jobScheduler.addScheduledJob(topic,
-                properties,
-                finalScheduleName,
-                suspend,
-                schedules,
-                errors);
+        return this.jobScheduler.addScheduledJob(topic, properties, finalScheduleName, suspend, schedules, errors);
     }
 
     @Override
@@ -134,15 +129,13 @@ public final class JobScheduleBuilderImpl implements ScheduleBuilder {
      */
     private String deriveScheduleName() {
         StringBuilder sb = new StringBuilder();
-        sb.append("topic=").append(topic)
-            .append(",suspend=").append(suspend)
-            .append(",");
+        sb.append("topic=").append(topic).append(",suspend=").append(suspend).append(",");
 
         if (properties != null) {
             // sort the properties and flatten them into a string
             List<String> keys = new ArrayList<>(properties.keySet());
             Collections.sort(keys);
-            for (String key: keys) {
+            for (String key : keys) {
                 sb.append(key).append("=").append(properties.get(key)).append(",");
             }
         }
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/scheduling/JobSchedulerImpl.java b/src/main/java/org/apache/sling/event/impl/jobs/scheduling/JobSchedulerImpl.java
index 7c4ce45..f3b82db 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/scheduling/JobSchedulerImpl.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/scheduling/JobSchedulerImpl.java
@@ -52,7 +52,6 @@ import org.osgi.service.event.Event;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-
 /**
  * The scheduler for managing scheduled jobs.
  *
@@ -61,9 +60,10 @@ import org.slf4j.LoggerFactory;
  * the events to this service.
  */
 public class JobSchedulerImpl
-    implements ConfigurationChangeListener,
-               ResourceChangeListener, ExternalResourceChangeListener,
-               org.apache.sling.commons.scheduler.Job {
+        implements ConfigurationChangeListener,
+                ResourceChangeListener,
+                ExternalResourceChangeListener,
+                org.apache.sling.commons.scheduler.Job {
 
     private static final String PROPERTY_READ_JOB = "properties";
 
@@ -96,9 +96,8 @@ public class JobSchedulerImpl
      * @param scheduler The scheduler service
      * @param jobManager The job manager
      */
-    public JobSchedulerImpl(final JobManagerConfiguration configuration,
-            final Scheduler scheduler,
-            final JobManagerImpl jobManager) {
+    public JobSchedulerImpl(
+            final JobManagerConfiguration configuration, final Scheduler scheduler, final JobManagerImpl jobManager) {
         this.configuration = configuration;
         this.scheduler = scheduler;
         this.jobManager = jobManager;
@@ -116,10 +115,10 @@ public class JobSchedulerImpl
 
         this.scheduledJobHandler.deactivate();
 
-        if ( this.active.compareAndSet(true, false) ) {
+        if (this.active.compareAndSet(true, false)) {
             this.stopScheduling();
         }
-        synchronized ( this.scheduledJobs ) {
+        synchronized (this.scheduledJobs) {
             this.scheduledJobs.clear();
         }
     }
@@ -134,9 +133,9 @@ public class JobSchedulerImpl
         // - configuration is still available and active
         // - and current instance is leader
         final boolean schedulingActive;
-        if ( processingActive ) {
+        if (processingActive) {
             final TopologyCapabilities caps = this.configuration.getTopologyCapabilities();
-            if ( caps != null && caps.isActive() ) {
+            if (caps != null && caps.isActive()) {
                 schedulingActive = caps.isLeader();
             } else {
                 schedulingActive = false;
@@ -146,14 +145,14 @@ public class JobSchedulerImpl
         }
 
         // switch activation based on current state and new state
-        if ( schedulingActive ) {
+        if (schedulingActive) {
             // activate if inactive
-            if ( this.active.compareAndSet(false, true) ) {
+            if (this.active.compareAndSet(false, true)) {
                 this.startScheduling();
             }
         } else {
             // deactivate if active
-            if ( this.active.compareAndSet(true, false) ) {
+            if (this.active.compareAndSet(true, false)) {
                 this.stopScheduling();
             }
         }
@@ -163,9 +162,9 @@ public class JobSchedulerImpl
      * Start all scheduled jobs
      */
     private void startScheduling() {
-        synchronized ( this.scheduledJobs ) {
-            for(final ScheduledJobInfo info : this.scheduledJobs.values()) {
-                this.startScheduledJob(((ScheduledJobInfoImpl)info));
+        synchronized (this.scheduledJobs) {
+            for (final ScheduledJobInfo info : this.scheduledJobs.values()) {
+                this.startScheduledJob(((ScheduledJobInfoImpl) info));
             }
         }
     }
@@ -174,9 +173,9 @@ public class JobSchedulerImpl
      * Stop all scheduled jobs.
      */
     private void stopScheduling() {
-        synchronized ( this.scheduledJobs ) {
-            for(final ScheduledJobInfo info : this.scheduledJobs.values()) {
-                this.stopScheduledJob((ScheduledJobInfoImpl)info);
+        synchronized (this.scheduledJobs) {
+            for (final ScheduledJobInfo info : this.scheduledJobs.values()) {
+                this.stopScheduledJob((ScheduledJobInfoImpl) info);
             }
         }
     }
@@ -185,7 +184,7 @@ public class JobSchedulerImpl
      * Add a scheduled job
      */
     public void scheduleJob(final ScheduledJobInfoImpl info) {
-        synchronized ( this.scheduledJobs ) {
+        synchronized (this.scheduledJobs) {
             this.scheduledJobs.put(info.getName(), info);
             this.startScheduledJob(info);
         }
@@ -195,8 +194,8 @@ public class JobSchedulerImpl
      * Unschedule a scheduled job
      */
     public void unscheduleJob(final ScheduledJobInfoImpl info) {
-        synchronized ( this.scheduledJobs ) {
-            if ( this.scheduledJobs.remove(info.getName()) != null ) {
+        synchronized (this.scheduledJobs) {
+            if (this.scheduledJobs.remove(info.getName()) != null) {
                 this.stopScheduledJob(info);
             }
         }
@@ -215,47 +214,50 @@ public class JobSchedulerImpl
      * @param info The scheduling info
      */
     private void startScheduledJob(final ScheduledJobInfoImpl info) {
-        if ( this.active.get() ) {
-            if ( !info.isSuspended() ) {
-                this.configuration.getAuditLogger().debug("SCHEDULED OK name={}, topic={}, properties={} : {}",
-                        new Object[] {info.getName(),
-                                      info.getJobTopic(),
-                                      info.getJobProperties()},
-                                      info.getSchedules());
+        if (this.active.get()) {
+            if (!info.isSuspended()) {
+                this.configuration
+                        .getAuditLogger()
+                        .debug(
+                                "SCHEDULED OK name={}, topic={}, properties={} : {}",
+                                new Object[] {info.getName(), info.getJobTopic(), info.getJobProperties()},
+                                info.getSchedules());
                 int index = 0;
-                for(final ScheduleInfo si : info.getSchedules()) {
+                for (final ScheduleInfo si : info.getSchedules()) {
                     final String name = info.getSchedulerJobId() + "-" + String.valueOf(index);
                     ScheduleOptions options = null;
-                    switch ( si.getType() ) {
+                    switch (si.getType()) {
                         case DAILY:
                         case WEEKLY:
                         case HOURLY:
                         case MONTHLY:
                         case YEARLY:
                         case CRON:
-                            options = this.scheduler.EXPR(((ScheduleInfoImpl)si).getCronExpression());
+                            options = this.scheduler.EXPR(((ScheduleInfoImpl) si).getCronExpression());
 
                             break;
                         case DATE:
-                            options = this.scheduler.AT(((ScheduleInfoImpl)si).getNextScheduledExecution());
+                            options = this.scheduler.AT(((ScheduleInfoImpl) si).getNextScheduledExecution());
                             break;
                     }
                     // Create configuration for scheduled job
                     final Map<String, Serializable> config = new HashMap<>();
                     config.put(PROPERTY_READ_JOB, info);
                     config.put(PROPERTY_SCHEDULE_INDEX, index);
-                    this.scheduler.schedule(this, options.name(name)
-                                                         .config(config)
-                                                         .canRunConcurrently(false)
-                                                         .threadPoolName(ScheduleInfoImpl.EVENTING_THREADPOOL_NAME));
+                    this.scheduler.schedule(
+                            this,
+                            options.name(name)
+                                    .config(config)
+                                    .canRunConcurrently(false)
+                                    .threadPoolName(ScheduleInfoImpl.EVENTING_THREADPOOL_NAME));
                     index++;
                 }
             } else {
-                this.configuration.getAuditLogger().debug("SCHEDULED SUSPENDED name={}, topic={}, properties={} : {}",
-                        new Object[] {info.getName(),
-                                      info.getJobTopic(),
-                                      info.getJobProperties(),
-                                      info.getSchedules()});
+                this.configuration
+                        .getAuditLogger()
+                        .debug("SCHEDULED SUSPENDED name={}, topic={}, properties={} : {}", new Object[] {
+                            info.getName(), info.getJobTopic(), info.getJobProperties(), info.getSchedules()
+                        });
             }
         }
     }
@@ -266,13 +268,13 @@ public class JobSchedulerImpl
      */
     private void stopScheduledJob(final ScheduledJobInfoImpl info) {
         final Scheduler localScheduler = this.scheduler;
-        if ( localScheduler != null ) {
-            this.configuration.getAuditLogger().debug("SCHEDULED STOP name={}, topic={}, properties={} : {}",
-                    new Object[] {info.getName(),
-                                  info.getJobTopic(),
-                                  info.getJobProperties(),
-                                  info.getSchedules()});
-            for(int index = 0; index<info.getSchedules().size(); index++) {
+        if (localScheduler != null) {
+            this.configuration
+                    .getAuditLogger()
+                    .debug("SCHEDULED STOP name={}, topic={}, properties={} : {}", new Object[] {
+                        info.getName(), info.getJobTopic(), info.getJobProperties(), info.getSchedules()
+                    });
+            for (int index = 0; index < info.getSchedules().size(); index++) {
                 final String name = info.getSchedulerJobId() + "-" + String.valueOf(index);
                 localScheduler.unschedule(name);
             }
@@ -284,33 +286,34 @@ public class JobSchedulerImpl
      */
     @Override
     public void execute(final JobContext context) {
-        if ( !active.get() ) {
+        if (!active.get()) {
             // not active anymore, simply return
             return;
         }
-        final ScheduledJobInfoImpl info = (ScheduledJobInfoImpl) context.getConfiguration().get(PROPERTY_READ_JOB);
+        final ScheduledJobInfoImpl info =
+                (ScheduledJobInfoImpl) context.getConfiguration().get(PROPERTY_READ_JOB);
 
-        if ( info.isSuspended() ) {
+        if (info.isSuspended()) {
             return;
         }
 
         this.jobManager.addJob(info.getJobTopic(), info.getJobProperties());
-        final int index = (Integer)context.getConfiguration().get(PROPERTY_SCHEDULE_INDEX);
+        final int index = (Integer) context.getConfiguration().get(PROPERTY_SCHEDULE_INDEX);
         final Iterator<ScheduleInfo> iter = info.getSchedules().iterator();
         ScheduleInfo si = iter.next();
-        for(int i=0; i<index; i++) {
+        for (int i = 0; i < index; i++) {
             si = iter.next();
         }
         // if scheduled once (DATE), remove from schedule
-        if ( si.getType() == ScheduleType.DATE ) {
-            if ( index == 0 && info.getSchedules().size() == 1 ) {
+        if (si.getType() == ScheduleType.DATE) {
+            if (index == 0 && info.getSchedules().size() == 1) {
                 // remove
                 this.scheduledJobHandler.remove(info);
             } else {
                 // update schedule list
                 final List<ScheduleInfo> infos = new ArrayList<>();
-                for(final ScheduleInfo i : info.getSchedules() ) {
-                    if ( i != si ) { // no need to use equals
+                for (final ScheduleInfo i : info.getSchedules()) {
+                    if (i != si) { // no need to use equals
                         infos.add(i);
                     }
                 }
@@ -324,8 +327,8 @@ public class JobSchedulerImpl
      * @see org.osgi.service.event.EventHandler#handleEvent(org.osgi.service.event.Event)
      */
     public void handleEvent(final Event event) {
-        if ( ResourceHelper.BUNDLE_EVENT_STARTED.equals(event.getTopic())
-             || ResourceHelper.BUNDLE_EVENT_UPDATED.equals(event.getTopic()) ) {
+        if (ResourceHelper.BUNDLE_EVENT_STARTED.equals(event.getTopic())
+                || ResourceHelper.BUNDLE_EVENT_UPDATED.equals(event.getTopic())) {
             this.scheduledJobHandler.bundleEvent();
         }
     }
@@ -335,7 +338,7 @@ public class JobSchedulerImpl
      * @param e
      */
     private void ignoreException(final Exception e) {
-        if ( this.logger.isDebugEnabled() ) {
+        if (this.logger.isDebugEnabled()) {
             this.logger.debug("Ignored exception " + e.getMessage(), e);
         }
     }
@@ -344,8 +347,8 @@ public class JobSchedulerImpl
      * Create a schedule builder for a currently scheduled job
      */
     public JobBuilder.ScheduleBuilder createJobBuilder(final ScheduledJobInfoImpl info) {
-        final JobBuilder.ScheduleBuilder sb = new JobScheduleBuilderImpl(info.getJobTopic(),
-                info.getJobProperties(), info.getName(), this);
+        final JobBuilder.ScheduleBuilder sb =
+                new JobScheduleBuilderImpl(info.getJobTopic(), info.getJobProperties(), info.getName(), this);
         return (info.isSuspended() ? sb.suspend() : sb);
     }
 
@@ -361,27 +364,27 @@ public class JobSchedulerImpl
      * Check if the job matches the template
      */
     private boolean match(final ScheduledJobInfoImpl job, final Map<String, Object> template) {
-        if ( template != null ) {
-            for(final Map.Entry<String, Object> current : template.entrySet()) {
+        if (template != null) {
+            for (final Map.Entry<String, Object> current : template.entrySet()) {
                 final String key = current.getKey();
                 final char firstChar = key.length() > 0 ? key.charAt(0) : 0;
                 final String propName;
                 final Operation op;
-                if ( firstChar == '=' ) {
+                if (firstChar == '=') {
                     propName = key.substring(1);
-                    op  = Operation.EQUALS;
-                } else if ( firstChar == '<' ) {
+                    op = Operation.EQUALS;
+                } else if (firstChar == '<') {
                     final char secondChar = key.length() > 1 ? key.charAt(1) : 0;
-                    if ( secondChar == '=' ) {
+                    if (secondChar == '=') {
                         op = Operation.LESS_OR_EQUALS;
                         propName = key.substring(2);
                     } else {
                         op = Operation.LESS;
                         propName = key.substring(1);
                     }
-                } else if ( firstChar == '>' ) {
+                } else if (firstChar == '>') {
                     final char secondChar = key.length() > 1 ? key.charAt(1) : 0;
-                    if ( secondChar == '=' ) {
+                    if (secondChar == '=') {
                         op = Operation.GREATER_OR_EQUALS;
                         propName = key.substring(2);
                     } else {
@@ -390,25 +393,26 @@ public class JobSchedulerImpl
                     }
                 } else {
                     propName = key;
-                    op  = Operation.EQUALS;
+                    op = Operation.EQUALS;
                 }
                 final Object value = current.getValue();
 
-                if ( op == Operation.EQUALS ) {
-                    if ( !value.equals(job.getJobProperties().get(propName)) ) {
+                if (op == Operation.EQUALS) {
+                    if (!value.equals(job.getJobProperties().get(propName))) {
                         return false;
                     }
                 } else {
-                    if ( value instanceof Comparable ) {
-                        @SuppressWarnings({ "unchecked", "rawtypes" })
-                        final int result = ((Comparable)value).compareTo(job.getJobProperties().get(propName));
-                        if ( op == Operation.LESS && result > -1 ) {
+                    if (value instanceof Comparable) {
+                        @SuppressWarnings({"unchecked", "rawtypes"})
+                        final int result = ((Comparable) value)
+                                .compareTo(job.getJobProperties().get(propName));
+                        if (op == Operation.LESS && result > -1) {
                             return false;
-                        } else if ( op == Operation.LESS_OR_EQUALS && result > 0 ) {
+                        } else if (op == Operation.LESS_OR_EQUALS && result > 0) {
                             return false;
-                        } else if ( op == Operation.GREATER_OR_EQUALS && result < 0 ) {
+                        } else if (op == Operation.GREATER_OR_EQUALS && result < 0) {
                             return false;
-                        } else if ( op == Operation.GREATER && result < 1 ) {
+                        } else if (op == Operation.GREATER && result < 1) {
                             return false;
                         }
                     } else {
@@ -424,30 +428,29 @@ public class JobSchedulerImpl
     /**
      * Get all scheduled jobs
      */
-    public Collection<ScheduledJobInfo> getScheduledJobs(final String topic,
-            final long limit,
-            final Map<String, Object>... templates) {
+    public Collection<ScheduledJobInfo> getScheduledJobs(
+            final String topic, final long limit, final Map<String, Object>... templates) {
         final List<ScheduledJobInfo> jobs = new ArrayList<>();
         long count = 0;
-        synchronized ( this.scheduledJobs ) {
-            for(final ScheduledJobInfoImpl job : this.scheduledJobs.values() ) {
+        synchronized (this.scheduledJobs) {
+            for (final ScheduledJobInfoImpl job : this.scheduledJobs.values()) {
                 boolean add = true;
-                if ( topic != null && !topic.equals(job.getJobTopic()) ) {
+                if (topic != null && !topic.equals(job.getJobTopic())) {
                     add = false;
                 }
-                if ( add && templates != null && templates.length != 0 ) {
+                if (add && templates != null && templates.length != 0) {
                     add = false;
-                    for (Map<String,Object> template : templates) {
+                    for (Map<String, Object> template : templates) {
                         add = this.match(job, template);
-                        if ( add ) {
+                        if (add) {
                             break;
                         }
                     }
                 }
-                if ( add ) {
+                if (add) {
                     jobs.add(job);
                     count++;
-                    if ( limit > 0 && count == limit ) {
+                    if (limit > 0 && count == limit) {
                         break;
                     }
                 }
@@ -455,14 +458,14 @@ public class JobSchedulerImpl
         }
         return jobs;
     }
-    
+
     /**
      * Provide the total number of jobs registered in the system, irrespective of topics
      * @return the total number of scheduled jobs
      */
     public int getTotalNumberOfScheduledJobs() {
         synchronized (this.scheduledJobs) {
-            return this.scheduledJobs.size(); 
+            return this.scheduledJobs.size();
         }
     }
 
@@ -479,16 +482,16 @@ public class JobSchedulerImpl
             final String path = sb.toString();
 
             final Resource eventResource = resolver.getResource(path);
-            if ( eventResource != null ) {
+            if (eventResource != null) {
                 final ModifiableValueMap mvm = eventResource.adaptTo(ModifiableValueMap.class);
-                if ( flag ) {
+                if (flag) {
                     mvm.put(ResourceHelper.PROPERTY_SCHEDULE_SUSPENDED, Boolean.TRUE);
                 } else {
                     mvm.remove(ResourceHelper.PROPERTY_SCHEDULE_SUSPENDED);
                 }
                 resolver.commit();
             }
-            if ( flag ) {
+            if (flag) {
                 this.stopScheduledJob(info);
             } else {
                 this.startScheduledJob(info);
@@ -511,43 +514,45 @@ public class JobSchedulerImpl
      * @param errors Optional list to contain potential errors
      * @return A new job info or {@code null}
      */
-    public ScheduledJobInfo addScheduledJob(final String topic,
+    public ScheduledJobInfo addScheduledJob(
+            final String topic,
             final Map<String, Object> properties,
             final String scheduleName,
             final boolean isSuspended,
             final List<ScheduleInfoImpl> scheduleInfos,
             final List<String> errors) {
         final List<String> msgs = new ArrayList<>();
-        if ( scheduleName == null || scheduleName.length() == 0 ) {
+        if (scheduleName == null || scheduleName.length() == 0) {
             msgs.add("Schedule name not specified");
         }
         final String errorMessage = Utility.checkJob(topic, properties);
-        if ( errorMessage != null ) {
+        if (errorMessage != null) {
             msgs.add(errorMessage);
         }
-        if ( scheduleInfos.size() == 0 ) {
+        if (scheduleInfos.size() == 0) {
             msgs.add("No schedule defined for " + scheduleName);
         }
-        for(final ScheduleInfoImpl info : scheduleInfos) {
+        for (final ScheduleInfoImpl info : scheduleInfos) {
             info.check(msgs);
         }
-        if ( msgs.size() == 0 ) {
+        if (msgs.size() == 0) {
             try {
-                final ScheduledJobInfo info = this.scheduledJobHandler.addOrUpdateJob(topic, properties, scheduleName, isSuspended, scheduleInfos);
-                if ( info != null ) {
+                final ScheduledJobInfo info = this.scheduledJobHandler.addOrUpdateJob(
+                        topic, properties, scheduleName, isSuspended, scheduleInfos);
+                if (info != null) {
                     return info;
                 }
                 msgs.add("Unable to persist scheduled job.");
-            } catch ( final PersistenceException pe) {
+            } catch (final PersistenceException pe) {
                 msgs.add("Unable to persist scheduled job: " + scheduleName);
                 logger.warn("Unable to persist scheduled job", pe);
             }
         } else {
-            for(final String msg : msgs) {
+            for (final String msg : msgs) {
                 logger.warn(msg);
             }
         }
-        if ( errors != null ) {
+        if (errors != null) {
             errors.addAll(msgs);
         }
         return null;
@@ -562,9 +567,10 @@ public class JobSchedulerImpl
      */
     @Override
     public void onChange(List<ResourceChange> changes) {
-        for(final ResourceChange change : changes ) {
-            if ( change.getPath() != null && change.getPath().startsWith(this.configuration.getScheduledJobsPath(true)) ) {
-                if ( change.getType() == ResourceChange.ChangeType.REMOVED ) {
+        for (final ResourceChange change : changes) {
+            if (change.getPath() != null
+                    && change.getPath().startsWith(this.configuration.getScheduledJobsPath(true))) {
+                if (change.getType() == ResourceChange.ChangeType.REMOVED) {
                     // removal
                     logger.debug("Remove scheduled job {}", change.getPath());
                     this.scheduledJobHandler.handleRemove(change.getPath());
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/scheduling/ScheduledJobHandler.java b/src/main/java/org/apache/sling/event/impl/jobs/scheduling/ScheduledJobHandler.java
index f925e4a..9e82945 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/scheduling/ScheduledJobHandler.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/scheduling/ScheduledJobHandler.java
@@ -77,8 +77,7 @@ public class ScheduledJobHandler implements Runnable {
     /**
      * @param configuration Current job manager configuration
      */
-    public ScheduledJobHandler(final JobManagerConfiguration configuration,
-            final JobSchedulerImpl jobScheduler) {
+    public ScheduledJobHandler(final JobManagerConfiguration configuration, final JobSchedulerImpl jobScheduler) {
         this.configuration = configuration;
         this.jobScheduler = jobScheduler;
         final Thread t = new Thread(this, "Apache Sling Scheduled Job Handler Thread");
@@ -117,7 +116,7 @@ public class ScheduledJobHandler implements Runnable {
         // put a NOP runnable to wake up the queue
         this.addTask(new Runnable() {
             @Override
-            public  void run() {
+            public void run() {
                 // do nothing
             }
         });
@@ -125,7 +124,7 @@ public class ScheduledJobHandler implements Runnable {
 
     @Override
     public void run() {
-        while ( this.isRunning.get() ) {
+        while (this.isRunning.get()) {
             Runnable r = null;
             try {
                 r = this.queue.take();
@@ -134,7 +133,7 @@ public class ScheduledJobHandler implements Runnable {
                 Thread.currentThread().interrupt();
                 this.isRunning.set(false);
             }
-            if ( this.isRunning.get() && r != null) {
+            if (this.isRunning.get() && r != null) {
                 r.run();
             }
         }
@@ -142,23 +141,23 @@ public class ScheduledJobHandler implements Runnable {
 
     private void scan() {
         final ResourceResolver resolver = configuration.createResourceResolver();
-        if ( resolver != null ) {
+        if (resolver != null) {
             try {
                 logger.debug("Scanning for scheduled jobs...");
                 final String path = this.configuration.getScheduledJobsPath(false);
                 final Resource startResource = resolver.getResource(path);
-                if ( startResource != null ) {
+                if (startResource != null) {
                     final Map<String, Holder> newScheduledJobs = new HashMap<String, Holder>();
-                    synchronized ( this.scheduledJobs ) {
-                        for(final Resource rsrc : startResource.getChildren()) {
-                            if ( !isRunning.get() ) {
+                    synchronized (this.scheduledJobs) {
+                        for (final Resource rsrc : startResource.getChildren()) {
+                            if (!isRunning.get()) {
                                 break;
                             }
                             handleAddOrUpdate(newScheduledJobs, rsrc);
                         }
-                        if ( isRunning.get() ) {
-                            for(final Holder h : this.scheduledJobs.values()) {
-                                if ( h.info != null ) {
+                        if (isRunning.get()) {
+                            for (final Holder h : this.scheduledJobs.values()) {
+                                if (h.info != null) {
                                     this.jobScheduler.unscheduleJob(h.info);
                                 }
                             }
@@ -184,9 +183,10 @@ public class ScheduledJobHandler implements Runnable {
             final Map<String, Object> properties = ResourceHelper.cloneValueMap(vm);
 
             @SuppressWarnings("unchecked")
-            final List<Exception> readErrorList = (List<Exception>) properties.remove(ResourceHelper.PROPERTY_MARKER_READ_ERROR_LIST);
-            if ( readErrorList != null ) {
-                for(final Exception e : readErrorList) {
+            final List<Exception> readErrorList =
+                    (List<Exception>) properties.remove(ResourceHelper.PROPERTY_MARKER_READ_ERROR_LIST);
+            if (readErrorList != null) {
+                for (final Exception e : readErrorList) {
                     logger.warn("Unable to read scheduled job from " + eventResource.getPath(), e);
                 }
             } else {
@@ -209,13 +209,14 @@ public class ScheduledJobHandler implements Runnable {
             final String scheduleName,
             final boolean suspend,
             final List<ScheduleInfoImpl> scheduleInfos)
-    throws PersistenceException {
-        final Map<String, Object> properties = this.writeScheduledJob(jobTopic, jobProperties, scheduleName, suspend, scheduleInfos);
+            throws PersistenceException {
+        final Map<String, Object> properties =
+                this.writeScheduledJob(jobTopic, jobProperties, scheduleName, suspend, scheduleInfos);
 
         final String key = ResourceHelper.filterName(scheduleName);
-        synchronized ( this.scheduledJobs ) {
+        synchronized (this.scheduledJobs) {
             final Holder h = this.scheduledJobs.remove(key);
-            if ( h != null && h.info != null ) {
+            if (h != null && h.info != null) {
                 this.jobScheduler.unscheduleJob(h.info);
             }
             final Holder holder = new Holder();
@@ -229,21 +230,22 @@ public class ScheduledJobHandler implements Runnable {
         }
     }
 
-    private Map<String, Object> writeScheduledJob(final String jobTopic,
+    private Map<String, Object> writeScheduledJob(
+            final String jobTopic,
             final Map<String, Object> jobProperties,
             final String scheduleName,
             final boolean suspend,
             final List<ScheduleInfoImpl> scheduleInfos)
-    throws PersistenceException {
+            throws PersistenceException {
         final ResourceResolver resolver = this.configuration.createResourceResolver();
         try {
             // create properties
             final Map<String, Object> properties = new HashMap<String, Object>();
 
-            if ( jobProperties != null ) {
-                for(final Map.Entry<String, Object> entry : jobProperties.entrySet() ) {
+            if (jobProperties != null) {
+                for (final Map.Entry<String, Object> entry : jobProperties.entrySet()) {
                     final String propName = entry.getKey();
-                    if ( !ResourceHelper.ignoreProperty(propName) ) {
+                    if (!ResourceHelper.ignoreProperty(propName)) {
                         properties.put(propName, entry.getValue());
                     }
                 }
@@ -257,12 +259,12 @@ public class ScheduledJobHandler implements Runnable {
             properties.put(ResourceHelper.PROPERTY_SCHEDULE_NAME, scheduleName);
             final String[] infoArray = new String[scheduleInfos.size()];
             int index = 0;
-            for(final ScheduleInfoImpl info : scheduleInfos) {
+            for (final ScheduleInfoImpl info : scheduleInfos) {
                 infoArray[index] = info.getSerializedString();
                 index++;
             }
             properties.put(ResourceHelper.PROPERTY_SCHEDULE_INFO, infoArray);
-            if ( suspend ) {
+            if (suspend) {
                 properties.put(ResourceHelper.PROPERTY_SCHEDULE_SUSPENDED, Boolean.TRUE);
             }
 
@@ -273,15 +275,13 @@ public class ScheduledJobHandler implements Runnable {
 
             // update existing resource
             final Resource existingInfo = resolver.getResource(path);
-            if ( existingInfo != null ) {
+            if (existingInfo != null) {
                 resolver.delete(existingInfo);
                 logger.debug("Updating scheduled job {} at {}", properties, path);
             } else {
                 logger.debug("Storing new scheduled job {} at {}", properties, path);
             }
-            ResourceHelper.createAndCommitResource(resolver,
-                    path,
-                    properties);
+            ResourceHelper.createAndCommitResource(resolver, path, properties);
             // put back real schedule infos
             properties.put(ResourceHelper.PROPERTY_SCHEDULE_INFO, scheduleInfos);
 
@@ -292,8 +292,7 @@ public class ScheduledJobHandler implements Runnable {
     }
 
     private ScheduledJobInfoImpl addOrUpdateScheduledJob(
-            final Map<String, Object> properties,
-            final ScheduledJobInfoImpl oldInfo) {
+            final Map<String, Object> properties, final ScheduledJobInfoImpl oldInfo) {
         properties.remove(ResourceResolver.PROPERTY_RESOURCE_TYPE);
         properties.remove(Job.PROPERTY_JOB_CREATED);
         properties.remove(Job.PROPERTY_JOB_CREATED_INSTANCE);
@@ -303,7 +302,7 @@ public class ScheduledJobHandler implements Runnable {
         final String schedulerName = (String) properties.remove(ResourceHelper.PROPERTY_SCHEDULE_NAME);
 
         final ScheduledJobInfoImpl info;
-        if ( oldInfo == null ) {
+        if (oldInfo == null) {
             info = new ScheduledJobInfoImpl(jobScheduler, schedulerName);
         } else {
             info = oldInfo;
@@ -323,25 +322,25 @@ public class ScheduledJobHandler implements Runnable {
             @Override
             public void run() {
                 final Map<String, Holder> updateJobs = new HashMap<String, ScheduledJobHandler.Holder>();
-                synchronized ( scheduledJobs ) {
-                    for(final Map.Entry<String, Holder> entry : scheduledJobs.entrySet()) {
-                        if ( entry.getValue().info == null && entry.getValue().read < lastBundleActivity.get() ) {
+                synchronized (scheduledJobs) {
+                    for (final Map.Entry<String, Holder> entry : scheduledJobs.entrySet()) {
+                        if (entry.getValue().info == null && entry.getValue().read < lastBundleActivity.get()) {
                             updateJobs.put(entry.getKey(), entry.getValue());
                         }
                     }
                 }
-                if ( !updateJobs.isEmpty() && isRunning.get() ) {
+                if (!updateJobs.isEmpty() && isRunning.get()) {
                     ResourceResolver resolver = configuration.createResourceResolver();
-                    if ( resolver != null ) {
+                    if (resolver != null) {
                         try {
-                            for(final Map.Entry<String, Holder> entry : updateJobs.entrySet()) {
+                            for (final Map.Entry<String, Holder> entry : updateJobs.entrySet()) {
                                 final String path = configuration.getScheduledJobsPath(true) + entry.getKey();
                                 final Resource rsrc = resolver.getResource(path);
-                                if ( !isRunning.get() ) {
+                                if (!isRunning.get()) {
                                     break;
                                 }
-                                if ( rsrc != null ) {
-                                    synchronized ( scheduledJobs ) {
+                                if (rsrc != null) {
+                                    synchronized (scheduledJobs) {
                                         handleAddOrUpdate(scheduledJobs, rsrc);
                                     }
                                 }
@@ -363,12 +362,12 @@ public class ScheduledJobHandler implements Runnable {
         this.addTask(new Runnable() {
             @Override
             public void run() {
-                if ( isRunning.get() ) {
+                if (isRunning.get()) {
                     final String scheduleKey = ResourceHelper.filterName(ResourceUtil.getName(path));
-                    if ( scheduleKey != null ) {
-                        synchronized ( scheduledJobs ) {
+                    if (scheduleKey != null) {
+                        synchronized (scheduledJobs) {
                             final Holder h = scheduledJobs.remove(scheduleKey);
-                            if ( h != null && h.info != null ) {
+                            if (h != null && h.info != null) {
                                 jobScheduler.unscheduleJob(h.info);
                             }
                         }
@@ -386,13 +385,13 @@ public class ScheduledJobHandler implements Runnable {
         this.addTask(new Runnable() {
             @Override
             public void run() {
-                if ( isRunning.get() ) {
+                if (isRunning.get()) {
                     final ResourceResolver resolver = configuration.createResourceResolver();
-                    if ( resolver != null ) {
+                    if (resolver != null) {
                         try {
                             final Resource rsrc = resolver.getResource(path);
-                            if ( rsrc != null ) {
-                                synchronized ( scheduledJobs ) {
+                            if (rsrc != null) {
+                                synchronized (scheduledJobs) {
                                     handleAddOrUpdate(scheduledJobs, rsrc);
                                 }
                             }
@@ -414,42 +413,42 @@ public class ScheduledJobHandler implements Runnable {
         final String id = ResourceHelper.filterName(rsrc.getName());
         final Holder scheduled = this.scheduledJobs.remove(id);
         boolean read = false;
-        if ( scheduled != null ) {
+        if (scheduled != null) {
             // check if loading failed and we can retry
-            if ( scheduled.info == null || scheduled.read < this.lastBundleActivity.get() ) {
+            if (scheduled.info == null || scheduled.read < this.lastBundleActivity.get()) {
                 read = true;
             }
             // check if this is an update
-            if ( scheduled.info != null ) {
+            if (scheduled.info != null) {
                 final ValueMap vm = ResourceUtil.getValueMap(rsrc);
                 final Calendar changed = (Calendar) vm.get(Job.PROPERTY_JOB_CREATED);
-                if ( changed != null && scheduled.created.compareTo(changed) < 0 ) {
+                if (changed != null && scheduled.created.compareTo(changed) < 0) {
                     read = true;
                 }
             }
-            if ( !read ) {
+            if (!read) {
                 // nothing changes
                 newScheduledJobs.put(id, scheduled);
             }
         } else {
             read = true;
         }
-        if ( read ) {
+        if (read) {
             // read
             final Holder holder = new Holder();
             holder.read = System.currentTimeMillis();
 
             final Map<String, Object> properties = this.readScheduledJob(rsrc);
-            if ( properties != null ) {
+            if (properties != null) {
                 holder.created = (Calendar) properties.get(Job.PROPERTY_JOB_CREATED);
                 holder.info = this.addOrUpdateScheduledJob(properties, scheduled != null ? scheduled.info : null);
             }
             newScheduledJobs.put(id, holder);
 
-            if ( holder.info == null && scheduled != null && scheduled.info != null ) {
+            if (holder.info == null && scheduled != null && scheduled.info != null) {
                 this.jobScheduler.unscheduleJob(scheduled.info);
             }
-            if ( holder.info != null ) {
+            if (holder.info != null) {
                 this.jobScheduler.scheduleJob(holder.info);
             }
         }
@@ -469,7 +468,7 @@ public class ScheduledJobHandler implements Runnable {
             final String path = sb.toString();
 
             final Resource eventResource = resolver.getResource(path);
-            if ( eventResource != null ) {
+            if (eventResource != null) {
                 resolver.delete(eventResource);
                 resolver.commit();
             }
@@ -480,9 +479,9 @@ public class ScheduledJobHandler implements Runnable {
             resolver.close();
         }
 
-        synchronized ( this.scheduledJobs ) {
+        synchronized (this.scheduledJobs) {
             final Holder h = scheduledJobs.remove(scheduleKey);
-            if ( h != null && h.info != null ) {
+            if (h != null && h.info != null) {
                 jobScheduler.unscheduleJob(h.info);
             }
         }
@@ -500,13 +499,13 @@ public class ScheduledJobHandler implements Runnable {
 
             final Resource rsrc = resolver.getResource(path);
             // This is an update, if we can't find the resource we ignore it
-            if ( rsrc != null ) {
+            if (rsrc != null) {
                 final Calendar now = Calendar.getInstance();
 
                 // update holder first
-                synchronized ( scheduledJobs ) {
+                synchronized (scheduledJobs) {
                     final Holder h = scheduledJobs.get(scheduleKey);
-                    if ( h != null ) {
+                    if (h != null) {
                         h.created = now;
                     }
                 }
@@ -515,15 +514,15 @@ public class ScheduledJobHandler implements Runnable {
                 mvm.put(Job.PROPERTY_JOB_CREATED, now);
                 final String[] infoArray = new String[scheduleInfo.size()];
                 int index = 0;
-                for(final ScheduleInfo si : scheduleInfo) {
-                    infoArray[index] = ((ScheduleInfoImpl)si).getSerializedString();
+                for (final ScheduleInfo si : scheduleInfo) {
+                    infoArray[index] = ((ScheduleInfoImpl) si).getSerializedString();
                     index++;
                 }
                 mvm.put(ResourceHelper.PROPERTY_SCHEDULE_INFO, infoArray);
 
                 try {
                     resolver.commit();
-                } catch ( final PersistenceException pe) {
+                } catch (final PersistenceException pe) {
                     logger.warn("Unable to update scheduled job " + scheduleName, pe);
                 }
             }
@@ -537,7 +536,7 @@ public class ScheduledJobHandler implements Runnable {
      * @param e The exception
      */
     private void ignoreException(final Exception e) {
-        if ( this.logger.isDebugEnabled() ) {
+        if (this.logger.isDebugEnabled()) {
             this.logger.debug("Ignored exception " + e.getMessage(), e);
         }
     }
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/scheduling/ScheduledJobInfoImpl.java b/src/main/java/org/apache/sling/event/impl/jobs/scheduling/ScheduledJobInfoImpl.java
index 99fcdb4..f9acd0a 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/scheduling/ScheduledJobInfoImpl.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/scheduling/ScheduledJobInfoImpl.java
@@ -62,8 +62,7 @@ public class ScheduledJobInfoImpl implements ScheduledJobInfo, Serializable {
      * @param jobScheduler The job scheduler
      * @param scheduleName The unique name
      */
-    public ScheduledJobInfoImpl(final JobSchedulerImpl jobScheduler,
-            final String scheduleName) {
+    public ScheduledJobInfoImpl(final JobSchedulerImpl jobScheduler, final String scheduleName) {
         this.jobScheduler = jobScheduler;
         this.scheduleName = scheduleName;
     }
@@ -73,11 +72,11 @@ public class ScheduledJobInfoImpl implements ScheduledJobInfo, Serializable {
      * @param jobTopic      The job topic
      * @param jobProperties The job properties
      */
-    public void update(final String jobTopic,
-            final Map<String, Object> jobProperties) {
+    public void update(final String jobTopic, final Map<String, Object> jobProperties) {
         final boolean isSuspended = jobProperties.remove(ResourceHelper.PROPERTY_SCHEDULE_SUSPENDED) != null;
         @SuppressWarnings("unchecked")
-        final List<ScheduleInfo> scheduleInfos = (List<ScheduleInfo>) jobProperties.remove(ResourceHelper.PROPERTY_SCHEDULE_INFO);
+        final List<ScheduleInfo> scheduleInfos =
+                (List<ScheduleInfo>) jobProperties.remove(ResourceHelper.PROPERTY_SCHEDULE_INFO);
 
         this.jobTopic = jobTopic;
         this.jobProperties = jobProperties;
@@ -91,7 +90,7 @@ public class ScheduledJobInfoImpl implements ScheduledJobInfo, Serializable {
      * @param scheduleInfos The new schedule
      */
     public void update(final List<ScheduleInfo> scheduleInfos) {
-        this.scheduleInfos =  Collections.unmodifiableList(scheduleInfos);
+        this.scheduleInfos = Collections.unmodifiableList(scheduleInfos);
     }
 
     /**
@@ -115,9 +114,9 @@ public class ScheduledJobInfoImpl implements ScheduledJobInfo, Serializable {
     @Override
     public Date getNextScheduledExecution() {
         Date result = null;
-        for(final ScheduleInfo info : this.scheduleInfos) {
-            final Date newResult = ((ScheduleInfoImpl)info).getNextScheduledExecution();
-            if ( result == null || result.getTime() > newResult.getTime() ) {
+        for (final ScheduleInfo info : this.scheduleInfos) {
+            final Date newResult = ((ScheduleInfoImpl) info).getNextScheduledExecution();
+            if (result == null || result.getTime() > newResult.getTime()) {
                 result = newResult;
             }
         }
@@ -161,7 +160,7 @@ public class ScheduledJobInfoImpl implements ScheduledJobInfo, Serializable {
      */
     @Override
     public void suspend() {
-        if ( this.isSuspended.compareAndSet(false, true) ) {
+        if (this.isSuspended.compareAndSet(false, true)) {
             this.jobScheduler.setSuspended(this, true);
         }
     }
@@ -171,7 +170,7 @@ public class ScheduledJobInfoImpl implements ScheduledJobInfo, Serializable {
      */
     @Override
     public void resume() {
-        if ( this.isSuspended.compareAndSet(true, false) ) {
+        if (this.isSuspended.compareAndSet(true, false)) {
             this.jobScheduler.setSuspended(this, false);
         }
     }
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/stats/BaseStatisticsImpl.java b/src/main/java/org/apache/sling/event/impl/jobs/stats/BaseStatisticsImpl.java
index 802b726..9d07d70 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/stats/BaseStatisticsImpl.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/stats/BaseStatisticsImpl.java
@@ -56,7 +56,7 @@ public abstract class BaseStatisticsImpl {
     public long getAverageWaitingTime() {
         final long time = this.waitingTime.get();
         final long count = this.waitingCount.get();
-        if ( count > 1 ) {
+        if (count > 1) {
             return time / count;
         }
         return time;
@@ -68,7 +68,7 @@ public abstract class BaseStatisticsImpl {
     public long getAverageProcessingTime() {
         final long time = this.processingTime.get();
         final long count = this.processingCount.get();
-        if ( count > 1 ) {
+        if (count > 1) {
             return time / count;
         }
         return time;
@@ -116,7 +116,7 @@ public abstract class BaseStatisticsImpl {
     public synchronized void finishedJob(final long jobTime) {
         this.lastFinished.set(System.currentTimeMillis());
         this.processingTime.addAndGet(jobTime);
-        this.processingCount.incrementAndGet();    
+        this.processingCount.incrementAndGet();
         this.finishedJobs.incrementAndGet();
     }
 
@@ -148,11 +148,11 @@ public abstract class BaseStatisticsImpl {
      * Add another statistics information.
      */
     public synchronized void add(final BaseStatisticsImpl other) {
-        synchronized ( other ) {
-            if ( other.lastActivated.get() > this.lastActivated.get() ) {
+        synchronized (other) {
+            if (other.lastActivated.get() > this.lastActivated.get()) {
                 this.lastActivated.set(other.lastActivated.get());
             }
-            if ( other.lastFinished.get() > this.lastFinished.get() ) {
+            if (other.lastFinished.get() > this.lastFinished.get()) {
                 this.lastFinished.set(other.lastFinished.get());
             }
             this.waitingTime.addAndGet(other.waitingTime.get());
@@ -178,7 +178,7 @@ public abstract class BaseStatisticsImpl {
         final long localFinishedJobs;
         final long localFailedJobs;
         final long localCancelledJobs;
-        synchronized ( other ) {
+        synchronized (other) {
             localLastActivated = other.lastActivated.get();
             localLastFinished = other.lastFinished.get();
             localWaitingTime = other.waitingTime.get();
@@ -189,7 +189,7 @@ public abstract class BaseStatisticsImpl {
             localFailedJobs = other.failedJobs.get();
             localCancelledJobs = other.cancelledJobs.get();
         }
-        synchronized ( this ) {
+        synchronized (this) {
             this.lastActivated.set(localLastActivated);
             this.lastFinished.set(localLastFinished);
             this.waitingTime.set(localWaitingTime);
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/stats/GaugeSupport.java b/src/main/java/org/apache/sling/event/impl/jobs/stats/GaugeSupport.java
index b2cb896..ec26159 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/stats/GaugeSupport.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/stats/GaugeSupport.java
@@ -18,17 +18,17 @@
  */
 package org.apache.sling.event.impl.jobs.stats;
 
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
 import com.codahale.metrics.Gauge;
 import com.codahale.metrics.MetricRegistry;
 import org.apache.sling.event.jobs.Statistics;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
 /**
  * Helper class that holds gauges for relevant queue statistics.
  */
@@ -129,7 +129,7 @@ class GaugeSupport {
      */
     void shutdown() {
         if (metricRegistry != null) {
-           for (String metricName : gaugeMetricNames) {
+            for (String metricName : gaugeMetricNames) {
                 try {
                     metricRegistry.remove(metricName);
                 } catch (RuntimeException e) {
@@ -155,10 +155,20 @@ class GaugeSupport {
             gaugeMetricNames.add(metricName);
         } catch (IllegalArgumentException e) {
             if (queueName != null && count <= 10) {
-                logger.debug("Failed to register suffix {} for the queue {}, attempt {}, retrying.", suffix, queueName, count, e);
+                logger.debug(
+                        "Failed to register suffix {} for the queue {}, attempt {}, retrying.",
+                        suffix,
+                        queueName,
+                        count,
+                        e);
                 registerWithSuffix(suffix, count + 1, value);
             } else {
-                logger.error("Failed to register suffix {} for the queue {}, attempt {}, giving up.", suffix, queueName, count, e);
+                logger.error(
+                        "Failed to register suffix {} for the queue {}, attempt {}, giving up.",
+                        suffix,
+                        queueName,
+                        count,
+                        e);
             }
         }
     }
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/stats/StatisticsImpl.java b/src/main/java/org/apache/sling/event/impl/jobs/stats/StatisticsImpl.java
index 82c7a01..33236d0 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/stats/StatisticsImpl.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/stats/StatisticsImpl.java
@@ -133,7 +133,7 @@ public class StatisticsImpl extends BaseStatisticsImpl implements Statistics {
      * Add another statistics information.
      */
     public synchronized void add(final StatisticsImpl other) {
-        synchronized ( other ) {
+        synchronized (other) {
             super.add(other);
             this.queuedJobs.addAndGet(other.queuedJobs.get());
             this.activeJobs.addAndGet(other.activeJobs.get());
@@ -147,11 +147,11 @@ public class StatisticsImpl extends BaseStatisticsImpl implements Statistics {
         super.copyFrom(other);
         final long localQueuedJobs;
         final long localActiveJobs;
-        synchronized ( other ) {
+        synchronized (other) {
             localQueuedJobs = other.queuedJobs.get();
             localActiveJobs = other.activeJobs.get();
         }
-        synchronized ( this ) {
+        synchronized (this) {
             this.queuedJobs.set(localQueuedJobs);
             this.activeJobs.set(localActiveJobs);
         }
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/stats/StatisticsManager.java b/src/main/java/org/apache/sling/event/impl/jobs/stats/StatisticsManager.java
index cf6b0bd..acebf14 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/stats/StatisticsManager.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/stats/StatisticsManager.java
@@ -30,14 +30,12 @@ import org.apache.sling.event.jobs.TopicStatistics;
 import org.osgi.framework.Constants;
 import org.osgi.service.component.annotations.*;
 
-
 /**
  * The statistics manager keeps track of all statistics related tasks.
  */
-@Component(service=StatisticsManager.class,
-    property = {
-        Constants.SERVICE_VENDOR + "=The Apache Software Foundation"
-})
+@Component(
+        service = StatisticsManager.class,
+        property = {Constants.SERVICE_VENDOR + "=The Apache Software Foundation"})
 public class StatisticsManager {
 
     /** The job manager configuration. */
@@ -57,11 +55,10 @@ public class StatisticsManager {
         public synchronized void reset() {
             super.reset();
             topicStatistics.clear();
-            for(final Statistics s : queueStatistics.values()) {
+            for (final Statistics s : queueStatistics.values()) {
                 s.reset();
             }
         }
-
     };
 
     /** Gauges for the global job statistics. */
@@ -99,7 +96,7 @@ public class StatisticsManager {
      */
     public Statistics getQueueStatistics(final String queueName) {
         Statistics queueStats = queueStatistics.get(queueName);
-        if ( queueStats == null ) {
+        if (queueStats == null) {
             queueStats = new StatisticsImpl();
         }
         return queueStats;
@@ -111,13 +108,13 @@ public class StatisticsManager {
      * @return The statistics or {@code null} if queue name is {@code null}.
      */
     private StatisticsImpl getStatisticsForQueue(final String queueName) {
-        if ( queueName == null ) {
+        if (queueName == null) {
             return null;
         }
-        StatisticsImpl queueStats = (StatisticsImpl)queueStatistics.get(queueName);
-        if ( queueStats == null ) {
+        StatisticsImpl queueStats = (StatisticsImpl) queueStatistics.get(queueName);
+        if (queueStats == null) {
             queueStatistics.putIfAbsent(queueName, new StatisticsImpl());
-            queueStats = (StatisticsImpl)queueStatistics.get(queueName);
+            queueStats = (StatisticsImpl) queueStatistics.get(queueName);
             if (metricRegistry != null) {
                 GaugeSupport gaugeSupport = new GaugeSupport(queueName, queueStats, metricRegistry);
                 if (queueGauges.putIfAbsent(queueName, gaugeSupport) == null) {
@@ -128,65 +125,61 @@ public class StatisticsManager {
         return queueStats;
     }
 
-    public void jobEnded(final String queueName,
-            final String topic,
-            final InternalJobState state,
-            final long processingTime) {
+    public void jobEnded(
+            final String queueName, final String topic, final InternalJobState state, final long processingTime) {
         final StatisticsImpl queueStats = getStatisticsForQueue(queueName);
 
-        TopicStatisticsImpl ts = (TopicStatisticsImpl)this.topicStatistics.get(topic);
-        if ( ts == null ) {
+        TopicStatisticsImpl ts = (TopicStatisticsImpl) this.topicStatistics.get(topic);
+        if (ts == null) {
             this.topicStatistics.putIfAbsent(topic, new TopicStatisticsImpl(topic));
-            ts = (TopicStatisticsImpl)this.topicStatistics.get(topic);
+            ts = (TopicStatisticsImpl) this.topicStatistics.get(topic);
         }
 
-        if ( state == InternalJobState.CANCELLED ) {
-            ts.cancelledJob();;
+        if (state == InternalJobState.CANCELLED) {
+            ts.cancelledJob();
+            ;
             this.globalStatistics.cancelledJob();
-            if ( queueStats != null ) {
+            if (queueStats != null) {
                 queueStats.cancelledJob();
             }
 
-        } else if ( state == InternalJobState.FAILED ) {
+        } else if (state == InternalJobState.FAILED) {
             ts.failedJob();
             this.globalStatistics.failedJob();
-            if ( queueStats != null ) {
+            if (queueStats != null) {
                 queueStats.failedJob();
             }
 
-        } else if ( state == InternalJobState.SUCCEEDED ) {
+        } else if (state == InternalJobState.SUCCEEDED) {
             ts.finishedJob(processingTime);
             this.globalStatistics.finishedJob(processingTime);
-            if ( queueStats != null ) {
+            if (queueStats != null) {
                 queueStats.finishedJob(processingTime);
             }
         }
     }
 
-    public void jobStarted(final String queueName,
-            final String topic,
-            final long queueTime) {
+    public void jobStarted(final String queueName, final String topic, final long queueTime) {
         final StatisticsImpl queueStats = getStatisticsForQueue(queueName);
 
-        TopicStatisticsImpl ts = (TopicStatisticsImpl)this.topicStatistics.get(topic);
-        if ( ts == null ) {
+        TopicStatisticsImpl ts = (TopicStatisticsImpl) this.topicStatistics.get(topic);
+        if (ts == null) {
             this.topicStatistics.putIfAbsent(topic, new TopicStatisticsImpl(topic));
-            ts = (TopicStatisticsImpl)this.topicStatistics.get(topic);
+            ts = (TopicStatisticsImpl) this.topicStatistics.get(topic);
         }
 
         ts.addActive(queueTime);
         this.globalStatistics.addActive(queueTime);
-        if ( queueStats != null ) {
+        if (queueStats != null) {
             queueStats.addActive(queueTime);
         }
     }
 
-    public void jobQueued(final String queueName,
-            final String topic) {
+    public void jobQueued(final String queueName, final String topic) {
         final StatisticsImpl queueStats = getStatisticsForQueue(queueName);
 
         this.globalStatistics.incQueued();
-        if ( queueStats != null ) {
+        if (queueStats != null) {
             queueStats.incQueued();
         }
     }
@@ -195,7 +188,7 @@ public class StatisticsManager {
         final StatisticsImpl queueStats = getStatisticsForQueue(queueName);
 
         this.globalStatistics.decQueued();
-        if ( queueStats != null ) {
+        if (queueStats != null) {
             queueStats.decQueued();
         }
     }
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/tasks/CheckTopologyTask.java b/src/main/java/org/apache/sling/event/impl/jobs/tasks/CheckTopologyTask.java
index c5750be..0ea7397 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/tasks/CheckTopologyTask.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/tasks/CheckTopologyTask.java
@@ -70,22 +70,22 @@ public class CheckTopologyTask {
      * Reassign jobs from stopped instance.
      */
     private void reassignJobsFromStoppedInstances() {
-        if ( caps.isLeader() && caps.isActive() ) {
+        if (caps.isLeader() && caps.isActive()) {
             this.logger.debug("Checking for stopped instances...");
             final ResourceResolver resolver = this.configuration.createResourceResolver();
-            if ( resolver != null ) {
+            if (resolver != null) {
                 try {
                     final Resource jobsRoot = resolver.getResource(this.configuration.getAssginedJobsPath());
                     this.logger.debug("Got jobs root {}", jobsRoot);
 
                     // this resource should exist, but we check anyway
-                    if ( jobsRoot != null ) {
+                    if (jobsRoot != null) {
                         final Iterator<Resource> instanceIter = jobsRoot.listChildren();
-                        while ( caps.isActive() && instanceIter.hasNext() ) {
+                        while (caps.isActive() && instanceIter.hasNext()) {
                             final Resource instanceResource = instanceIter.next();
 
                             final String instanceId = instanceResource.getName();
-                            if ( !caps.isActive(instanceId) ) {
+                            if (!caps.isActive(instanceId)) {
                                 logger.debug("Found stopped instance {}", instanceId);
                                 assignJobs(instanceResource, true);
                             }
@@ -102,82 +102,104 @@ public class CheckTopologyTask {
      * Reassign stale jobs from this instance
      */
     private void reassignStaleJobs() {
-        if ( caps.isActive() ) {
+        if (caps.isActive()) {
             this.logger.debug("Checking for stale jobs...");
             final ResourceResolver resolver = this.configuration.createResourceResolver();
-            if ( resolver != null ) {
+            if (resolver != null) {
                 try {
                     final Resource jobsRoot = resolver.getResource(this.configuration.getLocalJobsPath());
 
                     // this resource should exist, but we check anyway
-                    if ( jobsRoot != null ) {
+                    if (jobsRoot != null) {
                         final Iterator<Resource> topicIter = jobsRoot.listChildren();
-                        while ( caps.isActive() && topicIter.hasNext() ) {
+                        while (caps.isActive() && topicIter.hasNext()) {
                             final Resource topicResource = topicIter.next();
 
                             final String topicName = topicResource.getName().replace('.', '/');
-                            this.logger.debug("Checking topic {}..." , topicName);
+                            this.logger.debug("Checking topic {}...", topicName);
                             final List<InstanceDescription> potentialTargets = caps.getPotentialTargets(topicName);
                             boolean reassign = true;
-                            for(final InstanceDescription desc : potentialTargets) {
-                                if ( desc.isLocal() ) {
+                            for (final InstanceDescription desc : potentialTargets) {
+                                if (desc.isLocal()) {
                                     reassign = false;
                                     break;
                                 }
                             }
-                            if ( reassign ) {
+                            if (reassign) {
                                 final QueueConfigurationManager qcm = this.configuration.getQueueConfigurationManager();
-                                if ( qcm == null ) {
+                                if (qcm == null) {
                                     break;
                                 }
                                 final QueueInfo info = qcm.getQueueInfo(topicName);
-				logger.info ("Start reassigning stale jobs");
-                                JobTopicTraverser.traverse(this.logger, topicResource, new JobTopicTraverser.ResourceCallback() {
+                                logger.info("Start reassigning stale jobs");
+                                JobTopicTraverser.traverse(
+                                        this.logger, topicResource, new JobTopicTraverser.ResourceCallback() {
 
-                                    @Override
-                                    public boolean handle(final Resource rsrc) {
-                                        try {
-                                            final ValueMap vm = ResourceHelper.getValueMap(rsrc);
-                                            final String targetId = caps.detectTarget(topicName, vm, info);
+                                            @Override
+                                            public boolean handle(final Resource rsrc) {
+                                                try {
+                                                    final ValueMap vm = ResourceHelper.getValueMap(rsrc);
+                                                    final String targetId = caps.detectTarget(topicName, vm, info);
 
-                                            final Map<String, Object> props = new HashMap<>(vm);
-                                            props.remove(Job.PROPERTY_JOB_STARTED_TIME);
+                                                    final Map<String, Object> props = new HashMap<>(vm);
+                                                    props.remove(Job.PROPERTY_JOB_STARTED_TIME);
 
-                                            final String newPath;
-                                            if ( targetId != null ) {
-                                                newPath = configuration.getAssginedJobsPath() + '/' + targetId + '/' + topicResource.getName() + rsrc.getPath().substring(topicResource.getPath().length());
-                                                props.put(Job.PROPERTY_JOB_QUEUE_NAME, info.queueName);
-                                                props.put(Job.PROPERTY_JOB_TARGET_INSTANCE, targetId);
-                                            } else {
-                                                newPath = configuration.getUnassignedJobsPath() + '/' + topicResource.getName() + rsrc.getPath().substring(topicResource.getPath().length());
-                                                props.remove(Job.PROPERTY_JOB_QUEUE_NAME);
-                                                props.remove(Job.PROPERTY_JOB_TARGET_INSTANCE);
-                                            }
-                                            try {
-                                                ResourceHelper.getOrCreateResource(resolver, newPath, props);
-                                                resolver.delete(rsrc);
-                                                resolver.commit();
-                                                final String jobId = vm.get(ResourceHelper.PROPERTY_JOB_ID, String.class);
-                                                if ( targetId != null ) {
-                                                    configuration.getAuditLogger().debug("REASSIGN OK {} : {}", targetId, jobId);
-                                                } else {
-                                                    configuration.getAuditLogger().debug("REUNASSIGN OK : {}", jobId);
+                                                    final String newPath;
+                                                    if (targetId != null) {
+                                                        newPath = configuration.getAssginedJobsPath()
+                                                                + '/'
+                                                                + targetId
+                                                                + '/'
+                                                                + topicResource.getName()
+                                                                + rsrc.getPath()
+                                                                        .substring(topicResource
+                                                                                .getPath()
+                                                                                .length());
+                                                        props.put(Job.PROPERTY_JOB_QUEUE_NAME, info.queueName);
+                                                        props.put(Job.PROPERTY_JOB_TARGET_INSTANCE, targetId);
+                                                    } else {
+                                                        newPath = configuration.getUnassignedJobsPath()
+                                                                + '/'
+                                                                + topicResource.getName()
+                                                                + rsrc.getPath()
+                                                                        .substring(topicResource
+                                                                                .getPath()
+                                                                                .length());
+                                                        props.remove(Job.PROPERTY_JOB_QUEUE_NAME);
+                                                        props.remove(Job.PROPERTY_JOB_TARGET_INSTANCE);
+                                                    }
+                                                    try {
+                                                        ResourceHelper.getOrCreateResource(resolver, newPath, props);
+                                                        resolver.delete(rsrc);
+                                                        resolver.commit();
+                                                        final String jobId =
+                                                                vm.get(ResourceHelper.PROPERTY_JOB_ID, String.class);
+                                                        if (targetId != null) {
+                                                            configuration
+                                                                    .getAuditLogger()
+                                                                    .debug("REASSIGN OK {} : {}", targetId, jobId);
+                                                        } else {
+                                                            configuration
+                                                                    .getAuditLogger()
+                                                                    .debug("REUNASSIGN OK : {}", jobId);
+                                                        }
+                                                    } catch (final PersistenceException pe) {
+                                                        logger.warn(
+                                                                "Unable to move stale job from " + rsrc.getPath()
+                                                                        + " to " + newPath,
+                                                                pe);
+                                                        resolver.refresh();
+                                                        resolver.revert();
+                                                    }
+                                                } catch (final InstantiationException ie) {
+                                                    // something happened with the resource in the meantime
+                                                    logger.warn("Unable to move stale job from " + rsrc.getPath(), ie);
+                                                    resolver.refresh();
+                                                    resolver.revert();
                                                 }
-                                            } catch ( final PersistenceException pe ) {
-                                                logger.warn("Unable to move stale job from " + rsrc.getPath() + " to " + newPath, pe);
-                                                resolver.refresh();
-                                                resolver.revert();
+                                                return caps.isActive();
                                             }
-                                        } catch (final InstantiationException ie) {
-                                            // something happened with the resource in the meantime
-                                            logger.warn("Unable to move stale job from " + rsrc.getPath(), ie);
-                                            resolver.refresh();
-                                            resolver.revert();
-                                        }
-                                        return caps.isActive();
-                                    }
-                                });
-
+                                        });
                             }
                         }
                     }
@@ -195,16 +217,16 @@ public class CheckTopologyTask {
      * - capabilities
      */
     public void assignUnassignedJobs() {
-        if ( caps != null && caps.isLeader() && caps.isActive() ) {
+        if (caps != null && caps.isLeader() && caps.isActive()) {
             logger.debug("Checking unassigned jobs...");
             final ResourceResolver resolver = this.configuration.createResourceResolver();
-            if ( resolver != null ) {
+            if (resolver != null) {
                 try {
                     final Resource unassignedRoot = resolver.getResource(this.configuration.getUnassignedJobsPath());
                     logger.debug("Got unassigned root {}", unassignedRoot);
 
                     // this resource should exist, but we check anyway
-                    if ( unassignedRoot != null ) {
+                    if (unassignedRoot != null) {
                         assignJobs(unassignedRoot, false);
                     }
                 } finally {
@@ -220,12 +242,11 @@ public class CheckTopologyTask {
      * @param jobsRoot The root of the jobs
      * @param unassign Whether to unassign the job if no instance is found.
      */
-    private void assignJobs(final Resource jobsRoot,
-            final boolean unassign) {
+    private void assignJobs(final Resource jobsRoot, final boolean unassign) {
         final ResourceResolver resolver = jobsRoot.getResourceResolver();
 
         final Iterator<Resource> topicIter = jobsRoot.listChildren();
-        while ( caps.isActive() && topicIter.hasNext() ) {
+        while (caps.isActive() && topicIter.hasNext()) {
             final Resource topicResource = topicIter.next();
 
             final String topicName = topicResource.getName().replace('.', '/');
@@ -233,9 +254,9 @@ public class CheckTopologyTask {
 
             // first check if there is an instance for these topics
             final List<InstanceDescription> potentialTargets = caps.getPotentialTargets(topicName);
-            if ( potentialTargets != null && potentialTargets.size() > 0 ) {
+            if (potentialTargets != null && potentialTargets.size() > 0) {
                 final QueueConfigurationManager qcm = this.configuration.getQueueConfigurationManager();
-                if ( qcm == null ) {
+                if (qcm == null) {
                     break;
                 }
                 final QueueInfo info = qcm.getQueueInfo(topicName);
@@ -249,8 +270,15 @@ public class CheckTopologyTask {
                             final ValueMap vm = ResourceHelper.getValueMap(rsrc);
                             final String targetId = caps.detectTarget(topicName, vm, info);
 
-                            if ( targetId != null ) {
-                                final String newPath = configuration.getAssginedJobsPath() + '/' + targetId + '/' + topicResource.getName() + rsrc.getPath().substring(topicResource.getPath().length());
+                            if (targetId != null) {
+                                final String newPath = configuration.getAssginedJobsPath()
+                                        + '/'
+                                        + targetId
+                                        + '/'
+                                        + topicResource.getName()
+                                        + rsrc.getPath()
+                                                .substring(
+                                                        topicResource.getPath().length());
                                 final Map<String, Object> props = new HashMap<>(vm);
                                 props.put(Job.PROPERTY_JOB_QUEUE_NAME, info.queueName);
                                 props.put(Job.PROPERTY_JOB_TARGET_INSTANCE, targetId);
@@ -261,8 +289,10 @@ public class CheckTopologyTask {
                                     resolver.commit();
                                     final String jobId = vm.get(ResourceHelper.PROPERTY_JOB_ID, String.class);
                                     configuration.getAuditLogger().debug("REASSIGN OK {} : {}", targetId, jobId);
-                                } catch ( final PersistenceException pe ) {
-                                    logger.warn("Unable to move unassigned job from " + rsrc.getPath() + " to " + newPath, pe);
+                                } catch (final PersistenceException pe) {
+                                    logger.warn(
+                                            "Unable to move unassigned job from " + rsrc.getPath() + " to " + newPath,
+                                            pe);
                                     resolver.refresh();
                                     resolver.revert();
                                 }
@@ -278,7 +308,7 @@ public class CheckTopologyTask {
                 });
             }
             // now unassign if there are still jobs
-            if ( caps.isActive() && unassign ) {
+            if (caps.isActive() && unassign) {
                 // we have to move everything to the unassigned area
                 JobTopicTraverser.traverse(this.logger, topicResource, new JobTopicTraverser.ResourceCallback() {
 
@@ -286,7 +316,11 @@ public class CheckTopologyTask {
                     public boolean handle(final Resource rsrc) {
                         try {
                             final ValueMap vm = ResourceHelper.getValueMap(rsrc);
-                            final String newPath = configuration.getUnassignedJobsPath() + '/' + topicResource.getName() + rsrc.getPath().substring(topicResource.getPath().length());
+                            final String newPath = configuration.getUnassignedJobsPath()
+                                    + '/'
+                                    + topicResource.getName()
+                                    + rsrc.getPath()
+                                            .substring(topicResource.getPath().length());
                             final Map<String, Object> props = new HashMap<>(vm);
                             props.remove(Job.PROPERTY_JOB_QUEUE_NAME);
                             props.remove(Job.PROPERTY_JOB_TARGET_INSTANCE);
@@ -298,7 +332,7 @@ public class CheckTopologyTask {
                                 resolver.commit();
                                 final String jobId = vm.get(ResourceHelper.PROPERTY_JOB_ID, String.class);
                                 configuration.getAuditLogger().debug("REUNASSIGN OK : {}", jobId);
-                            } catch ( final PersistenceException pe ) {
+                            } catch (final PersistenceException pe) {
                                 logger.warn("Unable to unassigned job from " + rsrc.getPath() + " to " + newPath, pe);
                                 resolver.refresh();
                                 resolver.revert();
@@ -320,7 +354,7 @@ public class CheckTopologyTask {
      * One maintenance run
      */
     public void fullRun() {
-        if ( this.caps != null ) {
+        if (this.caps != null) {
             this.reassignJobsFromStoppedInstances();
 
             // check for all topics
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/tasks/CleanUpTask.java b/src/main/java/org/apache/sling/event/impl/jobs/tasks/CleanUpTask.java
index f5f2c21..24cb007 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/tasks/CleanUpTask.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/tasks/CleanUpTask.java
@@ -18,6 +18,13 @@
  */
 package org.apache.sling.event.impl.jobs.tasks;
 
+import java.time.Clock;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.Iterator;
+import java.util.List;
+
 import org.apache.sling.api.resource.ModifiableValueMap;
 import org.apache.sling.api.resource.PersistenceException;
 import org.apache.sling.api.resource.Resource;
@@ -33,14 +40,6 @@ import org.apache.sling.event.jobs.consumer.JobExecutionResult;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.time.Clock;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.List;
-
 /**
  * Maintenance task...
  *
@@ -52,7 +51,7 @@ public class CleanUpTask {
     private static final String PROPERTY_LAST_CHECKED = "lastCheckedForCleanup";
 
     /** Time to keep empty folders, defaults to 1 day */
-    private static final long KEEP_DURATION = 24*60*60*1000;
+    private static final long KEEP_DURATION = 24 * 60 * 60 * 1000;
 
     /** Number of id folders to be removed on each run */
     private static final long MAX_REMOVE_ID_FOLDERS = 8;
@@ -104,40 +103,39 @@ public class CleanUpTask {
         logger.debug("Job manager maintenance: Starting #{}", this.schedulerRuns);
 
         final TopologyCapabilities topologyCapabilities = configuration.getTopologyCapabilities();
-        if ( topologyCapabilities != null ) {
+        if (topologyCapabilities != null) {
             // Clean up
-            final String cleanUpUnassignedPath;;
-            if ( topologyCapabilities.isLeader() ) {
+            final String cleanUpUnassignedPath;
+            ;
+            if (topologyCapabilities.isLeader()) {
                 cleanUpUnassignedPath = this.configuration.getUnassignedJobsPath();
             } else {
                 cleanUpUnassignedPath = null;
             }
 
             // job scheduler is handled every third run
-            if ( schedulerRuns % 3 == 1 ) {
+            if (schedulerRuns % 3 == 1) {
                 this.jobScheduler.maintenance();
             }
-            if ( schedulerRuns % 60 == 0 ) { // full clean up is done every hour
+            if (schedulerRuns % 60 == 0) { // full clean up is done every hour
                 this.fullEmptyFolderCleanup(topologyCapabilities, this.configuration.getLocalJobsPath());
-                if ( cleanUpUnassignedPath != null ) {
+                if (cleanUpUnassignedPath != null) {
                     this.fullEmptyFolderCleanup(topologyCapabilities, cleanUpUnassignedPath);
                 }
-                if ( topologyCapabilities.isLeader() ) {
+                if (topologyCapabilities.isLeader()) {
                     this.cleanUpInstanceIdFolders(topologyCapabilities, this.configuration.getAssginedJobsPath());
                 }
-            } else if ( schedulerRuns % 5 == 0 ) { // simple clean up every 5 minutes
+            } else if (schedulerRuns % 5 == 0) { // simple clean up every 5 minutes
                 this.simpleEmptyFolderCleanup(topologyCapabilities, this.configuration.getLocalJobsPath());
-                if ( cleanUpUnassignedPath != null ) {
+                if (cleanUpUnassignedPath != null) {
                     this.simpleEmptyFolderCleanup(topologyCapabilities, cleanUpUnassignedPath);
                 }
             }
         }
 
-
-        if (this.configuration.getHistoryCleanUpRemovedJobs() > 0 &&
-                schedulerRuns % 60 == 1) {
+        if (this.configuration.getHistoryCleanUpRemovedJobs() > 0 && schedulerRuns % 60 == 1) {
             Calendar removeDate = getCalendarInstance();
-            removeDate.add(Calendar.MINUTE, - this.configuration.getHistoryCleanUpRemovedJobs());
+            removeDate.add(Calendar.MINUTE, -this.configuration.getHistoryCleanUpRemovedJobs());
             this.historyCleanUpRemovedJobs(removeDate);
         }
 
@@ -156,9 +154,7 @@ public class CleanUpTask {
                      */
                     new JobExecutionContext() {
                         @Override
-                        public void asyncProcessingFinished(JobExecutionResult result) {
-
-                        }
+                        public void asyncProcessingFinished(JobExecutionResult result) {}
 
                         @Override
                         public boolean isStopped() {
@@ -166,29 +162,19 @@ public class CleanUpTask {
                         }
 
                         @Override
-                        public void initProgress(int steps, long eta) {
-
-                        }
+                        public void initProgress(int steps, long eta) {}
 
                         @Override
-                        public void incrementProgressCount(int steps) {
-
-                        }
+                        public void incrementProgressCount(int steps) {}
 
                         @Override
-                        public void updateProgress(long eta) {
-
-                        }
+                        public void updateProgress(long eta) {}
 
                         @Override
-                        public void log(String message, Object... args) {
-
-                        }
+                        public void log(String message, Object... args) {}
 
                         @Override
-                        public void setProperty(String name, Object value) {
-
-                        }
+                        public void setProperty(String name, Object value) {}
 
                         @Override
                         public ResultBuilder result() {
@@ -197,10 +183,7 @@ public class CleanUpTask {
                     },
                     this.configuration.getStoredCancelledJobsPath(),
                     null,
-                    Arrays.asList(
-                            Job.JobState.DROPPED.name(),
-                            Job.JobState.ERROR.name()
-                    ));
+                    Arrays.asList(Job.JobState.DROPPED.name(), Job.JobState.ERROR.name()));
         } catch (PersistenceException e) {
             this.logger.warn("Exception during job resource tree cleanup.", e);
         } finally {
@@ -223,13 +206,13 @@ public class CleanUpTask {
 
             final Resource baseResource = resolver.getResource(basePath);
             // sanity check - should never be null
-            if ( baseResource != null ) {
+            if (baseResource != null) {
                 final Iterator<Resource> topicIter = baseResource.listChildren();
-                while ( caps.isActive() && topicIter.hasNext() ) {
+                while (caps.isActive() && topicIter.hasNext()) {
                     final Resource topicResource = topicIter.next();
 
-                    for(int i = 0; i < 10; i++) {
-                        if ( caps.isActive() ) {
+                    for (int i = 0; i < 10; i++) {
+                        if (caps.isActive()) {
                             final StringBuilder sb = new StringBuilder(topicResource.getPath());
                             sb.append('/');
                             sb.append(cleanUpDate.get(Calendar.YEAR));
@@ -244,15 +227,17 @@ public class CleanUpTask {
                             final String path = sb.toString();
 
                             final Resource dateResource = resolver.getResource(path);
-                            if ( dateResource != null && !dateResource.listChildren().hasNext() ) {
+                            if (dateResource != null
+                                    && !dateResource.listChildren().hasNext()) {
                                 resolver.delete(dateResource);
                                 resolver.commit();
                             }
                             // check hour folder
-                            if ( path.endsWith("59") ) {
+                            if (path.endsWith("59")) {
                                 final String hourPath = path.substring(0, path.length() - 3);
                                 final Resource hourResource = resolver.getResource(hourPath);
-                                if ( hourResource != null && !hourResource.listChildren().hasNext() ) {
+                                if (hourResource != null
+                                        && !hourResource.listChildren().hasNext()) {
                                     resolver.delete(hourResource);
                                     resolver.commit();
                                 }
@@ -278,13 +263,13 @@ public class CleanUpTask {
     private void fullEmptyFolderCleanup(final TopologyCapabilities caps, final String basePath) {
         this.logger.debug("Cleaning up job resource tree: removing ALL empty folders");
         final ResourceResolver resolver = this.configuration.createResourceResolver();
-        if ( resolver == null ) {
+        if (resolver == null) {
             return;
         }
         try {
             final Resource baseResource = resolver.getResource(basePath);
             // sanity check - should never be null
-            if ( baseResource != null ) {
+            if (baseResource != null) {
                 final Calendar now = getCalendarInstance();
                 final int removeYear = now.get(Calendar.YEAR);
                 final int removeMonth = now.get(Calendar.MONTH) + 1;
@@ -292,58 +277,59 @@ public class CleanUpTask {
                 final int removeHour = now.get(Calendar.HOUR_OF_DAY);
 
                 final Iterator<Resource> topicIter = baseResource.listChildren();
-                while ( caps.isActive() && topicIter.hasNext() ) {
+                while (caps.isActive() && topicIter.hasNext()) {
                     final Resource topicResource = topicIter.next();
 
                     // now years
                     final Iterator<Resource> yearIter = topicResource.listChildren();
-                    while ( caps.isActive() && yearIter.hasNext() ) {
+                    while (caps.isActive() && yearIter.hasNext()) {
                         final Resource yearResource = yearIter.next();
                         final int year = Integer.valueOf(yearResource.getName());
                         // we should not have a year higher than "now", but we test anyway
-                        if ( year > removeYear ) {
+                        if (year > removeYear) {
                             continue;
                         }
                         final boolean oldYear = year < removeYear;
 
                         // months
                         final Iterator<Resource> monthIter = yearResource.listChildren();
-                        while ( caps.isActive() && monthIter.hasNext() ) {
+                        while (caps.isActive() && monthIter.hasNext()) {
                             final Resource monthResource = monthIter.next();
                             final int month = Integer.valueOf(monthResource.getName());
-                            if ( !oldYear && month > removeMonth ) {
+                            if (!oldYear && month > removeMonth) {
                                 continue;
                             }
                             final boolean oldMonth = oldYear || month < removeMonth;
 
                             // days
                             final Iterator<Resource> dayIter = monthResource.listChildren();
-                            while ( caps.isActive() && dayIter.hasNext() ) {
+                            while (caps.isActive() && dayIter.hasNext()) {
                                 final Resource dayResource = dayIter.next();
                                 final int day = Integer.valueOf(dayResource.getName());
-                                if ( !oldMonth && day > removeDay ) {
+                                if (!oldMonth && day > removeDay) {
                                     continue;
                                 }
                                 final boolean oldDay = oldMonth || day < removeDay;
 
                                 // hours
                                 final Iterator<Resource> hourIter = dayResource.listChildren();
-                                while ( caps.isActive() && hourIter.hasNext() ) {
+                                while (caps.isActive() && hourIter.hasNext()) {
                                     final Resource hourResource = hourIter.next();
                                     final int hour = Integer.valueOf(hourResource.getName());
-                                    if ( !oldDay && hour > removeHour ) {
+                                    if (!oldDay && hour > removeHour) {
                                         continue;
                                     }
-                                    final boolean oldHour = (oldDay && (oldMonth || removeHour > 0)) || hour < (removeHour -1);
+                                    final boolean oldHour =
+                                            (oldDay && (oldMonth || removeHour > 0)) || hour < (removeHour - 1);
 
                                     // we only remove minutes if the hour is old
-                                    if ( oldHour ) {
+                                    if (oldHour) {
                                         final Iterator<Resource> minuteIter = hourResource.listChildren();
-                                        while ( caps.isActive() && minuteIter.hasNext() ) {
+                                        while (caps.isActive() && minuteIter.hasNext()) {
                                             final Resource minuteResource = minuteIter.next();
 
                                             // check if we can delete the minute
-                                            if ( !minuteResource.listChildren().hasNext() ) {
+                                            if (!minuteResource.listChildren().hasNext()) {
                                                 resolver.delete(minuteResource);
                                                 resolver.commit();
                                             }
@@ -351,27 +337,35 @@ public class CleanUpTask {
                                     }
 
                                     // check if we can delete the hour
-                                    if ( caps.isActive() && oldHour && !hourResource.listChildren().hasNext()) {
+                                    if (caps.isActive()
+                                            && oldHour
+                                            && !hourResource.listChildren().hasNext()) {
                                         resolver.delete(hourResource);
                                         resolver.commit();
                                     }
                                 }
                                 // check if we can delete the day
-                                if ( caps.isActive() && oldDay && !dayResource.listChildren().hasNext()) {
+                                if (caps.isActive()
+                                        && oldDay
+                                        && !dayResource.listChildren().hasNext()) {
                                     resolver.delete(dayResource);
                                     resolver.commit();
                                 }
                             }
 
                             // check if we can delete the month
-                            if ( caps.isActive() && oldMonth && !monthResource.listChildren().hasNext() ) {
+                            if (caps.isActive()
+                                    && oldMonth
+                                    && !monthResource.listChildren().hasNext()) {
                                 resolver.delete(monthResource);
                                 resolver.commit();
                             }
                         }
 
                         // check if we can delete the year
-                        if ( caps.isActive() && oldYear && !yearResource.listChildren().hasNext() ) {
+                        if (caps.isActive()
+                                && oldYear
+                                && !yearResource.listChildren().hasNext()) {
                             resolver.delete(yearResource);
                             resolver.commit();
                         }
@@ -387,52 +381,51 @@ public class CleanUpTask {
         }
     }
 
-
     /**
      * Clean up empty instance id folders
      * @param assginedJobsPath The root path for the assigned jobs
      */
     private void cleanUpInstanceIdFolders(final TopologyCapabilities caps, final String assginedJobsPath) {
         final ResourceResolver resolver = this.configuration.createResourceResolver();
-        if ( resolver == null ) {
+        if (resolver == null) {
             return;
         }
         try {
             final Resource baseResource = resolver.getResource(assginedJobsPath);
             // sanity check - should never be null
-            if ( baseResource != null ) {
+            if (baseResource != null) {
                 final List<Resource> toDelete = new ArrayList<>();
                 // iterate over children == instance id folders
-                for(final Resource r : baseResource.getChildren()) {
-                    if ( !caps.isActive() ) {
+                for (final Resource r : baseResource.getChildren()) {
+                    if (!caps.isActive()) {
                         // shutdown, stop check
                         toDelete.clear();
                         break;
                     }
                     final String instanceId = r.getName();
-                    if ( !caps.isActive(instanceId) ) {
+                    if (!caps.isActive(instanceId)) {
                         // is the resource empty?
-                        if ( !hasJobs(caps, r) ) {
+                        if (!hasJobs(caps, r)) {
                             // check for timestamp
                             final long timestamp = r.getValueMap().get(PROPERTY_LAST_CHECKED, -1L);
                             final long now = currentTimeMillis();
-                            if ( timestamp > 0 && (timestamp + KEEP_DURATION <= now) ) {
+                            if (timestamp > 0 && (timestamp + KEEP_DURATION <= now)) {
                                 toDelete.add(r);
-                                if ( toDelete.size() == MAX_REMOVE_ID_FOLDERS ) {
+                                if (toDelete.size() == MAX_REMOVE_ID_FOLDERS) {
                                     break;
                                 }
-                            } else if ( timestamp == -1 ) {
+                            } else if (timestamp == -1) {
                                 final ModifiableValueMap mvm = r.adaptTo(ModifiableValueMap.class);
-                                if ( mvm != null ) {
+                                if (mvm != null) {
                                     mvm.put(PROPERTY_LAST_CHECKED, now);
                                     resolver.commit();
                                 }
                             }
                         } else {
                             // not empty, check if timestamp exists
-                            if ( r.getValueMap().containsKey(PROPERTY_LAST_CHECKED) ) {
+                            if (r.getValueMap().containsKey(PROPERTY_LAST_CHECKED)) {
                                 final ModifiableValueMap mvm = r.adaptTo(ModifiableValueMap.class);
-                                if ( mvm != null ) {
+                                if (mvm != null) {
                                     mvm.remove(PROPERTY_LAST_CHECKED);
                                     resolver.commit();
                                 }
@@ -442,8 +435,8 @@ public class CleanUpTask {
                 }
 
                 // remove obsolete nodes
-                for(final Resource r : toDelete) {
-                    if ( caps.isActive() ) {
+                for (final Resource r : toDelete) {
+                    if (caps.isActive()) {
                         resolver.delete(r);
                         resolver.commit();
                     }
@@ -467,9 +460,9 @@ public class CleanUpTask {
         boolean result = false;
 
         final Iterator<Resource> iter = root.listChildren();
-        while ( !result && caps.isActive() && iter.hasNext() ) {
+        while (!result && caps.isActive() && iter.hasNext()) {
             final Resource child = iter.next();
-            if ( ResourceHelper.RESOURCE_TYPE_JOB.equals(child.getResourceType()) ) {
+            if (ResourceHelper.RESOURCE_TYPE_JOB.equals(child.getResourceType())) {
                 result = true;
             } else {
                 result = hasJobs(caps, child);
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/tasks/FindUnfinishedJobsTask.java b/src/main/java/org/apache/sling/event/impl/jobs/tasks/FindUnfinishedJobsTask.java
index 7bd889b..2e9fc6b 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/tasks/FindUnfinishedJobsTask.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/tasks/FindUnfinishedJobsTask.java
@@ -62,16 +62,16 @@ public class FindUnfinishedJobsTask {
     private void initialScan() {
         logger.debug("Scanning repository for unfinished jobs...");
         final ResourceResolver resolver = configuration.createResourceResolver();
-        if ( resolver == null ) {
+        if (resolver == null) {
             return;
         }
         try {
             final Resource baseResource = resolver.getResource(configuration.getLocalJobsPath());
 
             // sanity check - should never be null
-            if ( baseResource != null ) {
+            if (baseResource != null) {
                 final Iterator<Resource> topicIter = baseResource.listChildren();
-                while ( topicIter.hasNext() ) {
+                while (topicIter.hasNext()) {
                     final Resource topicResource = topicIter.next();
                     logger.debug("Found topic {}", topicResource.getName());
 
@@ -96,35 +96,37 @@ public class FindUnfinishedJobsTask {
 
             @Override
             public boolean handle(final JobImpl job) {
-                if ( job.getProcessingStarted() != null ) {
+                if (job.getProcessingStarted() != null) {
                     logger.debug("Found unfinished job {}", job.getId());
                     job.retry();
                     try {
-                        final Resource jobResource = topicResource.getResourceResolver().getResource(job.getResourcePath());
+                        final Resource jobResource =
+                                topicResource.getResourceResolver().getResource(job.getResourcePath());
                         // sanity check
-                        if ( jobResource != null ) {
+                        if (jobResource != null) {
                             final ModifiableValueMap mvm = jobResource.adaptTo(ModifiableValueMap.class);
                             mvm.remove(Job.PROPERTY_JOB_STARTED_TIME);
                             mvm.put(Job.PROPERTY_JOB_RETRY_COUNT, job.getRetryCount());
-                            if ( job.getProperty(JobImpl.PROPERTY_JOB_QUEUED, Calendar.class) == null) {
+                            if (job.getProperty(JobImpl.PROPERTY_JOB_QUEUED, Calendar.class) == null) {
                                 mvm.put(JobImpl.PROPERTY_JOB_QUEUED, Calendar.getInstance());
                             }
                             jobResource.getResourceResolver().commit();
                         }
-                    } catch ( final PersistenceException ignore) {
+                    } catch (final PersistenceException ignore) {
                         logger.error("Unable to update unfinished job " + job, ignore);
                     }
-                } else if ( job.getProperty(JobImpl.PROPERTY_JOB_QUEUED, Calendar.class) == null) {
+                } else if (job.getProperty(JobImpl.PROPERTY_JOB_QUEUED, Calendar.class) == null) {
                     logger.debug("Found job without queued date {}", job.getId());
                     try {
-                        final Resource jobResource = topicResource.getResourceResolver().getResource(job.getResourcePath());
+                        final Resource jobResource =
+                                topicResource.getResourceResolver().getResource(job.getResourcePath());
                         // sanity check
-                        if ( jobResource != null ) {
+                        if (jobResource != null) {
                             final ModifiableValueMap mvm = jobResource.adaptTo(ModifiableValueMap.class);
                             mvm.put(JobImpl.PROPERTY_JOB_QUEUED, Calendar.getInstance());
                             jobResource.getResourceResolver().commit();
                         }
-                    } catch ( final PersistenceException ignore) {
+                    } catch (final PersistenceException ignore) {
                         logger.error("Unable to update queued date for job " + job.getId(), ignore);
                     }
                 }
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/tasks/HistoryCleanUpTask.java b/src/main/java/org/apache/sling/event/impl/jobs/tasks/HistoryCleanUpTask.java
index 6cda613..116c57c 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/tasks/HistoryCleanUpTask.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/tasks/HistoryCleanUpTask.java
@@ -18,6 +18,12 @@
  */
 package org.apache.sling.event.impl.jobs.tasks;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.Iterator;
+import java.util.List;
+
 import org.apache.sling.api.resource.PersistenceException;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceResolver;
@@ -35,12 +41,6 @@ import org.osgi.service.component.annotations.Reference;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Calendar;
-import java.util.Iterator;
-import java.util.List;
-
 /**
  * Task to clean up the history,
  * A clean up task can be configured with three properties:
@@ -51,11 +51,12 @@ import java.util.List;
  *           The value should either be a string or an array of string. Allowed values are:
  *           SUCCEEDED, STOPPED, GIVEN_UP, ERROR, DROPPED
  */
-@Component(service = JobExecutor.class,
-    property = {
-        JobExecutor.PROPERTY_TOPICS + "=org/apache/sling/event/impl/jobs/tasks/HistoryCleanUpTask",
-        Constants.SERVICE_VENDOR + "=The Apache Software Foundation"
-})
+@Component(
+        service = JobExecutor.class,
+        property = {
+            JobExecutor.PROPERTY_TOPICS + "=org/apache/sling/event/impl/jobs/tasks/HistoryCleanUpTask",
+            Constants.SERVICE_VENDOR + "=The Apache Software Foundation"
+        })
 public class HistoryCleanUpTask implements JobExecutor {
 
     private static final String PROPERTY_AGE = "age";
@@ -74,7 +75,7 @@ public class HistoryCleanUpTask implements JobExecutor {
     @Override
     public JobExecutionResult process(final Job job, final JobExecutionContext context) {
         int age = job.getProperty(PROPERTY_AGE, DEFAULT_AGE);
-        if ( age < 1 ) {
+        if (age < 1) {
             age = DEFAULT_AGE;
         }
         final Calendar removeDate = Calendar.getInstance();
@@ -84,13 +85,14 @@ public class HistoryCleanUpTask implements JobExecutor {
         final String[] states = job.getProperty(PROPERTY_STATE, String[].class);
         final String logTopics = (topics == null ? "ALL" : Arrays.toString(topics));
         final String logStates = (states == null ? "ALL" : Arrays.toString(states));
-        context.log("Cleaning up job history. Removing all jobs older than {0}, with topics {1} and states {2}",
+        context.log(
+                "Cleaning up job history. Removing all jobs older than {0}, with topics {1} and states {2}",
                 removeDate, logTopics, logStates);
 
         final List<String> stateList;
-        if ( states != null ) {
+        if (states != null) {
             stateList = new ArrayList<>();
-            for(final String s : states) {
+            for (final String s : states) {
                 stateList.add(s);
             }
         } else {
@@ -98,14 +100,16 @@ public class HistoryCleanUpTask implements JobExecutor {
         }
         final ResourceResolver resolver = this.configuration.createResourceResolver();
         try {
-            if ( stateList == null || stateList.contains(Job.JobState.SUCCEEDED.name()) ) {
+            if (stateList == null || stateList.contains(Job.JobState.SUCCEEDED.name())) {
                 this.cleanup(removeDate, resolver, context, configuration.getStoredSuccessfulJobsPath(), topics, null);
             }
-            if ( stateList == null || stateList.contains(Job.JobState.DROPPED.name())
-                 || stateList.contains(Job.JobState.ERROR.name())
-                 || stateList.contains(Job.JobState.GIVEN_UP.name())
-                 || stateList.contains(Job.JobState.STOPPED.name())) {
-                this.cleanup(removeDate, resolver, context, configuration.getStoredCancelledJobsPath(), topics, stateList);
+            if (stateList == null
+                    || stateList.contains(Job.JobState.DROPPED.name())
+                    || stateList.contains(Job.JobState.ERROR.name())
+                    || stateList.contains(Job.JobState.GIVEN_UP.name())
+                    || stateList.contains(Job.JobState.STOPPED.name())) {
+                this.cleanup(
+                        removeDate, resolver, context, configuration.getStoredCancelledJobsPath(), topics, stateList);
             }
 
         } catch (final PersistenceException pe) {
@@ -117,30 +121,31 @@ public class HistoryCleanUpTask implements JobExecutor {
         return context.result().succeeded();
     }
 
-    static void cleanup(final Calendar removeDate,
+    static void cleanup(
+            final Calendar removeDate,
             final ResourceResolver resolver,
             final JobExecutionContext context,
             final String basePath,
             final String[] topics,
             final List<String> stateList)
-    throws PersistenceException {
+            throws PersistenceException {
         final Resource baseResource = resolver.getResource(basePath);
         // sanity check - should never be null
-        if ( baseResource != null ) {
+        if (baseResource != null) {
             final Iterator<Resource> topicIter = baseResource.listChildren();
-            while ( !context.isStopped() && topicIter.hasNext() ) {
+            while (!context.isStopped() && topicIter.hasNext()) {
                 final Resource topicResource = topicIter.next();
 
                 // check topic
                 boolean found = topics == null;
                 int index = 0;
-                while ( !found && index < topics.length ) {
-                    if ( topicResource.getName().equals(topics[index]) ) {
+                while (!found && index < topics.length) {
+                    if (topicResource.getName().equals(topics[index])) {
                         found = true;
                     }
                     index++;
                 }
-                if ( !found ) {
+                if (!found) {
                     continue;
                 }
 
@@ -152,72 +157,76 @@ public class HistoryCleanUpTask implements JobExecutor {
 
                 // start with years
                 final Iterator<Resource> yearIter = topicResource.listChildren();
-                while ( !context.isStopped() && yearIter.hasNext() ) {
+                while (!context.isStopped() && yearIter.hasNext()) {
                     final Resource yearResource = yearIter.next();
                     final int year = Integer.valueOf(yearResource.getName());
-                    if ( year > removeYear ) {
+                    if (year > removeYear) {
                         continue;
                     }
                     final boolean oldYear = year < removeYear;
 
                     // months
                     final Iterator<Resource> monthIter = yearResource.listChildren();
-                    while ( !context.isStopped() && monthIter.hasNext() ) {
+                    while (!context.isStopped() && monthIter.hasNext()) {
                         final Resource monthResource = monthIter.next();
                         final int month = Integer.valueOf(monthResource.getName());
-                        if ( !oldYear && month > removeMonth) {
+                        if (!oldYear && month > removeMonth) {
                             continue;
                         }
                         final boolean oldMonth = oldYear || month < removeMonth;
 
                         // days
                         final Iterator<Resource> dayIter = monthResource.listChildren();
-                        while ( !context.isStopped() && dayIter.hasNext() ) {
+                        while (!context.isStopped() && dayIter.hasNext()) {
                             final Resource dayResource = dayIter.next();
                             final int day = Integer.valueOf(dayResource.getName());
-                            if ( !oldMonth && day > removeDay) {
+                            if (!oldMonth && day > removeDay) {
                                 continue;
                             }
                             final boolean oldDay = oldMonth || day < removeDay;
 
                             // hours
                             final Iterator<Resource> hourIter = dayResource.listChildren();
-                            while ( !context.isStopped() && hourIter.hasNext() ) {
+                            while (!context.isStopped() && hourIter.hasNext()) {
                                 final Resource hourResource = hourIter.next();
                                 final int hour = Integer.valueOf(hourResource.getName());
-                                if ( !oldDay && hour > removeHour) {
+                                if (!oldDay && hour > removeHour) {
                                     continue;
                                 }
                                 final boolean oldHour = oldDay || hour < removeHour;
 
                                 // minutes
                                 final Iterator<Resource> minuteIter = hourResource.listChildren();
-                                while ( !context.isStopped() && minuteIter.hasNext() ) {
+                                while (!context.isStopped() && minuteIter.hasNext()) {
                                     final Resource minuteResource = minuteIter.next();
 
                                     // check if we can delete the minute
                                     final int minute = Integer.valueOf(minuteResource.getName());
                                     final boolean oldMinute = oldHour || minute <= removeMinute;
 
-                                    if ( oldMinute ) {
+                                    if (oldMinute) {
                                         final Iterator<Resource> jobIter = minuteResource.listChildren();
-                                        while ( !context.isStopped() && jobIter.hasNext() ) {
+                                        while (!context.isStopped() && jobIter.hasNext()) {
                                             final Resource jobResource = jobIter.next();
                                             boolean remove = stateList == null;
-                                            if ( !remove ) {
+                                            if (!remove) {
                                                 final ValueMap vm = ResourceUtil.getValueMap(jobResource);
-                                                final String state = vm.get(JobImpl.PROPERTY_FINISHED_STATE, String.class);
-                                                if ( state != null && stateList.contains(state) ) {
+                                                final String state =
+                                                        vm.get(JobImpl.PROPERTY_FINISHED_STATE, String.class);
+                                                if (state != null && stateList.contains(state)) {
                                                     remove = true;
                                                 }
                                             }
-                                            if ( remove ) {
+                                            if (remove) {
                                                 resolver.delete(jobResource);
                                                 resolver.commit();
                                             }
                                         }
                                         // check if we can delete the minute
-                                        if ( !context.isStopped() && !minuteResource.listChildren().hasNext()) {
+                                        if (!context.isStopped()
+                                                && !minuteResource
+                                                        .listChildren()
+                                                        .hasNext()) {
                                             resolver.delete(minuteResource);
                                             resolver.commit();
                                         }
@@ -225,27 +234,35 @@ public class HistoryCleanUpTask implements JobExecutor {
                                 }
 
                                 // check if we can delete the hour
-                                if ( !context.isStopped() && oldHour && !hourResource.listChildren().hasNext()) {
+                                if (!context.isStopped()
+                                        && oldHour
+                                        && !hourResource.listChildren().hasNext()) {
                                     resolver.delete(hourResource);
                                     resolver.commit();
                                 }
                             }
                             // check if we can delete the day
-                            if ( !context.isStopped() && oldDay && !dayResource.listChildren().hasNext()) {
+                            if (!context.isStopped()
+                                    && oldDay
+                                    && !dayResource.listChildren().hasNext()) {
                                 resolver.delete(dayResource);
                                 resolver.commit();
                             }
                         }
 
                         // check if we can delete the month
-                        if ( !context.isStopped() && oldMonth && !monthResource.listChildren().hasNext() ) {
+                        if (!context.isStopped()
+                                && oldMonth
+                                && !monthResource.listChildren().hasNext()) {
                             resolver.delete(monthResource);
                             resolver.commit();
                         }
                     }
 
                     // check if we can delete the year
-                    if ( !context.isStopped() && oldYear && !yearResource.listChildren().hasNext() ) {
+                    if (!context.isStopped()
+                            && oldYear
+                            && !yearResource.listChildren().hasNext()) {
                         resolver.delete(yearResource);
                         resolver.commit();
                     }
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/tasks/UpgradeTask.java b/src/main/java/org/apache/sling/event/impl/jobs/tasks/UpgradeTask.java
index 842addf..39808bc 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/tasks/UpgradeTask.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/tasks/UpgradeTask.java
@@ -69,7 +69,7 @@ public class UpgradeTask {
      * Upgrade
      */
     public void run() {
-        if ( caps.isLeader() ) {
+        if (caps.isLeader()) {
             this.processJobsFromPreviousVersions();
         }
         this.upgradeBridgedJobs();
@@ -83,15 +83,16 @@ public class UpgradeTask {
     private void upgradeBridgedJobs() {
         final String path = configuration.getLocalJobsPath() + "/slingevent:eventadmin";
         final ResourceResolver resolver = configuration.createResourceResolver();
-        if ( resolver != null ) {
+        if (resolver != null) {
             try {
                 final Resource rootResource = resolver.getResource(path);
-                if ( rootResource != null ) {
+                if (rootResource != null) {
                     upgradeBridgedJobs(rootResource);
                 }
-                if ( caps.isLeader() ) {
-                    final Resource unassignedRoot = resolver.getResource(configuration.getUnassignedJobsPath() + "/slingevent:eventadmin");
-                    if ( unassignedRoot != null ) {
+                if (caps.isLeader()) {
+                    final Resource unassignedRoot =
+                            resolver.getResource(configuration.getUnassignedJobsPath() + "/slingevent:eventadmin");
+                    if (unassignedRoot != null) {
                         upgradeBridgedJobs(unassignedRoot);
                     }
                 }
@@ -108,7 +109,7 @@ public class UpgradeTask {
     private void upgradeBridgedJobs(final Resource topicResource) {
         final String topicName = topicResource.getName().replace('.', '/');
         final QueueConfigurationManager qcm = configuration.getQueueConfigurationManager();
-        if ( qcm == null ) {
+        if (qcm == null) {
             return;
         }
         final QueueInfo info = qcm.getQueueInfo(topicName);
@@ -122,12 +123,22 @@ public class UpgradeTask {
 
                     final Map<String, Object> props = new HashMap<>(vm);
                     final String newPath;
-                    if ( targetId != null ) {
-                        newPath = configuration.getAssginedJobsPath() + '/' + targetId + '/' + topicResource.getName() + rsrc.getPath().substring(topicResource.getPath().length());
+                    if (targetId != null) {
+                        newPath = configuration.getAssginedJobsPath()
+                                + '/'
+                                + targetId
+                                + '/'
+                                + topicResource.getName()
+                                + rsrc.getPath()
+                                        .substring(topicResource.getPath().length());
                         props.put(Job.PROPERTY_JOB_QUEUE_NAME, info.queueName);
                         props.put(Job.PROPERTY_JOB_TARGET_INSTANCE, targetId);
                     } else {
-                        newPath = configuration.getUnassignedJobsPath() + '/' + topicResource.getName() + rsrc.getPath().substring(topicResource.getPath().length());
+                        newPath = configuration.getUnassignedJobsPath()
+                                + '/'
+                                + topicResource.getName()
+                                + rsrc.getPath()
+                                        .substring(topicResource.getPath().length());
                         props.remove(Job.PROPERTY_JOB_QUEUE_NAME);
                         props.remove(Job.PROPERTY_JOB_TARGET_INSTANCE);
                     }
@@ -136,7 +147,7 @@ public class UpgradeTask {
                         ResourceHelper.getOrCreateResource(topicResource.getResourceResolver(), newPath, props);
                         topicResource.getResourceResolver().delete(rsrc);
                         topicResource.getResourceResolver().commit();
-                    } catch ( final PersistenceException pe ) {
+                    } catch (final PersistenceException pe) {
                         logger.warn("Unable to move job from previous version " + rsrc.getPath(), pe);
                         topicResource.getResourceResolver().refresh();
                         topicResource.getResourceResolver().revert();
@@ -156,11 +167,12 @@ public class UpgradeTask {
      */
     private void processJobsFromPreviousVersions() {
         final ResourceResolver resolver = configuration.createResourceResolver();
-        if ( resolver != null ) {
+        if (resolver != null) {
             try {
                 this.processJobsFromPreviousVersions(resolver.getResource(configuration.getPreviousVersionAnonPath()));
-                this.processJobsFromPreviousVersions(resolver.getResource(configuration.getPreviousVersionIdentifiedPath()));
-            } catch ( final PersistenceException pe ) {
+                this.processJobsFromPreviousVersions(
+                        resolver.getResource(configuration.getPreviousVersionIdentifiedPath()));
+            } catch (final PersistenceException pe) {
                 this.logger.warn("Problems moving jobs from previous version.", pe);
             } finally {
                 resolver.close();
@@ -172,14 +184,14 @@ public class UpgradeTask {
      * Recursively find jobs and move them
      */
     private void processJobsFromPreviousVersions(final Resource rsrc) throws PersistenceException {
-        if ( rsrc != null && caps.isActive() ) {
-            if ( rsrc.isResourceType(ResourceHelper.RESOURCE_TYPE_JOB) ) {
+        if (rsrc != null && caps.isActive()) {
+            if (rsrc.isResourceType(ResourceHelper.RESOURCE_TYPE_JOB)) {
                 this.moveJobFromPreviousVersion(rsrc);
             } else {
-                for(final Resource child : rsrc.getChildren()) {
+                for (final Resource child : rsrc.getChildren()) {
                     this.processJobsFromPreviousVersions(child);
                 }
-                if ( caps.isActive() ) {
+                if (caps.isActive()) {
                     rsrc.getResourceResolver().delete(rsrc);
                     rsrc.getResourceResolver().commit();
                     rsrc.getResourceResolver().refresh();
@@ -191,8 +203,7 @@ public class UpgradeTask {
     /**
      * Move a single job
      */
-    private void moveJobFromPreviousVersion(final Resource jobResource)
-    throws PersistenceException {
+    private void moveJobFromPreviousVersion(final Resource jobResource) throws PersistenceException {
         final ResourceResolver resolver = jobResource.getResourceResolver();
 
         try {
@@ -200,11 +211,11 @@ public class UpgradeTask {
             // check for binary properties
             Map<String, Object> binaryProperties = new HashMap<>();
             final ObjectInputStream ois = vm.get("slingevent:properties", ObjectInputStream.class);
-            if ( ois != null ) {
+            if (ois != null) {
                 try {
                     int length = ois.readInt();
-                    for(int i=0;i<length;i++) {
-                        final String key = (String)ois.readObject();
+                    for (int i = 0; i < length; i++) {
+                        final String key = (String) ois.readObject();
                         final Object value = ois.readObject();
                         binaryProperties.put(key, value);
                     }
@@ -225,7 +236,7 @@ public class UpgradeTask {
 
             final Map<String, Object> properties = ResourceHelper.cloneValueMap(vm);
 
-            final String topic = (String)properties.remove("slingevent:topic");
+            final String topic = (String) properties.remove("slingevent:topic");
             properties.put(ResourceHelper.PROPERTY_JOB_TOPIC, topic);
 
             properties.remove(Job.PROPERTY_JOB_QUEUE_NAME);
@@ -234,25 +245,26 @@ public class UpgradeTask {
             properties.putAll(binaryProperties);
             properties.remove("slingevent:properties");
 
-            if ( !properties.containsKey(Job.PROPERTY_JOB_RETRIES) ) {
-                properties.put(Job.PROPERTY_JOB_RETRIES, 10); // we put a dummy value here; this gets updated by the queue
+            if (!properties.containsKey(Job.PROPERTY_JOB_RETRIES)) {
+                properties.put(
+                        Job.PROPERTY_JOB_RETRIES, 10); // we put a dummy value here; this gets updated by the queue
             }
-            if ( !properties.containsKey(Job.PROPERTY_JOB_RETRY_COUNT) ) {
+            if (!properties.containsKey(Job.PROPERTY_JOB_RETRY_COUNT)) {
                 properties.put(Job.PROPERTY_JOB_RETRY_COUNT, 0);
             }
 
             final List<InstanceDescription> potentialTargets = caps.getPotentialTargets(topic);
             String targetId = null;
-            if ( potentialTargets != null && potentialTargets.size() > 0 ) {
+            if (potentialTargets != null && potentialTargets.size() > 0) {
                 final QueueConfigurationManager qcm = configuration.getQueueConfigurationManager();
-                if ( qcm == null ) {
+                if (qcm == null) {
                     resolver.revert();
                     return;
                 }
                 final QueueInfo info = qcm.getQueueInfo(topic);
                 logger.debug("Found queue {} for {}", info.queueConfiguration, topic);
                 targetId = caps.detectTarget(topic, vm, info);
-                if ( targetId != null ) {
+                if (targetId != null) {
                     properties.put(Job.PROPERTY_JOB_QUEUE_NAME, info.queueName);
                     properties.put(Job.PROPERTY_JOB_TARGET_INSTANCE, targetId);
                     properties.put(Job.PROPERTY_JOB_RETRIES, info.queueConfiguration.getMaxRetries());
diff --git a/src/main/java/org/apache/sling/event/impl/support/BatchResourceRemover.java b/src/main/java/org/apache/sling/event/impl/support/BatchResourceRemover.java
index f98b65c..d446414 100644
--- a/src/main/java/org/apache/sling/event/impl/support/BatchResourceRemover.java
+++ b/src/main/java/org/apache/sling/event/impl/support/BatchResourceRemover.java
@@ -39,15 +39,14 @@ public class BatchResourceRemover {
         this.max = batchSize;
     }
 
-    public void delete(final Resource rsrc )
-    throws PersistenceException {
+    public void delete(final Resource rsrc) throws PersistenceException {
         final ResourceResolver resolver = rsrc.getResourceResolver();
-        for(final Resource child : rsrc.getChildren()) {
+        for (final Resource child : rsrc.getChildren()) {
             delete(child);
         }
         resolver.delete(rsrc);
         count++;
-        if ( count >= max ) {
+        if (count >= max) {
             resolver.commit();
             count = 0;
         }
diff --git a/src/main/java/org/apache/sling/event/impl/support/ExactTopicMatcher.java b/src/main/java/org/apache/sling/event/impl/support/ExactTopicMatcher.java
index 1938b04..a941648 100644
--- a/src/main/java/org/apache/sling/event/impl/support/ExactTopicMatcher.java
+++ b/src/main/java/org/apache/sling/event/impl/support/ExactTopicMatcher.java
@@ -41,4 +41,4 @@ public class ExactTopicMatcher implements TopicMatcher {
     public String toString() {
         return "ExactTopicMatcher [topic=" + topicName + "]";
     }
-}
\ No newline at end of file
+}
diff --git a/src/main/java/org/apache/sling/event/impl/support/PackageTopicMatcher.java b/src/main/java/org/apache/sling/event/impl/support/PackageTopicMatcher.java
index 371fd8b..aea973c 100644
--- a/src/main/java/org/apache/sling/event/impl/support/PackageTopicMatcher.java
+++ b/src/main/java/org/apache/sling/event/impl/support/PackageTopicMatcher.java
@@ -18,7 +18,6 @@
  */
 package org.apache.sling.event.impl.support;
 
-
 /**
  * Package matcher - the topic must be in the same package.
  */
@@ -29,7 +28,7 @@ public class PackageTopicMatcher implements TopicMatcher {
     public PackageTopicMatcher(final String name) {
         // remove last char and maybe a trailing slash
         int lastPos = name.length() - 1;
-        if ( lastPos > 0 && name.charAt(lastPos - 1) == '/' ) {
+        if (lastPos > 0 && name.charAt(lastPos - 1) == '/') {
             lastPos--;
         }
         this.packageName = name.substring(0, lastPos);
diff --git a/src/main/java/org/apache/sling/event/impl/support/ResourceHelper.java b/src/main/java/org/apache/sling/event/impl/support/ResourceHelper.java
index 83c583b..d7e198a 100644
--- a/src/main/java/org/apache/sling/event/impl/support/ResourceHelper.java
+++ b/src/main/java/org/apache/sling/event/impl/support/ResourceHelper.java
@@ -89,8 +89,8 @@ public abstract class ResourceHelper {
      * Check if this property should be ignored
      */
     public static boolean ignoreProperty(final String name) {
-        for(final String prop : IGNORE_PROPERTIES) {
-            if ( prop.equals(name) ) {
+        for (final String prop : IGNORE_PROPERTIES) {
+            if (prop.equals(name)) {
                 return true;
             }
         }
@@ -122,7 +122,7 @@ public abstract class ResourceHelper {
      * @return the filtered queue name
      */
     public static String filterQueueName(final String queueName) {
-        if ( queueName.equals(MainQueueConfiguration.MAIN_QUEUE_NAME) ) {
+        if (queueName.equals(MainQueueConfiguration.MAIN_QUEUE_NAME)) {
             return queueName;
         } else {
             return ResourceHelper.filterName(queueName);
@@ -135,13 +135,13 @@ public abstract class ResourceHelper {
      * @return The filtered node name.
      */
     public static String filterName(final String resourceName) {
-        if ( resourceName == null ) {
+        if (resourceName == null) {
             return null;
         }
         final StringBuilder sb = new StringBuilder(resourceName.length());
         char lastAdded = 0;
 
-        for(int i=0; i < resourceName.length(); i++) {
+        for (int i = 0; i < resourceName.length(); i++) {
             final char c = resourceName.charAt(i);
             char toAdd = c;
 
@@ -152,7 +152,7 @@ public abstract class ResourceHelper {
                 }
                 toAdd = REPLACEMENT_CHAR;
 
-            } else if(i == 0 && Character.isDigit(c)) {
+            } else if (i == 0 && Character.isDigit(c)) {
                 sb.append(REPLACEMENT_CHAR);
             }
 
@@ -160,7 +160,7 @@ public abstract class ResourceHelper {
             lastAdded = toAdd;
         }
 
-        if (sb.length()==0) {
+        if (sb.length() == 0) {
             sb.append(REPLACEMENT_CHAR);
         }
 
@@ -173,53 +173,57 @@ public abstract class ResourceHelper {
         List<Exception> hasReadError = null;
         try {
             final Map<String, Object> result = new HashMap<>(vm);
-            for(final Map.Entry<String, Object> entry : result.entrySet()) {
-                if ( entry.getKey().equals(PROPERTY_SCHEDULE_INFO) ) {
+            for (final Map.Entry<String, Object> entry : result.entrySet()) {
+                if (entry.getKey().equals(PROPERTY_SCHEDULE_INFO)) {
                     final String[] infoArray = vm.get(entry.getKey(), String[].class);
-                    if ( infoArray == null || infoArray.length == 0 ) {
-                        if ( hasReadError == null ) {
+                    if (infoArray == null || infoArray.length == 0) {
+                        if (hasReadError == null) {
                             hasReadError = new ArrayList<>();
                         }
-                        hasReadError.add(new Exception("Unable to deserialize property '" + entry.getKey() + "' : " + entry.getValue()));
+                        hasReadError.add(new Exception(
+                                "Unable to deserialize property '" + entry.getKey() + "' : " + entry.getValue()));
                     } else {
                         final List<ScheduleInfo> infos = new ArrayList<>();
-                        for(final String i : infoArray) {
+                        for (final String i : infoArray) {
                             final ScheduleInfoImpl info = ScheduleInfoImpl.deserialize(i);
-                            if ( info != null ) {
+                            if (info != null) {
                                 infos.add(info);
                             }
                         }
-                        if ( infos.size() < infoArray.length ) {
-                            if ( hasReadError == null ) {
+                        if (infos.size() < infoArray.length) {
+                            if (hasReadError == null) {
                                 hasReadError = new ArrayList<>();
                             }
-                            hasReadError.add(new Exception("Unable to deserialize property '" + entry.getKey() + "' : " + Arrays.toString(infoArray)));
+                            hasReadError.add(new Exception("Unable to deserialize property '" + entry.getKey() + "' : "
+                                    + Arrays.toString(infoArray)));
                         } else {
                             entry.setValue(infos);
                         }
                     }
                 }
-                if ( entry.getValue() instanceof InputStream ) {
+                if (entry.getValue() instanceof InputStream) {
                     final Object value = vm.get(entry.getKey(), Serializable.class);
-                    if ( value != null ) {
+                    if (value != null) {
                         entry.setValue(value);
                     } else {
-                        if ( hasReadError == null ) {
+                        if (hasReadError == null) {
                             hasReadError = new ArrayList<>();
                         }
                         // let's find out which class might be missing
                         ObjectInputStream ois = null;
                         try {
-                            ois = new ObjectInputStream((InputStream)entry.getValue());
+                            ois = new ObjectInputStream((InputStream) entry.getValue());
                             ois.readObject();
 
                             hasReadError.add(new Exception("Unable to deserialize property '" + entry.getKey() + "'"));
                         } catch (final ClassNotFoundException cnfe) {
-                             hasReadError.add(new Exception("Unable to deserialize property '" + entry.getKey() + "'", cnfe));
+                            hasReadError.add(
+                                    new Exception("Unable to deserialize property '" + entry.getKey() + "'", cnfe));
                         } catch (final IOException ioe) {
-                            hasReadError.add(new RuntimeException("Unable to deserialize property '" + entry.getKey() + "'", ioe));
+                            hasReadError.add(new RuntimeException(
+                                    "Unable to deserialize property '" + entry.getKey() + "'", ioe));
                         } finally {
-                            if ( ois != null ) {
+                            if (ois != null) {
                                 try {
                                     ois.close();
                                 } catch (IOException ignore) {
@@ -230,13 +234,13 @@ public abstract class ResourceHelper {
                     }
                 }
             }
-            if ( hasReadError != null ) {
+            if (hasReadError != null) {
                 result.put(PROPERTY_MARKER_READ_ERROR_LIST, hasReadError);
             }
             return result;
-        } catch ( final IllegalArgumentException iae) {
+        } catch (final IllegalArgumentException iae) {
             // the JCR implementation might throw an IAE if something goes wrong
-            throw (InstantiationException)new InstantiationException(iae.getMessage()).initCause(iae);
+            throw (InstantiationException) new InstantiationException(iae.getMessage()).initCause(iae);
         }
     }
 
@@ -245,21 +249,17 @@ public abstract class ResourceHelper {
         // trigger full loading
         try {
             vm.size();
-        } catch ( final IllegalArgumentException iae) {
+        } catch (final IllegalArgumentException iae) {
             // the JCR implementation might throw an IAE if something goes wrong
-            throw (InstantiationException)new InstantiationException(iae.getMessage()).initCause(iae);
+            throw (InstantiationException) new InstantiationException(iae.getMessage()).initCause(iae);
         }
         return vm;
     }
 
-    public static void getOrCreateBasePath(final ResourceResolver resolver,
-            final String path)
-    throws PersistenceException {
-        ResourceUtil.getOrCreateResource(resolver,
-                        path,
-                        ResourceHelper.RESOURCE_TYPE_FOLDER,
-                        ResourceHelper.RESOURCE_TYPE_FOLDER,
-                        true);
+    public static void getOrCreateBasePath(final ResourceResolver resolver, final String path)
+            throws PersistenceException {
+        ResourceUtil.getOrCreateResource(
+                resolver, path, ResourceHelper.RESOURCE_TYPE_FOLDER, ResourceHelper.RESOURCE_TYPE_FOLDER, true);
     }
 
     /**
@@ -270,18 +270,12 @@ public abstract class ResourceHelper {
      * @return The created resource
      * @throws PersistenceException If something goes wrong
      */
-    public static Resource createAndCommitResource(final ResourceResolver resolver,
-            final String path,
-            final Map<String, Object> props)
-    throws PersistenceException {
-       return ResourceUtil.getOrCreateResource(resolver,
-                        path,
-                        props,
-                        ResourceHelper.RESOURCE_TYPE_FOLDER,
-                        true);
+    public static Resource createAndCommitResource(
+            final ResourceResolver resolver, final String path, final Map<String, Object> props)
+            throws PersistenceException {
+        return ResourceUtil.getOrCreateResource(resolver, path, props, ResourceHelper.RESOURCE_TYPE_FOLDER, true);
     }
 
-
     /**
      * Creates or gets the resource at the given path.
      * If any resource along the parent path needs to be created,
@@ -294,22 +288,14 @@ public abstract class ResourceHelper {
      * @return The resource for the path.
      * @throws PersistenceException If something goes wrong
      */
-    public static Resource getOrCreateResource(final ResourceResolver resolver,
-            final String path,
-            final Map<String, Object> props)
-    throws PersistenceException {
+    public static Resource getOrCreateResource(
+            final ResourceResolver resolver, final String path, final Map<String, Object> props)
+            throws PersistenceException {
         // create parent path with auto commit set to true
         final String parentPath = ResourceUtil.getParent(path);
-        ResourceUtil.getOrCreateResource(resolver,
-                parentPath,
-                ResourceHelper.RESOURCE_TYPE_FOLDER,
-                ResourceHelper.RESOURCE_TYPE_FOLDER,
-                true);
+        ResourceUtil.getOrCreateResource(
+                resolver, parentPath, ResourceHelper.RESOURCE_TYPE_FOLDER, ResourceHelper.RESOURCE_TYPE_FOLDER, true);
         // now create resource itself
-        return ResourceUtil.getOrCreateResource(resolver,
-                        path,
-                        props,
-                        ResourceHelper.RESOURCE_TYPE_FOLDER,
-                        false);
+        return ResourceUtil.getOrCreateResource(resolver, path, props, ResourceHelper.RESOURCE_TYPE_FOLDER, false);
     }
-}
\ No newline at end of file
+}
diff --git a/src/main/java/org/apache/sling/event/impl/support/ScheduleInfoImpl.java b/src/main/java/org/apache/sling/event/impl/support/ScheduleInfoImpl.java
index bd613a9..c9fc67c 100644
--- a/src/main/java/org/apache/sling/event/impl/support/ScheduleInfoImpl.java
+++ b/src/main/java/org/apache/sling/event/impl/support/ScheduleInfoImpl.java
@@ -61,7 +61,7 @@ public class ScheduleInfoImpl implements ScheduleInfo, Serializable {
     public static ScheduleInfoImpl DAILY(final int hour, final int minute) {
         return new ScheduleInfoImpl(ScheduleType.DAILY, -1, hour, minute, null, -1, null);
     }
-    
+
     public static final String EVENTING_THREADPOOL_NAME = "org-apache-sling-event";
 
     private final ScheduleType scheduleType;
@@ -78,7 +78,8 @@ public class ScheduleInfoImpl implements ScheduleInfo, Serializable {
 
     private final String expression;
 
-    private ScheduleInfoImpl(final ScheduleType scheduleType,
+    private ScheduleInfoImpl(
+            final ScheduleType scheduleType,
             final int dayOfWeek,
             final int hourOfDay,
             final int minuteOfHour,
@@ -96,76 +97,62 @@ public class ScheduleInfoImpl implements ScheduleInfo, Serializable {
 
     public static ScheduleInfoImpl deserialize(final ScheduleType scheduleType, final String s) {
         final String[] parts = s.split("|");
-        if ( scheduleType == ScheduleType.YEARLY && parts.length == 4 ) {
+        if (scheduleType == ScheduleType.YEARLY && parts.length == 4) {
             try {
-                return new ScheduleInfoImpl(scheduleType,
+                return new ScheduleInfoImpl(
+                        scheduleType,
                         Integer.parseInt(parts[0]),
                         Integer.parseInt(parts[1]),
                         Integer.parseInt(parts[2]),
                         null,
                         Integer.parseInt(parts[3]),
                         null);
-            } catch ( final IllegalArgumentException iae) {
+            } catch (final IllegalArgumentException iae) {
                 // ignore and return null
             }
-        } else if ( scheduleType == ScheduleType.MONTHLY && parts.length == 3 ) {
+        } else if (scheduleType == ScheduleType.MONTHLY && parts.length == 3) {
             try {
-                return new ScheduleInfoImpl(scheduleType,
+                return new ScheduleInfoImpl(
+                        scheduleType,
                         Integer.parseInt(parts[0]),
                         Integer.parseInt(parts[1]),
                         Integer.parseInt(parts[2]),
                         null,
                         -1,
                         null);
-            } catch ( final IllegalArgumentException iae) {
+            } catch (final IllegalArgumentException iae) {
                 // ignore and return null
             }
-        } else if ( scheduleType == ScheduleType.WEEKLY && parts.length == 3 ) {
+        } else if (scheduleType == ScheduleType.WEEKLY && parts.length == 3) {
             try {
-                return new ScheduleInfoImpl(scheduleType,
+                return new ScheduleInfoImpl(
+                        scheduleType,
                         Integer.parseInt(parts[0]),
                         Integer.parseInt(parts[1]),
                         Integer.parseInt(parts[2]),
                         null,
                         -1,
                         null);
-            } catch ( final IllegalArgumentException iae) {
+            } catch (final IllegalArgumentException iae) {
                 // ignore and return null
             }
-        } else if ( scheduleType == ScheduleType.DAILY && parts.length == 2 ) {
+        } else if (scheduleType == ScheduleType.DAILY && parts.length == 2) {
             try {
-                return new ScheduleInfoImpl(scheduleType,
-                        -1,
-                        Integer.parseInt(parts[0]),
-                        Integer.parseInt(parts[1]),
-                        null,
-                        -1,
-                        null);
-            } catch ( final IllegalArgumentException iae) {
+                return new ScheduleInfoImpl(
+                        scheduleType, -1, Integer.parseInt(parts[0]), Integer.parseInt(parts[1]), null, -1, null);
+            } catch (final IllegalArgumentException iae) {
                 // ignore and return null
             }
-        } else if ( scheduleType == ScheduleType.HOURLY && parts.length == 1 ) {
+        } else if (scheduleType == ScheduleType.HOURLY && parts.length == 1) {
             try {
-                return new ScheduleInfoImpl(scheduleType,
-                        -1,
-                        -1,
-                        Integer.parseInt(parts[0]),
-                        null,
-                        -1,
-                        null);
-            } catch ( final IllegalArgumentException iae) {
+                return new ScheduleInfoImpl(scheduleType, -1, -1, Integer.parseInt(parts[0]), null, -1, null);
+            } catch (final IllegalArgumentException iae) {
                 // ignore and return null
             }
-        } else if ( scheduleType == ScheduleType.CRON && parts.length == 1 ) {
+        } else if (scheduleType == ScheduleType.CRON && parts.length == 1) {
             try {
-                return new ScheduleInfoImpl(scheduleType,
-                        -1,
-                        -1,
-                        -1,
-                        null,
-                        -1,
-                        parts[0]);
-            } catch ( final IllegalArgumentException iae) {
+                return new ScheduleInfoImpl(scheduleType, -1, -1, -1, null, -1, parts[0]);
+            } catch (final IllegalArgumentException iae) {
                 // ignore and return null
             }
         }
@@ -175,17 +162,17 @@ public class ScheduleInfoImpl implements ScheduleInfo, Serializable {
 
     public static ScheduleInfoImpl deserialize(final String s) {
         final String[] parts = s.split("\\|");
-        if ( parts.length == 8 && parts[0].equals(VERSION) ) {
+        if (parts.length == 8 && parts[0].equals(VERSION)) {
             try {
-                return new ScheduleInfoImpl(ScheduleType.valueOf(parts[1]),
+                return new ScheduleInfoImpl(
+                        ScheduleType.valueOf(parts[1]),
                         Integer.parseInt(parts[2]),
                         Integer.parseInt(parts[3]),
                         Integer.parseInt(parts[4]),
                         (parts[5].equals("null") ? null : new Date(Long.parseLong(parts[5]))),
                         Integer.parseInt(parts[6]),
-                        (parts[7].equals("null") ? null : parts[7])
-                        );
-            } catch ( final IllegalArgumentException iae) {
+                        (parts[7].equals("null") ? null : parts[7]));
+            } catch (final IllegalArgumentException iae) {
                 // ignore and return null
             }
         }
@@ -204,7 +191,7 @@ public class ScheduleInfoImpl implements ScheduleInfo, Serializable {
         sb.append("|");
         sb.append(String.valueOf(this.minuteOfHour));
         sb.append("|");
-        if ( at == null ) {
+        if (at == null) {
             sb.append("null");
         } else {
             sb.append(String.valueOf(at.getTime()));
@@ -212,7 +199,7 @@ public class ScheduleInfoImpl implements ScheduleInfo, Serializable {
         sb.append("|");
         sb.append(String.valueOf(this.monthOfYear));
         sb.append("|");
-        if ( expression == null ) {
+        if (expression == null) {
             sb.append("null");
         } else {
             sb.append(String.valueOf(expression));
@@ -257,107 +244,122 @@ public class ScheduleInfoImpl implements ScheduleInfo, Serializable {
 
     @Override
     public int getDayOfMonth() {
-        return (this.scheduleType == ScheduleType.MONTHLY
-                || this.scheduleType == ScheduleType.YEARLY ? this.dayOfWeek : -1);
+        return (this.scheduleType == ScheduleType.MONTHLY || this.scheduleType == ScheduleType.YEARLY
+                ? this.dayOfWeek
+                : -1);
     }
 
     public void check(final List<String> errors) {
-        switch ( this.scheduleType ) {
-        case DAILY : if ( hourOfDay < 0 || hourOfDay > 23 || minuteOfHour < 0 || minuteOfHour > 59 ) {
-                         errors.add("Wrong time information : " + minuteOfHour + ":" + minuteOfHour);
-                     }
-                     break;
-        case DATE :  if ( at == null || at.getTime() <= System.currentTimeMillis() + 2000 ) {
-                         errors.add("Date must be in the future : " + at);
-                     }
-                     break;
-        case HOURLY : if ( minuteOfHour < 0 || minuteOfHour > 59 ) {
-                          errors.add("Minute must be between 0 and 59 : " + minuteOfHour);
-                      }
-                      break;
-        case WEEKLY : if ( hourOfDay < 0 || hourOfDay > 23 || minuteOfHour < 0 || minuteOfHour > 59 ) {
-                          errors.add("Wrong time information : " + minuteOfHour + ":" + minuteOfHour);
-                      }
-                      if ( dayOfWeek < 1 || dayOfWeek > 7 ) {
-                          errors.add("Day must be between 1 and 7 : " + dayOfWeek);
-                      }
-                      break;
-        case MONTHLY : if ( hourOfDay < 0 || hourOfDay > 23 || minuteOfHour < 0 || minuteOfHour > 59 ) {
-                           errors.add("Wrong time information : " + minuteOfHour + ":" + minuteOfHour);
-                       }
-                       if ( dayOfWeek < 1 || dayOfWeek > 28 ) {
-                           errors.add("Day must be between 1 and 28 : " + dayOfWeek);
-                       }
-                       break;
-        case YEARLY : if ( hourOfDay < 0 || hourOfDay > 23 || minuteOfHour < 0 || minuteOfHour > 59 ) {
-                          errors.add("Wrong time information : " + minuteOfHour + ":" + minuteOfHour);
-                      }
-                      if ( dayOfWeek < 1 || dayOfWeek > 28 ) {
-                          errors.add("Day must be between 1 and 28 : " + dayOfWeek);
-                      }
-                      if ( monthOfYear < 1 || monthOfYear > 12 ) {
-                          errors.add("Month must be between 1 and 12 : " + dayOfWeek);
-                      }
-                      break;
-        case CRON : if ( expression == null ) {
-                         errors.add("Expression must be specified.");
-                    }
-                    try {
-                        new CronExpression(this.expression);
-                    } catch (final ParseException e) {
-                        errors.add("Expression must be valid: " + this.expression);
-                    }
+        switch (this.scheduleType) {
+            case DAILY:
+                if (hourOfDay < 0 || hourOfDay > 23 || minuteOfHour < 0 || minuteOfHour > 59) {
+                    errors.add("Wrong time information : " + minuteOfHour + ":" + minuteOfHour);
+                }
+                break;
+            case DATE:
+                if (at == null || at.getTime() <= System.currentTimeMillis() + 2000) {
+                    errors.add("Date must be in the future : " + at);
+                }
+                break;
+            case HOURLY:
+                if (minuteOfHour < 0 || minuteOfHour > 59) {
+                    errors.add("Minute must be between 0 and 59 : " + minuteOfHour);
+                }
+                break;
+            case WEEKLY:
+                if (hourOfDay < 0 || hourOfDay > 23 || minuteOfHour < 0 || minuteOfHour > 59) {
+                    errors.add("Wrong time information : " + minuteOfHour + ":" + minuteOfHour);
+                }
+                if (dayOfWeek < 1 || dayOfWeek > 7) {
+                    errors.add("Day must be between 1 and 7 : " + dayOfWeek);
+                }
+                break;
+            case MONTHLY:
+                if (hourOfDay < 0 || hourOfDay > 23 || minuteOfHour < 0 || minuteOfHour > 59) {
+                    errors.add("Wrong time information : " + minuteOfHour + ":" + minuteOfHour);
+                }
+                if (dayOfWeek < 1 || dayOfWeek > 28) {
+                    errors.add("Day must be between 1 and 28 : " + dayOfWeek);
+                }
+                break;
+            case YEARLY:
+                if (hourOfDay < 0 || hourOfDay > 23 || minuteOfHour < 0 || minuteOfHour > 59) {
+                    errors.add("Wrong time information : " + minuteOfHour + ":" + minuteOfHour);
+                }
+                if (dayOfWeek < 1 || dayOfWeek > 28) {
+                    errors.add("Day must be between 1 and 28 : " + dayOfWeek);
+                }
+                if (monthOfYear < 1 || monthOfYear > 12) {
+                    errors.add("Month must be between 1 and 12 : " + dayOfWeek);
+                }
+                break;
+            case CRON:
+                if (expression == null) {
+                    errors.add("Expression must be specified.");
+                }
+                try {
+                    new CronExpression(this.expression);
+                } catch (final ParseException e) {
+                    errors.add("Expression must be valid: " + this.expression);
+                }
         }
     }
 
     public Date getNextScheduledExecution() {
         final Calendar now = Calendar.getInstance();
-        switch ( this.scheduleType ) {
-            case DATE : return this.at;
-            case DAILY : final Calendar next = Calendar.getInstance();
-                         next.set(Calendar.HOUR_OF_DAY, this.hourOfDay);
-                         next.set(Calendar.MINUTE, this.minuteOfHour);
-                         if ( next.before(now) ) {
-                             next.add(Calendar.DAY_OF_WEEK, 1);
-                         }
-                         return next.getTime();
-            case WEEKLY : final Calendar nextW = Calendar.getInstance();
-                          nextW.set(Calendar.HOUR_OF_DAY, this.hourOfDay);
-                          nextW.set(Calendar.MINUTE, this.minuteOfHour);
-                          nextW.set(Calendar.DAY_OF_WEEK, this.dayOfWeek);
-                          if ( nextW.before(now) ) {
-                              nextW.add(Calendar.WEEK_OF_YEAR, 1);
-                          }
-                          return nextW.getTime();
-            case HOURLY : final Calendar nextH = Calendar.getInstance();
-                          nextH.set(Calendar.MINUTE, this.minuteOfHour);
-                          if ( nextH.before(now) ) {
-                              nextH.add(Calendar.HOUR_OF_DAY, 1);
-                          }
-                          return nextH.getTime();
-            case MONTHLY : final Calendar nextM = Calendar.getInstance();
-                           nextM.set(Calendar.HOUR_OF_DAY, this.hourOfDay);
-                           nextM.set(Calendar.MINUTE, this.minuteOfHour);
-                           nextM.set(Calendar.DAY_OF_MONTH, this.dayOfWeek);
-                           if ( nextM.before(now) ) {
-                               nextM.add(Calendar.MONTH, 1);
-                           }
-                           return nextM.getTime();
-            case YEARLY : final Calendar nextY = Calendar.getInstance();
-                          nextY.set(Calendar.HOUR_OF_DAY, this.hourOfDay);
-                          nextY.set(Calendar.MINUTE, this.minuteOfHour);
-                          nextY.set(Calendar.DAY_OF_MONTH, this.dayOfWeek);
-                          nextY.set(Calendar.MONTH, this.monthOfYear - 1);
-                          if ( nextY.before(now) ) {
-                              nextY.add(Calendar.YEAR, 1);
-                          }
-                          return nextY.getTime();
-            case CRON : try {
-                            final CronExpression exp = new CronExpression(this.expression);
-                            return exp.getNextValidTimeAfter(new Date());
-                        } catch (final ParseException e) {
-                            // as we check the expression in check() everything should be fine here
-                        }
+        switch (this.scheduleType) {
+            case DATE:
+                return this.at;
+            case DAILY:
+                final Calendar next = Calendar.getInstance();
+                next.set(Calendar.HOUR_OF_DAY, this.hourOfDay);
+                next.set(Calendar.MINUTE, this.minuteOfHour);
+                if (next.before(now)) {
+                    next.add(Calendar.DAY_OF_WEEK, 1);
+                }
+                return next.getTime();
+            case WEEKLY:
+                final Calendar nextW = Calendar.getInstance();
+                nextW.set(Calendar.HOUR_OF_DAY, this.hourOfDay);
+                nextW.set(Calendar.MINUTE, this.minuteOfHour);
+                nextW.set(Calendar.DAY_OF_WEEK, this.dayOfWeek);
+                if (nextW.before(now)) {
+                    nextW.add(Calendar.WEEK_OF_YEAR, 1);
+                }
+                return nextW.getTime();
+            case HOURLY:
+                final Calendar nextH = Calendar.getInstance();
+                nextH.set(Calendar.MINUTE, this.minuteOfHour);
+                if (nextH.before(now)) {
+                    nextH.add(Calendar.HOUR_OF_DAY, 1);
+                }
+                return nextH.getTime();
+            case MONTHLY:
+                final Calendar nextM = Calendar.getInstance();
+                nextM.set(Calendar.HOUR_OF_DAY, this.hourOfDay);
+                nextM.set(Calendar.MINUTE, this.minuteOfHour);
+                nextM.set(Calendar.DAY_OF_MONTH, this.dayOfWeek);
+                if (nextM.before(now)) {
+                    nextM.add(Calendar.MONTH, 1);
+                }
+                return nextM.getTime();
+            case YEARLY:
+                final Calendar nextY = Calendar.getInstance();
+                nextY.set(Calendar.HOUR_OF_DAY, this.hourOfDay);
+                nextY.set(Calendar.MINUTE, this.minuteOfHour);
+                nextY.set(Calendar.DAY_OF_MONTH, this.dayOfWeek);
+                nextY.set(Calendar.MONTH, this.monthOfYear - 1);
+                if (nextY.before(now)) {
+                    nextY.add(Calendar.YEAR, 1);
+                }
+                return nextY.getTime();
+            case CRON:
+                try {
+                    final CronExpression exp = new CronExpression(this.expression);
+                    return exp.getNextValidTimeAfter(new Date());
+                } catch (final ParseException e) {
+                    // as we check the expression in check() everything should be fine here
+                }
         }
         return null;
     }
@@ -366,14 +368,14 @@ public class ScheduleInfoImpl implements ScheduleInfo, Serializable {
      * If the job is scheduled daily or weekly, return the cron expression
      */
     public String getCronExpression() {
-        if ( this.scheduleType == ScheduleType.DAILY ) {
+        if (this.scheduleType == ScheduleType.DAILY) {
             final StringBuilder sb = new StringBuilder("0 ");
             sb.append(String.valueOf(this.minuteOfHour));
             sb.append(' ');
             sb.append(String.valueOf(this.hourOfDay));
             sb.append(" * * ?");
             return sb.toString();
-        } else if ( this.scheduleType == ScheduleType.WEEKLY ) {
+        } else if (this.scheduleType == ScheduleType.WEEKLY) {
             final StringBuilder sb = new StringBuilder("0 ");
             sb.append(String.valueOf(this.minuteOfHour));
             sb.append(' ');
@@ -381,12 +383,12 @@ public class ScheduleInfoImpl implements ScheduleInfo, Serializable {
             sb.append(" ? * ");
             sb.append(String.valueOf(this.dayOfWeek));
             return sb.toString();
-        } else if ( this.scheduleType == ScheduleType.HOURLY ) {
+        } else if (this.scheduleType == ScheduleType.HOURLY) {
             final StringBuilder sb = new StringBuilder("0 ");
             sb.append(String.valueOf(this.minuteOfHour));
             sb.append(" * * * ?");
             return sb.toString();
-        } else if ( this.scheduleType == ScheduleType.MONTHLY ) {
+        } else if (this.scheduleType == ScheduleType.MONTHLY) {
             final StringBuilder sb = new StringBuilder("0 ");
             sb.append(String.valueOf(this.minuteOfHour));
             sb.append(' ');
@@ -395,7 +397,7 @@ public class ScheduleInfoImpl implements ScheduleInfo, Serializable {
             sb.append(String.valueOf(this.dayOfWeek));
             sb.append(" * ?");
             return sb.toString();
-        } else if ( this.scheduleType == ScheduleType.YEARLY ) {
+        } else if (this.scheduleType == ScheduleType.YEARLY) {
             final StringBuilder sb = new StringBuilder("0 ");
             sb.append(String.valueOf(this.minuteOfHour));
             sb.append(' ');
@@ -406,7 +408,7 @@ public class ScheduleInfoImpl implements ScheduleInfo, Serializable {
             sb.append(String.valueOf(this.monthOfYear - 1));
             sb.append(" ?");
             return sb.toString();
-        } else if ( this.scheduleType == ScheduleType.CRON ) {
+        } else if (this.scheduleType == ScheduleType.CRON) {
             return this.expression;
         }
         return null;
diff --git a/src/main/java/org/apache/sling/event/impl/support/SubPackagesTopicMatcher.java b/src/main/java/org/apache/sling/event/impl/support/SubPackagesTopicMatcher.java
index a53ecf8..bc19c42 100644
--- a/src/main/java/org/apache/sling/event/impl/support/SubPackagesTopicMatcher.java
+++ b/src/main/java/org/apache/sling/event/impl/support/SubPackagesTopicMatcher.java
@@ -18,7 +18,6 @@
  */
 package org.apache.sling.event.impl.support;
 
-
 /**
  * Sub package matcher - the topic must be in the same package or a sub package.
  */
@@ -29,7 +28,7 @@ public class SubPackagesTopicMatcher implements TopicMatcher {
     public SubPackagesTopicMatcher(final String name) {
         // remove last char and maybe a trailing slash
         int lastPos = name.length() - 1;
-        if ( lastPos > 0 && name.charAt(lastPos - 1) == '/' ) {
+        if (lastPos > 0 && name.charAt(lastPos - 1) == '/') {
             this.packageName = name.substring(0, lastPos);
         } else {
             this.packageName = name.substring(0, lastPos) + '/';
@@ -42,11 +41,13 @@ public class SubPackagesTopicMatcher implements TopicMatcher {
     @Override
     public String match(final String topic) {
         final int pos = topic.lastIndexOf('/');
... 5854 lines suppressed ...