You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ss...@apache.org on 2025/03/27 08:41:20 UTC

(sling-org-apache-sling-resourceresolver) branch master updated (8f9f7880 -> e1b66bd0)

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

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


    from 8f9f7880 SLING-12606: Implement Jakarta Servlet based API (#126)
     new 5ea74c75 SLING-12716 Switch to Parent 62
     new e1b66bd0 SLING-12716 apply spotless formatting

The 2 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                                 |   5 +
 pom.xml                                            | 110 ++-
 .../impl/CommonResourceResolverFactoryImpl.java    | 104 +--
 .../impl/FactoryPreconditions.java                 |  48 +-
 .../impl/FactoryRegistrationHandler.java           |  79 +-
 .../resourceresolver/impl/JcrNamespaceMangler.java |  18 +-
 .../impl/ResourceAccessSecurityTracker.java        |  25 +-
 .../impl/ResourceResolverFactoryActivator.java     | 148 ++--
 .../impl/ResourceResolverFactoryConfig.java        | 231 +++---
 .../impl/ResourceResolverFactoryImpl.java          |  22 +-
 .../impl/ResourceResolverImpl.java                 | 291 +++++---
 .../impl/ResourceResolverMetrics.java              |  50 +-
 .../resourceresolver/impl/ResourceTypeUtil.java    |   7 +-
 .../impl/VanityPathConfigurer.java                 |  51 +-
 .../console/ResourceResolverWebConsolePlugin.java  | 117 ++-
 .../impl/helper/RedirectResource.java              |   7 +-
 .../impl/helper/ResourceDecoratorTracker.java      |  10 +-
 .../impl/helper/ResourceIteratorDecorator.java     |   3 +-
 .../impl/helper/ResourcePathIterator.java          |  27 +-
 .../impl/helper/ResourceResolverContext.java       |  19 +-
 .../impl/helper/ResourceResolverControl.java       | 296 +++++---
 .../resourceresolver/impl/helper/StarResource.java |  18 +-
 .../sling/resourceresolver/impl/helper/URI.java    | 255 +++----
 .../resourceresolver/impl/helper/URIException.java |   4 +-
 .../impl/helper/UniqueResourceIterator.java        |   1 -
 .../impl/legacy/LegacyResourceProviderAdapter.java |  43 +-
 .../LegacyResourceProviderFactoryAdapter.java      |  56 +-
 .../legacy/LegacyResourceProviderWhiteboard.java   |  94 ++-
 .../impl/mapping/BloomFilterUtils.java             |  29 +-
 .../impl/mapping/Interpolator.java                 |  38 +-
 .../impl/mapping/MapConfigurationProvider.java     |  28 +-
 .../resourceresolver/impl/mapping/MapEntries.java  | 287 ++++---
 .../impl/mapping/MapEntriesHandler.java            |  23 +-
 .../resourceresolver/impl/mapping/MapEntry.java    | 145 ++--
 .../impl/mapping/MapEntryIterator.java             |  20 +-
 .../resourceresolver/impl/mapping/Mapping.java     |  41 +-
 .../impl/mapping/PagedQueryIterator.java           |  26 +-
 .../impl/mapping/PathGenerator.java                |  55 +-
 .../impl/mapping/ResourceMapperImpl.java           | 189 ++---
 .../StringInterpolationProviderConfiguration.java  |  15 +-
 .../mapping/StringInterpolationProviderImpl.java   |  24 +-
 .../impl/mapping/VanityPathHandler.java            | 115 +--
 .../impl/observation/BasicObservationReporter.java | 125 ++--
 .../observation/BasicObserverConfiguration.java    |  47 +-
 .../impl/observation/OsgiObservationBridge.java    |  76 +-
 .../impl/observation/ResourceChangeListImpl.java   |   2 +-
 .../observation/ResourceChangeListenerInfo.java    |  80 +-
 .../ResourceChangeListenerWhiteboard.java          |  74 +-
 .../impl/params/ParametersParser.java              |  10 +-
 .../impl/params/ParsedParameters.java              |  21 +-
 .../resourceresolver/impl/params/PathParser.java   |  13 +-
 .../impl/providers/ResourceProviderHandler.java    |   8 +-
 .../impl/providers/ResourceProviderInfo.java       |  42 +-
 .../impl/providers/ResourceProviderStorage.java    |   4 +-
 .../providers/ResourceProviderStorageProvider.java |   3 +-
 .../impl/providers/ResourceProviderTracker.java    | 116 +--
 .../stateful/AuthenticatedResourceProvider.java    |  97 +--
 .../providers/stateful/BasicResolveContext.java    |  28 +-
 .../impl/providers/stateful/ProviderManager.java   |  96 +--
 .../resourceresolver/impl/providers/tree/Node.java |   6 +-
 .../impl/providers/tree/PathTree.java              |   4 +-
 .../impl/providers/tree/Pathable.java              |   1 -
 .../impl/EtcMappingResourceResolverTest.java       | 231 ++++--
 .../impl/FactoryPreconditionsTest.java             |  33 +-
 .../impl/FactoryRegistrationHandlerTest.java       |  27 +-
 .../sling/resourceresolver/impl/Fixture.java       |  52 +-
 .../impl/MockedResourceResolverImplTest.java       | 537 ++++++++------
 .../resourceresolver/impl/ProviderHandlerTest.java |  34 +-
 .../impl/ResourceDecorationTest.java               |  61 +-
 .../impl/ResourceDecoratorReturnsNullTest.java     |  40 +-
 .../impl/ResourceDecoratorTestBase.java            |  35 +-
 .../impl/ResourceProviderEntryTest.java            | 147 +++-
 .../impl/ResourceResolverFactoryTest.java          |  32 +-
 .../impl/ResourceResolverImplTest.java             | 237 +++---
 .../impl/ResourceResolverMangleNamespacesTest.java |  27 +-
 .../impl/ResourceResolverMetricsTest.java          |   6 +-
 .../impl/ResourceTypeUtilTest.java                 |  19 +-
 .../resourceresolver/impl/SimpleValueMapImpl.java  |  24 +-
 .../impl/VanityPathConfigurerTest.java             |  20 +-
 .../impl/helper/RedirectResourceTest.java          |  21 +-
 .../impl/helper/ResourcePathIteratorTest.java      |  76 +-
 .../impl/helper/ResourceResolverControlTest.java   | 274 ++++---
 .../impl/helper/StarResourceTest.java              |  50 +-
 .../resourceresolver/impl/helper/URI2Test.java     |  33 +-
 .../resourceresolver/impl/helper/URITest.java      | 232 +++---
 .../mapping/AbstractMappingMapEntriesTest.java     |  79 +-
 .../impl/mapping/AliasMapEntriesTest.java          | 218 +++---
 .../impl/mapping/BloomFilterUtilsTest.java         |  82 +-
 .../impl/mapping/EtcMappingMapEntriesTest.java     | 213 +++---
 .../impl/mapping/InMemoryResource.java             | 117 ++-
 .../impl/mapping/InMemoryResourceProvider.java     |  50 +-
 .../impl/mapping/InterpolatorTest.java             |  83 +--
 .../impl/mapping/MapEntriesTest.java               | 114 +--
 .../impl/mapping/MapEntryIteratorTest.java         |  54 +-
 .../impl/mapping/MapEntryTest.java                 | 218 +++---
 .../impl/mapping/PagedQueryIteratorTest.java       |  66 +-
 .../impl/mapping/PathGeneratorTest.java            |  87 +--
 .../impl/mapping/ResourceMapperImplTest.java       | 332 +++++----
 .../mapping/StringInterpolationMapEntriesTest.java |  56 +-
 .../StringInterpolationProviderImplTest.java       | 110 ++-
 .../impl/mapping/VanityPathMapEntriesTest.java     | 825 ++++++++++++---------
 .../observation/BasicObservationReporterTest.java  |  42 +-
 .../ResourceChangeListenerInfoTest.java            |  57 +-
 .../impl/params/PathParserTest.java                |  11 +-
 .../impl/providers/ResourceProviderInfoTest.java   |  28 +-
 .../providers/ResourceProviderStorageTest.java     |  13 +-
 .../providers/ResourceProviderTrackerTest.java     |  31 +-
 .../AuthenticatedResourceProviderTest.java         |  23 +-
 .../SecureResourceProviderDecoratorTest.java       |  35 +-
 .../impl/providers/tree/PathTreeTest.java          |  28 +-
 .../resourceresolver/util/CustomMatchers.java      |  27 +-
 .../sling/resourceresolver/util/MockTestUtil.java  | 153 ++--
 .../util/events/AbstractAwaitingListener.java      |  14 +-
 .../util/events/RecordingListener.java             |  30 +-
 .../util/events/ServiceEventUtil.java              |  12 +-
 115 files changed, 5140 insertions(+), 4343 deletions(-)
 create mode 100644 .sling-module.json


(sling-org-apache-sling-resourceresolver) 02/02: SLING-12716 apply spotless formatting

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

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

commit e1b66bd0ca51bc3663a621dabb3214113b7d6dfb
Author: Stefan Seifert <st...@users.noreply.github.com>
AuthorDate: Thu Mar 27 09:33:20 2025 +0100

    SLING-12716 apply spotless formatting
---
 pom.xml                                            | 108 ++-
 .../impl/CommonResourceResolverFactoryImpl.java    | 104 +--
 .../impl/FactoryPreconditions.java                 |  48 +-
 .../impl/FactoryRegistrationHandler.java           |  79 +-
 .../resourceresolver/impl/JcrNamespaceMangler.java |  18 +-
 .../impl/ResourceAccessSecurityTracker.java        |  25 +-
 .../impl/ResourceResolverFactoryActivator.java     | 148 ++--
 .../impl/ResourceResolverFactoryConfig.java        | 231 +++---
 .../impl/ResourceResolverFactoryImpl.java          |  22 +-
 .../impl/ResourceResolverImpl.java                 | 291 +++++---
 .../impl/ResourceResolverMetrics.java              |  50 +-
 .../resourceresolver/impl/ResourceTypeUtil.java    |   7 +-
 .../impl/VanityPathConfigurer.java                 |  51 +-
 .../console/ResourceResolverWebConsolePlugin.java  | 117 ++-
 .../impl/helper/RedirectResource.java              |   7 +-
 .../impl/helper/ResourceDecoratorTracker.java      |  10 +-
 .../impl/helper/ResourceIteratorDecorator.java     |   3 +-
 .../impl/helper/ResourcePathIterator.java          |  27 +-
 .../impl/helper/ResourceResolverContext.java       |  19 +-
 .../impl/helper/ResourceResolverControl.java       | 296 +++++---
 .../resourceresolver/impl/helper/StarResource.java |  18 +-
 .../sling/resourceresolver/impl/helper/URI.java    | 255 +++----
 .../resourceresolver/impl/helper/URIException.java |   4 +-
 .../impl/helper/UniqueResourceIterator.java        |   1 -
 .../impl/legacy/LegacyResourceProviderAdapter.java |  43 +-
 .../LegacyResourceProviderFactoryAdapter.java      |  56 +-
 .../legacy/LegacyResourceProviderWhiteboard.java   |  94 ++-
 .../impl/mapping/BloomFilterUtils.java             |  29 +-
 .../impl/mapping/Interpolator.java                 |  38 +-
 .../impl/mapping/MapConfigurationProvider.java     |  28 +-
 .../resourceresolver/impl/mapping/MapEntries.java  | 287 ++++---
 .../impl/mapping/MapEntriesHandler.java            |  23 +-
 .../resourceresolver/impl/mapping/MapEntry.java    | 145 ++--
 .../impl/mapping/MapEntryIterator.java             |  20 +-
 .../resourceresolver/impl/mapping/Mapping.java     |  41 +-
 .../impl/mapping/PagedQueryIterator.java           |  26 +-
 .../impl/mapping/PathGenerator.java                |  55 +-
 .../impl/mapping/ResourceMapperImpl.java           | 189 ++---
 .../StringInterpolationProviderConfiguration.java  |  15 +-
 .../mapping/StringInterpolationProviderImpl.java   |  24 +-
 .../impl/mapping/VanityPathHandler.java            | 115 +--
 .../impl/observation/BasicObservationReporter.java | 125 ++--
 .../observation/BasicObserverConfiguration.java    |  47 +-
 .../impl/observation/OsgiObservationBridge.java    |  76 +-
 .../impl/observation/ResourceChangeListImpl.java   |   2 +-
 .../observation/ResourceChangeListenerInfo.java    |  80 +-
 .../ResourceChangeListenerWhiteboard.java          |  74 +-
 .../impl/params/ParametersParser.java              |  10 +-
 .../impl/params/ParsedParameters.java              |  21 +-
 .../resourceresolver/impl/params/PathParser.java   |  13 +-
 .../impl/providers/ResourceProviderHandler.java    |   8 +-
 .../impl/providers/ResourceProviderInfo.java       |  42 +-
 .../impl/providers/ResourceProviderStorage.java    |   4 +-
 .../providers/ResourceProviderStorageProvider.java |   3 +-
 .../impl/providers/ResourceProviderTracker.java    | 116 +--
 .../stateful/AuthenticatedResourceProvider.java    |  97 +--
 .../providers/stateful/BasicResolveContext.java    |  28 +-
 .../impl/providers/stateful/ProviderManager.java   |  96 +--
 .../resourceresolver/impl/providers/tree/Node.java |   6 +-
 .../impl/providers/tree/PathTree.java              |   4 +-
 .../impl/providers/tree/Pathable.java              |   1 -
 .../impl/EtcMappingResourceResolverTest.java       | 231 ++++--
 .../impl/FactoryPreconditionsTest.java             |  33 +-
 .../impl/FactoryRegistrationHandlerTest.java       |  27 +-
 .../sling/resourceresolver/impl/Fixture.java       |  52 +-
 .../impl/MockedResourceResolverImplTest.java       | 537 ++++++++------
 .../resourceresolver/impl/ProviderHandlerTest.java |  34 +-
 .../impl/ResourceDecorationTest.java               |  61 +-
 .../impl/ResourceDecoratorReturnsNullTest.java     |  40 +-
 .../impl/ResourceDecoratorTestBase.java            |  35 +-
 .../impl/ResourceProviderEntryTest.java            | 147 +++-
 .../impl/ResourceResolverFactoryTest.java          |  32 +-
 .../impl/ResourceResolverImplTest.java             | 237 +++---
 .../impl/ResourceResolverMangleNamespacesTest.java |  27 +-
 .../impl/ResourceResolverMetricsTest.java          |   6 +-
 .../impl/ResourceTypeUtilTest.java                 |  19 +-
 .../resourceresolver/impl/SimpleValueMapImpl.java  |  24 +-
 .../impl/VanityPathConfigurerTest.java             |  20 +-
 .../impl/helper/RedirectResourceTest.java          |  21 +-
 .../impl/helper/ResourcePathIteratorTest.java      |  76 +-
 .../impl/helper/ResourceResolverControlTest.java   | 274 ++++---
 .../impl/helper/StarResourceTest.java              |  50 +-
 .../resourceresolver/impl/helper/URI2Test.java     |  33 +-
 .../resourceresolver/impl/helper/URITest.java      | 232 +++---
 .../mapping/AbstractMappingMapEntriesTest.java     |  79 +-
 .../impl/mapping/AliasMapEntriesTest.java          | 218 +++---
 .../impl/mapping/BloomFilterUtilsTest.java         |  82 +-
 .../impl/mapping/EtcMappingMapEntriesTest.java     | 213 +++---
 .../impl/mapping/InMemoryResource.java             | 117 ++-
 .../impl/mapping/InMemoryResourceProvider.java     |  50 +-
 .../impl/mapping/InterpolatorTest.java             |  83 +--
 .../impl/mapping/MapEntriesTest.java               | 114 +--
 .../impl/mapping/MapEntryIteratorTest.java         |  54 +-
 .../impl/mapping/MapEntryTest.java                 | 218 +++---
 .../impl/mapping/PagedQueryIteratorTest.java       |  66 +-
 .../impl/mapping/PathGeneratorTest.java            |  87 +--
 .../impl/mapping/ResourceMapperImplTest.java       | 332 +++++----
 .../mapping/StringInterpolationMapEntriesTest.java |  56 +-
 .../StringInterpolationProviderImplTest.java       | 110 ++-
 .../impl/mapping/VanityPathMapEntriesTest.java     | 825 ++++++++++++---------
 .../observation/BasicObservationReporterTest.java  |  42 +-
 .../ResourceChangeListenerInfoTest.java            |  57 +-
 .../impl/params/PathParserTest.java                |  11 +-
 .../impl/providers/ResourceProviderInfoTest.java   |  28 +-
 .../providers/ResourceProviderStorageTest.java     |  13 +-
 .../providers/ResourceProviderTrackerTest.java     |  31 +-
 .../AuthenticatedResourceProviderTest.java         |  23 +-
 .../SecureResourceProviderDecoratorTest.java       |  35 +-
 .../impl/providers/tree/PathTreeTest.java          |  28 +-
 .../resourceresolver/util/CustomMatchers.java      |  27 +-
 .../sling/resourceresolver/util/MockTestUtil.java  | 153 ++--
 .../util/events/AbstractAwaitingListener.java      |  14 +-
 .../util/events/RecordingListener.java             |  30 +-
 .../util/events/ServiceEventUtil.java              |  12 +-
 114 files changed, 5134 insertions(+), 4342 deletions(-)

diff --git a/pom.xml b/pom.xml
index f3212728..3b580b07 100644
--- a/pom.xml
+++ b/pom.xml
@@ -32,15 +32,13 @@
     <version>2.0.0-SNAPSHOT</version>
 
     <name>Apache Sling Resource Resolver</name>
-    <description>
-        This bundle provides the Resource Resolver and the Resource Resolver Factory.
-    </description>
+    <description>This bundle provides the Resource Resolver and the Resource Resolver Factory.</description>
 
     <scm>
         <connection>scm:git:https://gitbox.apache.org/repos/asf/sling-org-apache-sling-resourceresolver.git</connection>
         <developerConnection>scm:git:https://gitbox.apache.org/repos/asf/sling-org-apache-sling-resourceresolver.git</developerConnection>
-        <url>https://github.com/apache/sling-org-apache-sling-resourceresolver.git</url>
         <tag>org.apache.sling.resourceresolver-1.12.6</tag>
+        <url>https://github.com/apache/sling-org-apache-sling-resourceresolver.git</url>
     </scm>
 
     <properties>
@@ -50,50 +48,6 @@
         <project.build.outputTimestamp>1742815428</project.build.outputTimestamp>
     </properties>
 
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.sling</groupId>
-                <artifactId>sling-maven-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>generate-adapter-metadata</id>
-                        <phase>process-classes</phase>
-                        <goals>
-                            <goal>generate-adapter-metadata</goal>
-                        </goals>
-                        <configuration>
-                            <!-- relying on https://issues.apache.org/jira/browse/MNG-5001 until https://issues.apache.org/jira/browse/SLING-10022 -->
-                            <outputDirectory>${project.build.outputDirectory}</outputDirectory>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>biz.aQute.bnd</groupId>
-                <artifactId>bnd-maven-plugin</artifactId>
-                <dependencies>
-                    <dependency>
-                        <groupId>org.apache.sling</groupId>
-                        <artifactId>org.apache.sling.bnd.plugin.headers.parameters.remove</artifactId>
-                        <version>1.0.0</version>
-                    </dependency>
-                </dependencies>
-            </plugin>
-            <plugin>
-                <groupId>biz.aQute.bnd</groupId>
-                <artifactId>bnd-baseline-maven-plugin</artifactId>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-javadoc-plugin</artifactId>
-                <configuration>
-                    <skip>true</skip>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-
     <dependencies>
         <dependency>
             <groupId>jakarta.servlet</groupId>
@@ -155,16 +109,16 @@
             <scope>provided</scope>
         </dependency>
         <dependency>
-           <groupId>org.apache.commons</groupId>
-           <artifactId>commons-collections4</artifactId>
-           <version>4.1</version>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-collections4</artifactId>
+            <version>4.1</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
-           <groupId>org.apache.commons</groupId>
-           <artifactId>commons-lang3</artifactId>
-           <version>3.4</version>
-           <scope>provided</scope>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+            <version>3.4</version>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
@@ -252,4 +206,48 @@
             <scope>test</scope>
         </dependency>
     </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.sling</groupId>
+                <artifactId>sling-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>generate-adapter-metadata</id>
+                        <goals>
+                            <goal>generate-adapter-metadata</goal>
+                        </goals>
+                        <phase>process-classes</phase>
+                        <configuration>
+                            <!-- relying on https://issues.apache.org/jira/browse/MNG-5001 until https://issues.apache.org/jira/browse/SLING-10022 -->
+                            <outputDirectory>${project.build.outputDirectory}</outputDirectory>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>biz.aQute.bnd</groupId>
+                <artifactId>bnd-maven-plugin</artifactId>
+                <dependencies>
+                    <dependency>
+                        <groupId>org.apache.sling</groupId>
+                        <artifactId>org.apache.sling.bnd.plugin.headers.parameters.remove</artifactId>
+                        <version>1.0.0</version>
+                    </dependency>
+                </dependencies>
+            </plugin>
+            <plugin>
+                <groupId>biz.aQute.bnd</groupId>
+                <artifactId>bnd-baseline-maven-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-javadoc-plugin</artifactId>
+                <configuration>
+                    <skip>true</skip>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
 </project>
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/CommonResourceResolverFactoryImpl.java b/src/main/java/org/apache/sling/resourceresolver/impl/CommonResourceResolverFactoryImpl.java
index 57aa6c85..935fe244 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/CommonResourceResolverFactoryImpl.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/CommonResourceResolverFactoryImpl.java
@@ -24,8 +24,6 @@ import java.util.*;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.atomic.AtomicBoolean;
 
-import org.jetbrains.annotations.NotNull;
-
 import org.apache.commons.collections4.BidiMap;
 import org.apache.sling.api.resource.LoginException;
 import org.apache.sling.api.resource.ResourceResolver;
@@ -41,6 +39,7 @@ import org.apache.sling.resourceresolver.impl.mapping.Mapping;
 import org.apache.sling.resourceresolver.impl.providers.ResourceProviderTracker;
 import org.apache.sling.serviceusermapping.ServiceUserMapper;
 import org.apache.sling.spi.resource.provider.ResourceProvider;
+import org.jetbrains.annotations.NotNull;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.slf4j.Logger;
@@ -87,7 +86,6 @@ public class CommonResourceResolverFactoryImpl implements MapConfigurationProvid
 
     private final Object optionalNamespaceMangler;
 
-
     /**
      * Create a new common resource resolver factory.
      */
@@ -102,7 +100,7 @@ public class CommonResourceResolverFactoryImpl implements MapConfigurationProvid
                     try {
                         final ResolverReference ref = (ResolverReference) resolverReferenceQueue.remove();
                         ref.close(activator.getResourceResolverMetrics());
-                    } catch ( final InterruptedException ie) {
+                    } catch (final InterruptedException ie) {
                         Thread.currentThread().interrupt();
                     }
                 }
@@ -113,10 +111,10 @@ public class CommonResourceResolverFactoryImpl implements MapConfigurationProvid
 
         // try create namespace mangler
         Object mangler = null;
-        if ( this.isMangleNamespacePrefixes() ) {
+        if (this.isMangleNamespacePrefixes()) {
             try {
                 mangler = new JcrNamespaceMangler();
-            } catch ( final Throwable t) {
+            } catch (final Throwable t) {
                 LOG.info("Unable to create JCR namespace mangler: {}", t.getMessage());
             }
         }
@@ -124,7 +122,7 @@ public class CommonResourceResolverFactoryImpl implements MapConfigurationProvid
     }
 
     // ---------- Resource Resolver Factory ------------------------------------
-    
+
     /**
      * Sanitize the authentication info passed from external code. This method will always make a defensive
      * copy of the argument, also making sure that the copy is mutable. Nulls are turned into empty (mutable) maps.
@@ -135,7 +133,8 @@ public class CommonResourceResolverFactoryImpl implements MapConfigurationProvid
      * @return A sanitized mutable map.
      */
     @NotNull
-    static Map<String, Object> sanitizeAuthenticationInfo(Map<String, Object> authenticationInfo, String... extraForbiddenKeys) {
+    static Map<String, Object> sanitizeAuthenticationInfo(
+            Map<String, Object> authenticationInfo, String... extraForbiddenKeys) {
         if (authenticationInfo == null) {
             // nothing to sanitize, just return an empty mutable map
             return new HashMap<>();
@@ -157,7 +156,7 @@ public class CommonResourceResolverFactoryImpl implements MapConfigurationProvid
     @NotNull
     @Override
     public ResourceResolver getAdministrativeResourceResolver(final Map<String, Object> passedAuthenticationInfo)
-    throws LoginException {
+            throws LoginException {
         checkIsLive();
 
         // make sure there is no leaking of service info props
@@ -174,15 +173,16 @@ public class CommonResourceResolverFactoryImpl implements MapConfigurationProvid
     @NotNull
     @Override
     public ResourceResolver getResourceResolver(final Map<String, Object> passedAuthenticationInfo)
-    throws LoginException {
+            throws LoginException {
         checkIsLive();
 
         // make sure there is no leaking of service bundle and info props
-        final Map<String, Object> authenticationInfo = sanitizeAuthenticationInfo(passedAuthenticationInfo, ResourceProvider.AUTH_SERVICE_BUNDLE, SUBSERVICE);
+        final Map<String, Object> authenticationInfo =
+                sanitizeAuthenticationInfo(passedAuthenticationInfo, ResourceProvider.AUTH_SERVICE_BUNDLE, SUBSERVICE);
 
         final ResourceResolver result = getResourceResolverInternal(authenticationInfo, false);
         Stack<WeakReference<ResourceResolver>> resolverStack = resolverStackHolder.get();
-        if ( resolverStack == null ) {
+        if (resolverStack == null) {
             resolverStack = new Stack<>();
             resolverStackHolder.set(resolverStack);
         }
@@ -190,7 +190,6 @@ public class CommonResourceResolverFactoryImpl implements MapConfigurationProvid
         return result;
     }
 
-
     /**
      * @see org.apache.sling.api.resource.ResourceResolverFactory#getThreadResourceResolver()
      */
@@ -202,10 +201,10 @@ public class CommonResourceResolverFactoryImpl implements MapConfigurationProvid
 
         ResourceResolver result = null;
         final Stack<WeakReference<ResourceResolver>> resolverStack = resolverStackHolder.get();
-        if ( resolverStack != null) {
-            while ( result == null && !resolverStack.isEmpty() ) {
+        if (resolverStack != null) {
+            while (result == null && !resolverStack.isEmpty()) {
                 result = resolverStack.peek().get();
-                if ( result == null ) {
+                if (result == null) {
                     resolverStack.pop();
                 }
             }
@@ -222,8 +221,7 @@ public class CommonResourceResolverFactoryImpl implements MapConfigurationProvid
      * @param resolver The resource resolver
      * @param ctrl The resource resolver control
      */
-    public void register(final ResourceResolver resolver,
-            final ResourceResolverControl ctrl) {
+    public void register(final ResourceResolver resolver, final ResourceResolverControl ctrl) {
         // create new weak reference
         refs.put(ctrl.hashCode(), new ResolverReference(resolver, this.resolverReferenceQueue, ctrl, this));
     }
@@ -234,24 +232,23 @@ public class CommonResourceResolverFactoryImpl implements MapConfigurationProvid
      * @param resourceResolverImpl The resource resolver
      * @param ctrl The resource resolver control
      */
-    public void unregister(final ResourceResolver resourceResolverImpl,
-            final ResourceResolverControl ctrl) {
+    public void unregister(final ResourceResolver resourceResolverImpl, final ResourceResolverControl ctrl) {
         unregisterControl(ctrl);
 
         // on shutdown, the factory might already be closed before the resolvers close
         // therefore we have to check for null
         final ThreadLocal<Stack<WeakReference<ResourceResolver>>> tl = resolverStackHolder;
-        if ( tl != null ) {
+        if (tl != null) {
             final Stack<WeakReference<ResourceResolver>> resolverStack = tl.get();
-            if ( resolverStack != null ) {
+            if (resolverStack != null) {
                 final Iterator<WeakReference<ResourceResolver>> i = resolverStack.iterator();
-                while ( i.hasNext() ) {
+                while (i.hasNext()) {
                     final WeakReference<ResourceResolver> ref = i.next();
-                    if ( ref.get() == null || ref.get() == resourceResolverImpl ) {
+                    if (ref.get() == null || ref.get() == resourceResolverImpl) {
                         i.remove();
                     }
                 }
-                if ( resolverStack.isEmpty() ) {
+                if (resolverStack.isEmpty()) {
                     tl.remove();
                 }
             }
@@ -265,8 +262,7 @@ public class CommonResourceResolverFactoryImpl implements MapConfigurationProvid
      * @return A resource resolver
      * @throws LoginException if login to any of the required resource providers fails.
      */
-    ResourceResolver getResourceResolverInternal(final Map<String, Object> authenticationInfo,
-                                                        final boolean isAdmin)
+    ResourceResolver getResourceResolverInternal(final Map<String, Object> authenticationInfo, final boolean isAdmin)
             throws LoginException {
         checkIsLive();
 
@@ -294,7 +290,7 @@ public class CommonResourceResolverFactoryImpl implements MapConfigurationProvid
     }
 
     private void checkIsLive() throws LoginException {
-        if ( !isLive() ) {
+        if (!isLive()) {
             throw new LoginException("ResourceResolverFactory is deactivated.");
         }
     }
@@ -315,7 +311,12 @@ public class CommonResourceResolverFactoryImpl implements MapConfigurationProvid
         }
         // set up the map entries from configuration
         try {
-            mapEntries = new MapEntries(this, bundleContext, this.activator.getEventAdmin(), this.activator.getStringInterpolationProvider(), this.activator.getResourceResolverMetrics());
+            mapEntries = new MapEntries(
+                    this,
+                    bundleContext,
+                    this.activator.getEventAdmin(),
+                    this.activator.getStringInterpolationProvider(),
+                    this.activator.getResourceResolverMetrics());
         } catch (final Exception e) {
             logger.error("activate: Cannot access repository, failed setting up Mapping Support", e);
         }
@@ -335,8 +336,8 @@ public class CommonResourceResolverFactoryImpl implements MapConfigurationProvid
             plugin = null;
         }
 
-        if (mapEntries instanceof MapEntries ) {
-            ((MapEntries)mapEntries).dispose();
+        if (mapEntries instanceof MapEntries) {
+            ((MapEntries) mapEntries).dispose();
             mapEntries = MapEntries.EMPTY;
         }
         resolverStackHolder = null;
@@ -344,7 +345,7 @@ public class CommonResourceResolverFactoryImpl implements MapConfigurationProvid
         // copy and clear map before closing the remaining references
         final Collection<ResolverReference> references = new ArrayList<>(refs.values());
         refs.clear();
-        for(final ResolverReference ref : references) {
+        for (final ResolverReference ref : references) {
             ref.close(activator.getResourceResolverMetrics());
         }
     }
@@ -396,17 +397,17 @@ public class CommonResourceResolverFactoryImpl implements MapConfigurationProvid
         return this.activator.getVanityPathConfigurer().isVanityPathCacheInitInBackground();
     }
 
-   /**
+    /**
      * get's the ServiceTracker of the ResourceAccessSecurity service
      */
-    public ResourceAccessSecurityTracker getResourceAccessSecurityTracker () {
+    public ResourceAccessSecurityTracker getResourceAccessSecurityTracker() {
         return this.activator.getResourceAccessSecurityTracker();
     }
 
     @NotNull
     @Override
-    public ResourceResolver getServiceResourceResolver(
-            final Map<String, Object> passedAuthenticationInfo) throws LoginException {
+    public ResourceResolver getServiceResourceResolver(final Map<String, Object> passedAuthenticationInfo)
+            throws LoginException {
         checkIsLive();
 
         Map<String, Object> authenticationInfo = sanitizeAuthenticationInfo(passedAuthenticationInfo);
@@ -455,7 +456,7 @@ public class CommonResourceResolverFactoryImpl implements MapConfigurationProvid
 
     @Override
     public Set<String> getAllowedAliasLocations() {
-       return this.activator.getAllowedAliasLocations();
+        return this.activator.getAllowedAliasLocations();
     }
 
     /**
@@ -474,8 +475,7 @@ public class CommonResourceResolverFactoryImpl implements MapConfigurationProvid
     }
 
     @Override
-    public Map<String, Object> getServiceUserAuthenticationInfo(final String subServiceName)
-    throws LoginException {
+    public Map<String, Object> getServiceUserAuthenticationInfo(final String subServiceName) throws LoginException {
         // get an administrative resource resolver
         // Ensure a mapped user name or principal names: If no user/principal name(s)
         // is/are defined for a bundle
@@ -483,14 +483,14 @@ public class CommonResourceResolverFactoryImpl implements MapConfigurationProvid
         // this should yield guest access or no access at all. For now
         // no access is granted if there is no service user defined for
         // the bundle.
-    	final Bundle bundle = this.activator.getBundleContext().getBundle();
+        final Bundle bundle = this.activator.getBundleContext().getBundle();
 
         ServiceUserMapper mapper = this.activator.getServiceUserMapper();
         final Iterable<String> principalNames = mapper.getServicePrincipalNames(bundle, subServiceName);
         final String userName = (principalNames == null) ? mapper.getServiceUserID(bundle, subServiceName) : null;
         if (principalNames == null && userName == null) {
-            throw new LoginException("Cannot derive user name or principal names for bundle "
-                            + bundle + " and sub service " + subServiceName);
+            throw new LoginException("Cannot derive user name or principal names for bundle " + bundle
+                    + " and sub service " + subServiceName);
         }
 
         final Map<String, Object> authenticationInfo = new HashMap<>();
@@ -516,14 +516,16 @@ public class CommonResourceResolverFactoryImpl implements MapConfigurationProvid
 
         private final CommonResourceResolverFactoryImpl factory;
 
-        ResolverReference(final ResourceResolver referent,
-                          final ReferenceQueue<? super ResourceResolver> q,
-                          final ResourceResolverControl ctrl,
-                          final CommonResourceResolverFactoryImpl factory) {
+        ResolverReference(
+                final ResourceResolver referent,
+                final ReferenceQueue<? super ResourceResolver> q,
+                final ResourceResolverControl ctrl,
+                final CommonResourceResolverFactoryImpl factory) {
             super(referent, q);
             this.control = ctrl;
             this.factory = factory;
-            this.openingException = factory.logUnclosedResolvers && LOG.isInfoEnabled() ? new Exception("Opening Stacktrace") : null;
+            this.openingException =
+                    factory.logUnclosedResolvers && LOG.isInfoEnabled() ? new Exception("Opening Stacktrace") : null;
         }
 
         public void close(Optional<ResourceResolverMetrics> metrics) {
@@ -534,9 +536,11 @@ public class CommonResourceResolverFactoryImpl implements MapConfigurationProvid
                     }
                     if (factory.logUnclosedResolvers) {
                         if (factory.isLive()) {
-                            LOG.warn("Closed unclosed ResourceResolver. The creation stacktrace is available on info log level.");
+                            LOG.warn(
+                                    "Closed unclosed ResourceResolver. The creation stacktrace is available on info log level.");
                         } else {
-                            LOG.warn("Forced close of ResourceResolver because the ResourceResolverFactory is shutting down.");
+                            LOG.warn(
+                                    "Forced close of ResourceResolver because the ResourceResolverFactory is shutting down.");
                         }
                         LOG.info("Unclosed ResourceResolver was created here: ", openingException);
                     }
@@ -546,4 +550,4 @@ public class CommonResourceResolverFactoryImpl implements MapConfigurationProvid
             }
         }
     }
-}
\ No newline at end of file
+}
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/FactoryPreconditions.java b/src/main/java/org/apache/sling/resourceresolver/impl/FactoryPreconditions.java
index 0897249f..e64666a3 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/FactoryPreconditions.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/FactoryPreconditions.java
@@ -48,7 +48,8 @@ public class FactoryPreconditions {
         public String name;
         public String pid;
         public Filter filter;
-    };
+    }
+    ;
 
     private final ResourceProviderTracker tracker;
 
@@ -67,34 +68,40 @@ public class FactoryPreconditions {
             Set<String> requiredResourceProviderNames, Set<String> requiredResourceProvidersLegacy) {
 
         boolean hasLegacyRequiredProvider = false;
-        if ( requiredResourceProvidersLegacy != null ) {
-            hasLegacyRequiredProvider = requiredResourceProvidersLegacy.remove(ResourceResolverFactoryConfig.LEGACY_REQUIRED_PROVIDER_PID);
-            if ( !requiredResourceProvidersLegacy.isEmpty() ) {
-                LOG.error("ResourceResolverFactory is using deprecated required providers configuration " +
-                        "(resource.resolver.required.providers). Please change to use the property " +
-                        "resource.resolver.required.providernames for values: {}", requiredResourceProvidersLegacy);
+        if (requiredResourceProvidersLegacy != null) {
+            hasLegacyRequiredProvider =
+                    requiredResourceProvidersLegacy.remove(ResourceResolverFactoryConfig.LEGACY_REQUIRED_PROVIDER_PID);
+            if (!requiredResourceProvidersLegacy.isEmpty()) {
+                LOG.error(
+                        "ResourceResolverFactory is using deprecated required providers configuration "
+                                + "(resource.resolver.required.providers). Please change to use the property "
+                                + "resource.resolver.required.providernames for values: {}",
+                        requiredResourceProvidersLegacy);
             } else {
                 requiredResourceProvidersLegacy = null;
             }
         }
 
-        if ( hasLegacyRequiredProvider ) {
+        if (hasLegacyRequiredProvider) {
             if (requiredResourceProviderNames == null) {
                 requiredResourceProviderNames = new HashSet<>();
             }
 
             // add default if not already present
-            final boolean hasRequiredProvider = !requiredResourceProviderNames.add(ResourceResolverFactoryConfig.REQUIRED_PROVIDER_NAME);
-            if ( hasRequiredProvider ) {
-                LOG.warn("ResourceResolverFactory is using deprecated required providers configuration " +
-                        "(resource.resolver.required.providers) with value '{}'. Please remove this configuration " +
-                        "property. '{}' is already contained in the property resource.resolver.required.providernames.",
+            final boolean hasRequiredProvider =
+                    !requiredResourceProviderNames.add(ResourceResolverFactoryConfig.REQUIRED_PROVIDER_NAME);
+            if (hasRequiredProvider) {
+                LOG.warn(
+                        "ResourceResolverFactory is using deprecated required providers configuration "
+                                + "(resource.resolver.required.providers) with value '{}'. Please remove this configuration "
+                                + "property. '{}' is already contained in the property resource.resolver.required.providernames.",
                         ResourceResolverFactoryConfig.LEGACY_REQUIRED_PROVIDER_PID,
                         ResourceResolverFactoryConfig.REQUIRED_PROVIDER_NAME);
             } else {
-                LOG.warn("ResourceResolverFactory is using deprecated required providers configuration " +
-                        "(resource.resolver.required.providers) with value '{}'. Please remove this configuration " +
-                        "property and add '{}' to the property resource.resolver.required.providernames.",
+                LOG.warn(
+                        "ResourceResolverFactory is using deprecated required providers configuration "
+                                + "(resource.resolver.required.providers) with value '{}'. Please remove this configuration "
+                                + "property and add '{}' to the property resource.resolver.required.providernames.",
                         ResourceResolverFactoryConfig.LEGACY_REQUIRED_PROVIDER_PID,
                         ResourceResolverFactoryConfig.REQUIRED_PROVIDER_NAME);
             }
@@ -135,14 +142,16 @@ public class FactoryPreconditions {
         boolean canRegister = true;
         for (final RequiredProvider rp : requiredProviders) {
             canRegister = false;
-            for (final ResourceProviderHandler h : tracker.getResourceProviderStorage().getAllHandlers()) {
+            for (final ResourceProviderHandler h :
+                    tracker.getResourceProviderStorage().getAllHandlers()) {
                 final ResourceProviderInfo info = h.getInfo();
                 if (info == null) {
                     // provider has been deactivated in the meantime
                     // ignore and continue
                     continue;
                 }
-                @SuppressWarnings("rawtypes") final ServiceReference ref = info.getServiceReference();
+                @SuppressWarnings("rawtypes")
+                final ServiceReference ref = info.getServiceReference();
                 final Object servicePid = ref.getProperty(Constants.SERVICE_PID);
                 if (rp.name != null && rp.name.equals(info.getName())) {
                     canRegister = true;
@@ -153,7 +162,8 @@ public class FactoryPreconditions {
                 } else if (rp.pid != null && rp.pid.equals(servicePid)) {
                     canRegister = true;
                     break;
-                } else if (rp.pid != null && rp.pid.equals(ref.getProperty(LegacyResourceProviderWhiteboard.ORIGINAL_SERVICE_PID))) {
+                } else if (rp.pid != null
+                        && rp.pid.equals(ref.getProperty(LegacyResourceProviderWhiteboard.ORIGINAL_SERVICE_PID))) {
                     canRegister = true;
                     break;
                 }
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/FactoryRegistrationHandler.java b/src/main/java/org/apache/sling/resourceresolver/impl/FactoryRegistrationHandler.java
index 76fe0fc4..8bf81d3f 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/FactoryRegistrationHandler.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/FactoryRegistrationHandler.java
@@ -18,16 +18,6 @@
  */
 package org.apache.sling.resourceresolver.impl;
 
-import org.apache.sling.api.resource.ResourceResolverFactory;
-import org.apache.sling.api.resource.runtime.RuntimeService;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-import org.osgi.framework.ServiceFactory;
-import org.osgi.framework.ServiceRegistration;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import java.util.Dictionary;
 import java.util.Hashtable;
 import java.util.Objects;
@@ -38,6 +28,16 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicReference;
 import java.util.concurrent.locks.ReentrantLock;
 
+import org.apache.sling.api.resource.ResourceResolverFactory;
+import org.apache.sling.api.resource.runtime.RuntimeService;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.framework.ServiceFactory;
+import org.osgi.framework.ServiceRegistration;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 public class FactoryRegistrationHandler implements AutoCloseable {
 
     private static final Logger LOG = LoggerFactory.getLogger(FactoryRegistrationHandler.class);
@@ -70,8 +70,12 @@ public class FactoryRegistrationHandler implements AutoCloseable {
         boolean reRegister;
         try {
             configurationLock.lock();
-            reRegister = this.activator != activator || !Objects.equals(this.factoryPreconditions, factoryPreconditions);
-            LOG.debug("activator differs = {}, factoryPreconditions differ = {}", this.activator != activator, !Objects.equals(this.factoryPreconditions, factoryPreconditions));
+            reRegister =
+                    this.activator != activator || !Objects.equals(this.factoryPreconditions, factoryPreconditions);
+            LOG.debug(
+                    "activator differs = {}, factoryPreconditions differ = {}",
+                    this.activator != activator,
+                    !Objects.equals(this.factoryPreconditions, factoryPreconditions));
             LOG.debug("factoryPreconditions {} vs {}", this.factoryPreconditions, factoryPreconditions);
             this.factoryPreconditions = factoryPreconditions;
             this.activator = activator;
@@ -121,7 +125,8 @@ public class FactoryRegistrationHandler implements AutoCloseable {
                     configurationLock.unlock();
                 }
                 if (preconditionsOk) {
-                    final Bundle systemBundle = localActivator.getBundleContext().getBundle(Constants.SYSTEM_BUNDLE_LOCATION);
+                    final Bundle systemBundle =
+                            localActivator.getBundleContext().getBundle(Constants.SYSTEM_BUNDLE_LOCATION);
                     // check system bundle state - if stopping, don't register new factory
                     if (systemBundle != null && systemBundle.getState() != Bundle.STOPPING) {
                         runWithThreadName("registration", () -> this.doRegisterFactory(localActivator));
@@ -137,8 +142,7 @@ public class FactoryRegistrationHandler implements AutoCloseable {
     void unregisterFactory() {
         if (!factoryRegistrationWorker.isShutdown()) {
             LOG.debug("submitting unregisterFactory");
-            factoryRegistrationWorker.execute(
-                    () -> runWithThreadName("deregistration", this::doUnregisterFactory));
+            factoryRegistrationWorker.execute(() -> runWithThreadName("deregistration", this::doUnregisterFactory));
         }
     }
 
@@ -148,8 +152,8 @@ public class FactoryRegistrationHandler implements AutoCloseable {
     private void doRegisterFactory(ResourceResolverFactoryActivator activator) {
         final FactoryRegistration newRegistration = factoryRegistration.updateAndGet(oldRegistration -> {
             LOG.debug("performing registerFactory, factoryRegistration == {}", oldRegistration);
-            return Objects.requireNonNullElseGet(oldRegistration,
-                    () -> new FactoryRegistration(activator.getBundleContext(), activator));
+            return Objects.requireNonNullElseGet(
+                    oldRegistration, () -> new FactoryRegistration(activator.getBundleContext(), activator));
         });
         LOG.debug("finished performing registerFactory, factoryRegistration == {}", newRegistration);
     }
@@ -160,8 +164,7 @@ public class FactoryRegistrationHandler implements AutoCloseable {
     private void doUnregisterFactory() {
         final FactoryRegistration newRegistration = factoryRegistration.updateAndGet(oldRegistration -> {
             LOG.debug("performing unregisterFactory, factoryRegistration == {}", factoryRegistration);
-            Optional.ofNullable(oldRegistration)
-                    .ifPresent(FactoryRegistration::unregister);
+            Optional.ofNullable(oldRegistration).ifPresent(FactoryRegistration::unregister);
             LOG.debug("setting factoryRegistration = null");
             return null;
         });
@@ -195,20 +198,28 @@ public class FactoryRegistrationHandler implements AutoCloseable {
             final Dictionary<String, Object> serviceProps = new Hashtable<>();
             serviceProps.put(Constants.SERVICE_VENDOR, "The Apache Software Foundation");
             serviceProps.put(Constants.SERVICE_DESCRIPTION, "Apache Sling Resource Resolver Factory");
-            factoryRegistration = context.registerService(ResourceResolverFactory.class, new ServiceFactory<>() {
-                @Override
-                public ResourceResolverFactory getService(final Bundle bundle, final ServiceRegistration<ResourceResolverFactory> registration) {
-                    if (FactoryRegistrationHandler.this.factoryRegistrationWorker.isShutdown()) {
-                        return null;
-                    }
-                    return new ResourceResolverFactoryImpl(commonFactory, bundle, activator.getServiceUserMapper());
-                }
-
-                @Override
-                public void ungetService(final Bundle bundle, final ServiceRegistration<ResourceResolverFactory> registration, final ResourceResolverFactory service) {
-                    // nothing to do
-                }
-            }, serviceProps);
+            factoryRegistration = context.registerService(
+                    ResourceResolverFactory.class,
+                    new ServiceFactory<>() {
+                        @Override
+                        public ResourceResolverFactory getService(
+                                final Bundle bundle, final ServiceRegistration<ResourceResolverFactory> registration) {
+                            if (FactoryRegistrationHandler.this.factoryRegistrationWorker.isShutdown()) {
+                                return null;
+                            }
+                            return new ResourceResolverFactoryImpl(
+                                    commonFactory, bundle, activator.getServiceUserMapper());
+                        }
+
+                        @Override
+                        public void ungetService(
+                                final Bundle bundle,
+                                final ServiceRegistration<ResourceResolverFactory> registration,
+                                final ResourceResolverFactory service) {
+                            // nothing to do
+                        }
+                    },
+                    serviceProps);
 
             runtimeRegistration = context.registerService(RuntimeService.class, activator.getRuntimeService(), null);
         }
@@ -222,7 +233,7 @@ public class FactoryRegistrationHandler implements AutoCloseable {
 
             LOG.debug("Unregister commonFactory");
             commonFactory.deactivate();
-                        
+
             LOG.debug("Unregister completed");
         }
     }
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/JcrNamespaceMangler.java b/src/main/java/org/apache/sling/resourceresolver/impl/JcrNamespaceMangler.java
index 52b07d75..92679040 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/JcrNamespaceMangler.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/JcrNamespaceMangler.java
@@ -18,13 +18,13 @@
  */
 package org.apache.sling.resourceresolver.impl;
 
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
 import javax.jcr.NamespaceException;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
 import org.apache.sling.api.resource.ResourceResolver;
 import org.slf4j.Logger;
 
@@ -42,11 +42,10 @@ public class JcrNamespaceMangler {
 
     private static final Pattern MANLE_NAMESPACE_OUT_PATTERN = Pattern.compile("/([^:/]+):");
 
-
     public String mangleNamespaces(ResourceResolver resolver, Logger logger, String absPath) {
         if (absPath.contains(MANGLE_NAMESPACE_OUT_SUFFIX)) {
             final Session session = resolver.adaptTo(Session.class);
-            if ( session != null ) {
+            if (session != null) {
                 final Matcher m = MANLE_NAMESPACE_OUT_PATTERN.matcher(absPath);
 
                 final StringBuffer buf = new StringBuffer();
@@ -60,7 +59,6 @@ public class JcrNamespaceMangler {
                         final String replacement = MANGLE_NAMESPACE_IN_PREFIX + namespace + MANGLE_NAMESPACE_IN_SUFFIX;
                         m.appendReplacement(buf, replacement);
 
-
                     } catch (final NamespaceException ne) {
 
                         // not a valid prefix
@@ -69,7 +67,6 @@ public class JcrNamespaceMangler {
                     } catch (final RepositoryException re) {
 
                         logger.warn("mangleNamespaces: Problem checking namespace '{}'", namespace, re);
-
                     }
                 }
 
@@ -85,7 +82,7 @@ public class JcrNamespaceMangler {
     public String unmangleNamespaces(ResourceResolver resolver, Logger logger, String absPath) {
         if (absPath.contains(MANGLE_NAMESPACE_IN_PREFIX)) {
             final Session session = resolver.adaptTo(Session.class);
-            if ( session != null ) {
+            if (session != null) {
                 final Matcher m = MANGLE_NAMESPACE_IN_PATTERN.matcher(absPath);
                 final StringBuffer buf = new StringBuffer();
                 while (m.find()) {
@@ -95,10 +92,10 @@ public class JcrNamespaceMangler {
                         // throws if "namespace" is not a registered
                         // namespace prefix
                         session.getNamespaceURI(namespace);
-                        final String replacement = MANGLE_NAMESPACE_OUT_PREFIX + namespace + MANGLE_NAMESPACE_OUT_SUFFIX;
+                        final String replacement =
+                                MANGLE_NAMESPACE_OUT_PREFIX + namespace + MANGLE_NAMESPACE_OUT_SUFFIX;
                         m.appendReplacement(buf, replacement);
 
-
                     } catch (final NamespaceException ne) {
 
                         // not a valid prefix
@@ -107,7 +104,6 @@ public class JcrNamespaceMangler {
                     } catch (final RepositoryException re) {
 
                         logger.warn("unmangleNamespaces: Problem checking namespace '{}'", namespace, re);
-
                     }
                 }
                 m.appendTail(buf);
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/ResourceAccessSecurityTracker.java b/src/main/java/org/apache/sling/resourceresolver/impl/ResourceAccessSecurityTracker.java
index fc218474..91ec5c84 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/ResourceAccessSecurityTracker.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/ResourceAccessSecurityTracker.java
@@ -30,22 +30,23 @@ import org.osgi.service.component.annotations.ReferencePolicyOption;
  * This internal helper class keeps track of the resource access security services
  * and always returns the one with the highest service ranking.
  */
-@Component(service=ResourceAccessSecurityTracker.class,
-    property = {
-            Constants.SERVICE_VENDOR + "=The Apache Software Foundation"
-    })
+@Component(
+        service = ResourceAccessSecurityTracker.class,
+        property = {Constants.SERVICE_VENDOR + "=The Apache Software Foundation"})
 public class ResourceAccessSecurityTracker {
 
-    @Reference(policyOption=ReferencePolicyOption.GREEDY,
-               cardinality=ReferenceCardinality.OPTIONAL,
-               policy=ReferencePolicy.DYNAMIC,
-               target="(" + ResourceAccessSecurity.CONTEXT + "=" + ResourceAccessSecurity.APPLICATION_CONTEXT + ")")
+    @Reference(
+            policyOption = ReferencePolicyOption.GREEDY,
+            cardinality = ReferenceCardinality.OPTIONAL,
+            policy = ReferencePolicy.DYNAMIC,
+            target = "(" + ResourceAccessSecurity.CONTEXT + "=" + ResourceAccessSecurity.APPLICATION_CONTEXT + ")")
     volatile ResourceAccessSecurity applicationResourceAccessSecurity;
 
-    @Reference(policyOption=ReferencePolicyOption.GREEDY,
-            cardinality=ReferenceCardinality.OPTIONAL,
-            policy=ReferencePolicy.DYNAMIC,
-            target="(" + ResourceAccessSecurity.CONTEXT + "=" + ResourceAccessSecurity.PROVIDER_CONTEXT + ")")
+    @Reference(
+            policyOption = ReferencePolicyOption.GREEDY,
+            cardinality = ReferenceCardinality.OPTIONAL,
+            policy = ReferencePolicy.DYNAMIC,
+            target = "(" + ResourceAccessSecurity.CONTEXT + "=" + ResourceAccessSecurity.PROVIDER_CONTEXT + ")")
     volatile ResourceAccessSecurity providerResourceAccessSecurity;
 
     public ResourceAccessSecurity getApplicationResourceAccessSecurity() {
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverFactoryActivator.java b/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverFactoryActivator.java
index faa538a5..3b285591 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverFactoryActivator.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverFactoryActivator.java
@@ -104,9 +104,12 @@ public class ResourceResolverFactoryActivator {
 
     @Reference
     ResourceAccessSecurityTracker resourceAccessSecurityTracker;
-    
+
     @SuppressWarnings("java:S3077")
-    @Reference(cardinality = ReferenceCardinality.OPTIONAL, policyOption = ReferencePolicyOption.GREEDY, policy = ReferencePolicy.DYNAMIC)
+    @Reference(
+            cardinality = ReferenceCardinality.OPTIONAL,
+            policyOption = ReferencePolicyOption.GREEDY,
+            policy = ReferencePolicy.DYNAMIC)
     private volatile ResourceResolverMetrics metrics;
 
     volatile ResourceProviderTracker resourceProviderTracker;
@@ -127,6 +130,7 @@ public class ResourceResolverFactoryActivator {
     private final FactoryRegistrationHandler factoryRegistrationHandler = new FactoryRegistrationHandler();
 
     private final VanityPathConfigurer vanityPathConfigurer = new VanityPathConfigurer();
+
     {
         vanityPathConfigurer.setConfiguration(DEFAULT_CONFIG, null);
     }
@@ -149,7 +153,7 @@ public class ResourceResolverFactoryActivator {
     public StringInterpolationProvider getStringInterpolationProvider() {
         return stringInterpolationProvider;
     }
-    
+
     public Optional<ResourceResolverMetrics> getResourceResolverMetrics() {
         return Optional.ofNullable(this.metrics);
     }
@@ -174,7 +178,6 @@ public class ResourceResolverFactoryActivator {
 
     public boolean isMangleNamespacePrefixes() {
         return config.resource_resolver_manglenamespaces();
-
     }
 
     public String getMapRoot() {
@@ -182,15 +185,14 @@ public class ResourceResolverFactoryActivator {
     }
 
     public boolean isMapConfiguration(String path) {
-        return path.equals(this.getMapRoot())
-               || path.startsWith(this.mapRootPrefix);
+        return path.equals(this.getMapRoot()) || path.startsWith(this.mapRootPrefix);
     }
 
     public boolean isOptimizeAliasResolutionEnabled() {
         return this.config.resource_resolver_optimize_alias_resolution();
     }
 
-    public  Set<String> getAllowedAliasLocations(){
+    public Set<String> getAllowedAliasLocations() {
         return this.allowedAliasLocations;
     }
 
@@ -216,22 +218,27 @@ public class ResourceResolverFactoryActivator {
      * Activates this component (called by SCR before)
      */
     @Activate
-    protected void activate(final BundleContext bundleContext,
-        final ResourceResolverFactoryConfig config,
-        final VanityPathConfigurer.DeprecatedVanityConfig deprecatedVanityConfig) {
+    protected void activate(
+            final BundleContext bundleContext,
+            final ResourceResolverFactoryConfig config,
+            final VanityPathConfigurer.DeprecatedVanityConfig deprecatedVanityConfig) {
         this.vanityPathConfigurer.setConfiguration(config, deprecatedVanityConfig);
         this.bundleContext = bundleContext;
         this.config = config;
 
         final BidiMap<String, String> virtuals = new TreeBidiMap<>();
-        for (int i = 0; config.resource_resolver_virtual() != null && i < config.resource_resolver_virtual().length; i++) {
+        for (int i = 0;
+                config.resource_resolver_virtual() != null && i < config.resource_resolver_virtual().length;
+                i++) {
             final String[] parts = Mapping.split(config.resource_resolver_virtual()[i]);
             virtuals.put(parts[0], parts[2]);
         }
         virtualURLMap = virtuals;
 
         final List<Mapping> maps = new ArrayList<>();
-        for (int i = 0; config.resource_resolver_mapping() != null && i < config.resource_resolver_mapping().length; i++) {
+        for (int i = 0;
+                config.resource_resolver_mapping() != null && i < config.resource_resolver_mapping().length;
+                i++) {
             maps.add(new Mapping(config.resource_resolver_mapping()[i]));
         }
         final Mapping[] tmp = maps.toArray(new Mapping[maps.size()]);
@@ -249,7 +256,7 @@ public class ResourceResolverFactoryActivator {
         // from configuration if available
         final List<String> searchPathList = new ArrayList<>();
         if (config.resource_resolver_searchpath() != null && config.resource_resolver_searchpath().length > 0) {
-            for(String path : config.resource_resolver_searchpath()) {
+            for (String path : config.resource_resolver_searchpath()) {
                 // ensure leading slash
                 if (!path.startsWith("/")) {
                     path = "/".concat(path);
@@ -272,32 +279,35 @@ public class ResourceResolverFactoryActivator {
 
         final String[] paths = config.resource_resolver_map_observation();
         this.observationPaths = new Path[paths.length];
-        for(int i=0;i<paths.length;i++) {
+        for (int i = 0; i < paths.length; i++) {
             this.observationPaths[i] = new Path(paths[i]);
         }
 
         // optimize alias path allow list
         String[] aliasLocationsPrefix = config.resource_resolver_allowed_alias_locations();
-        if ( aliasLocationsPrefix != null ) {
+        if (aliasLocationsPrefix != null) {
             final Set<String> prefixSet = new TreeSet<>();
-            for(final String prefix : aliasLocationsPrefix) {
+            for (final String prefix : aliasLocationsPrefix) {
                 String value = prefix.trim();
                 if (!value.isEmpty()) {
                     if (value.startsWith("/")) { // absolute path should be given
                         // path must not end with "/" to be valid absolute path
                         prefixSet.add(StringUtils.removeEnd(value, "/"));
-                    }else{
-                        logger.warn("Path [{}] is ignored. As only absolute paths are allowed for alias optimization", value);
+                    } else {
+                        logger.warn(
+                                "Path [{}] is ignored. As only absolute paths are allowed for alias optimization",
+                                value);
                     }
                 }
             }
-            if ( !prefixSet.isEmpty()) {
+            if (!prefixSet.isEmpty()) {
                 this.allowedAliasLocations = Collections.unmodifiableSet(prefixSet);
             }
         }
         if (!config.resource_resolver_optimize_alias_resolution()) {
-            logger.warn("The non-optimized alias resolution is used, which has been found to have problems (see SLING-12025). " +
-                    "Please migrate to the optimized alias resolution, as the non-optimized version will be removed");
+            logger.warn(
+                    "The non-optimized alias resolution is used, which has been found to have problems (see SLING-12025). "
+                            + "Please migrate to the optimized alias resolution, as the non-optimized version will be removed");
         }
 
         // for testing: if we run unit test, both trackers are set from the outside
@@ -313,28 +323,25 @@ public class ResourceResolverFactoryActivator {
         Set<String> requiredResourceProviderNames = getStringSet(config.resource_resolver_required_providernames());
 
         final FactoryPreconditions factoryPreconditions = new FactoryPreconditions(
-                resourceProviderTracker,
-                requiredResourceProviderNames,
-                requiredResourceProvidersLegacy);
+                resourceProviderTracker, requiredResourceProviderNames, requiredResourceProvidersLegacy);
         factoryRegistrationHandler.configure(this, factoryPreconditions);
 
         if (!hasPreRegisteredResourceProviderTracker) {
-            this.resourceProviderTracker.activate(this.bundleContext, this.eventAdmin,
-                    new ChangeListener() {
-
-                        @Override
-                        public void providerAdded() {
-                            factoryRegistrationHandler.maybeRegisterFactory();
-                        }
-
-                        @Override
-                        public void providerRemoved(final boolean stateful, final boolean isUsed) {
-                            if ( isUsed && (stateful || config.resource_resolver_providerhandling_paranoid()) ) {
-                                factoryRegistrationHandler.unregisterFactory();
-                            }
-                            factoryRegistrationHandler.maybeRegisterFactory();
-                        }
-                    });
+            this.resourceProviderTracker.activate(this.bundleContext, this.eventAdmin, new ChangeListener() {
+
+                @Override
+                public void providerAdded() {
+                    factoryRegistrationHandler.maybeRegisterFactory();
+                }
+
+                @Override
+                public void providerRemoved(final boolean stateful, final boolean isUsed) {
+                    if (isUsed && (stateful || config.resource_resolver_providerhandling_paranoid())) {
+                        factoryRegistrationHandler.unregisterFactory();
+                    }
+                    factoryRegistrationHandler.maybeRegisterFactory();
+                }
+            });
         }
     }
 
@@ -342,9 +349,10 @@ public class ResourceResolverFactoryActivator {
      * Modifies this component (called by SCR to update this component)
      */
     @Modified
-    protected void modified(final BundleContext bundleContext,
-        final ResourceResolverFactoryConfig config,
-        final VanityPathConfigurer.DeprecatedVanityConfig deprecatedVanityConfig) {
+    protected void modified(
+            final BundleContext bundleContext,
+            final ResourceResolverFactoryConfig config,
+            final VanityPathConfigurer.DeprecatedVanityConfig deprecatedVanityConfig) {
         this.deactivateInternal();
         this.activate(bundleContext, config, deprecatedVanityConfig);
     }
@@ -379,18 +387,22 @@ public class ResourceResolverFactoryActivator {
     }
 
     public ServiceUserMapper getServiceUserMapper() {
-    	return this.serviceUserMapper;
+        return this.serviceUserMapper;
     }
 
     public BundleContext getBundleContext() {
-    	return this.bundleContext;
+        return this.bundleContext;
     }
 
     /**
      * Bind a resource decorator.
      */
-    @Reference(service = ResourceDecorator.class, cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC)
-    protected void bindResourceDecorator(final ResourceDecorator decorator, final ServiceReference<ResourceDecorator> ref) {
+    @Reference(
+            service = ResourceDecorator.class,
+            cardinality = ReferenceCardinality.MULTIPLE,
+            policy = ReferencePolicy.DYNAMIC)
+    protected void bindResourceDecorator(
+            final ResourceDecorator decorator, final ServiceReference<ResourceDecorator> ref) {
         this.resourceDecoratorTracker.bindResourceDecorator(decorator, ref);
     }
 
@@ -413,45 +425,45 @@ public class ResourceResolverFactoryActivator {
      * Utility method to create a set out of a string array
      */
     private Set<String> getStringSet(final String[] values) {
-    	if ( values == null || values.length == 0 ) {
-    		return null;
-    	}
-    	final Set<String> set = new HashSet<>();
-    	for(final String val : values) {
-    		if ( val != null && !val.trim().isEmpty() ) {
-    			set.add(val.trim());
-    		}
-    	}
-    	return set.isEmpty() ? null : set;
+        if (values == null || values.length == 0) {
+            return null;
+        }
+        final Set<String> set = new HashSet<>();
+        for (final String val : values) {
+            if (val != null && !val.trim().isEmpty()) {
+                set.add(val.trim());
+            }
+        }
+        return set.isEmpty() ? null : set;
     }
 
     public static ResourceResolverFactoryConfig DEFAULT_CONFIG;
 
     static {
-       final InvocationHandler handler = new InvocationHandler() {
+        final InvocationHandler handler = new InvocationHandler() {
 
             @Override
-            public Object invoke(final Object obj, final Method calledMethod, final Object[] args)
-            throws Throwable {
-                if ( calledMethod.getDeclaringClass().isAssignableFrom(ResourceResolverFactoryConfig.class) ) {
-                   return calledMethod.getDefaultValue();
+            public Object invoke(final Object obj, final Method calledMethod, final Object[] args) throws Throwable {
+                if (calledMethod.getDeclaringClass().isAssignableFrom(ResourceResolverFactoryConfig.class)) {
+                    return calledMethod.getDefaultValue();
                 }
-                if ( calledMethod.getDeclaringClass() == Object.class ) {
-                    if ( calledMethod.getName().equals("toString") && (args == null || args.length == 0) ) {
+                if (calledMethod.getDeclaringClass() == Object.class) {
+                    if (calledMethod.getName().equals("toString") && (args == null || args.length == 0)) {
                         return "Generated @" + ResourceResolverFactoryConfig.class.getName() + " instance";
                     }
-                    if ( calledMethod.getName().equals("hashCode") && (args == null || args.length == 0) ) {
+                    if (calledMethod.getName().equals("hashCode") && (args == null || args.length == 0)) {
                         return this.hashCode();
                     }
-                    if ( calledMethod.getName().equals("equals") && args != null && args.length == 1 ) {
+                    if (calledMethod.getName().equals("equals") && args != null && args.length == 1) {
                         return Boolean.FALSE;
                     }
                 }
                 throw new InternalError("unexpected method dispatched: " + calledMethod);
             }
         };
-        DEFAULT_CONFIG = (ResourceResolverFactoryConfig) Proxy.newProxyInstance(ResourceResolverFactoryConfig.class.getClassLoader(),
-                new Class[] { ResourceResolverFactoryConfig.class },
+        DEFAULT_CONFIG = (ResourceResolverFactoryConfig) Proxy.newProxyInstance(
+                ResourceResolverFactoryConfig.class.getClassLoader(),
+                new Class[] {ResourceResolverFactoryConfig.class},
                 handler);
     }
 }
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverFactoryConfig.java b/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverFactoryConfig.java
index 73b0711f..5b5b31b6 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverFactoryConfig.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverFactoryConfig.java
@@ -22,18 +22,21 @@ import org.apache.sling.resourceresolver.impl.mapping.MapEntries;
 import org.osgi.service.metatype.annotations.AttributeDefinition;
 import org.osgi.service.metatype.annotations.ObjectClassDefinition;
 
-@ObjectClassDefinition(name = "Apache Sling Resource Resolver Factory",
-            description = "Configures the Resource Resolver for request URL and resource path rewriting.")
+@ObjectClassDefinition(
+        name = "Apache Sling Resource Resolver Factory",
+        description = "Configures the Resource Resolver for request URL and resource path rewriting.")
 public @interface ResourceResolverFactoryConfig {
 
-	String LEGACY_REQUIRED_PROVIDER_PID = "org.apache.sling.jcr.resource.internal.helper.jcr.JcrResourceProviderFactory";
-	String REQUIRED_PROVIDER_NAME = "JCR";
-	
-    @AttributeDefinition(name = "Resource Search Path",
-        description = "The list of absolute path prefixes " +
-                      "applied to find resources whose path is just specified with a relative path. " +
-                      "The default value is [ \"/apps\", \"/libs\" ]. If an empty path is specified a " +
-                      "single entry path of [ \"/\" ] is assumed.")
+    String LEGACY_REQUIRED_PROVIDER_PID =
+            "org.apache.sling.jcr.resource.internal.helper.jcr.JcrResourceProviderFactory";
+    String REQUIRED_PROVIDER_NAME = "JCR";
+
+    @AttributeDefinition(
+            name = "Resource Search Path",
+            description = "The list of absolute path prefixes "
+                    + "applied to find resources whose path is just specified with a relative path. "
+                    + "The default value is [ \"/apps\", \"/libs\" ]. If an empty path is specified a "
+                    + "single entry path of [ \"/\" ] is assumed.")
     String[] resource_resolver_searchpath() default {"/apps", "/libs"};
 
     /**
@@ -53,35 +56,39 @@ public @interface ResourceResolverFactoryConfig {
      * The default value of this property if no configuration is provided is <code>true</code>.
      *
      */
-    @AttributeDefinition(name = "Namespace Mangling",
-          description = "Defines whether namespace " +
-                        "prefixes of resource names inside the path (e.g. \"jcr:\" in \"/home/path/jcr:content\") " +
-                        "are mangled or not. Mangling means that any namespace prefix contained in the " +
-                        "path is replaced as per the generic substitution pattern \"/([^:]+):/_$1_/\" " +
-                        "when calling the \"map\" method of the resource resolver. Likewise the " +
-                        "\"resolve\" methods will unmangle such namespace prefixes according to the " +
-                        "substituation pattern \"/_([^_]+)_/$1:/\". This feature is provided since " +
-                        "there may be systems out there in the wild which cannot cope with URLs " +
-                        "containing colons, even though they are perfectly valid characters in the " +
-                        "path part of URI references with a scheme. The default value of this property " +
-                        "if no configuration is provided is \"true\".")
+    @AttributeDefinition(
+            name = "Namespace Mangling",
+            description = "Defines whether namespace "
+                    + "prefixes of resource names inside the path (e.g. \"jcr:\" in \"/home/path/jcr:content\") "
+                    + "are mangled or not. Mangling means that any namespace prefix contained in the "
+                    + "path is replaced as per the generic substitution pattern \"/([^:]+):/_$1_/\" "
+                    + "when calling the \"map\" method of the resource resolver. Likewise the "
+                    + "\"resolve\" methods will unmangle such namespace prefixes according to the "
+                    + "substituation pattern \"/_([^_]+)_/$1:/\". This feature is provided since "
+                    + "there may be systems out there in the wild which cannot cope with URLs "
+                    + "containing colons, even though they are perfectly valid characters in the "
+                    + "path part of URI references with a scheme. The default value of this property "
+                    + "if no configuration is provided is \"true\".")
     boolean resource_resolver_manglenamespaces() default true;
 
-    @AttributeDefinition(name = "Allow Direct Mapping",
-        description = "Whether to add a direct URL mapping to the front of the mapping list.")
+    @AttributeDefinition(
+            name = "Allow Direct Mapping",
+            description = "Whether to add a direct URL mapping to the front of the mapping list.")
     boolean resource_resolver_allowDirect() default true;
 
-    @AttributeDefinition(name = "Required Providers (Deprecated)",
-        description = "A resource resolver factory is only " +
-                 "available (registered) if all resource providers mentioned in this configuration " +
-                 "are available. Each entry is either a service PID or a filter expression.  " +
-                 "Invalid filters are ignored.")
+    @AttributeDefinition(
+            name = "Required Providers (Deprecated)",
+            description = "A resource resolver factory is only "
+                    + "available (registered) if all resource providers mentioned in this configuration "
+                    + "are available. Each entry is either a service PID or a filter expression.  "
+                    + "Invalid filters are ignored.")
     String[] resource_resolver_required_providers();
 
-    @AttributeDefinition(name = "Required Providers ",
-        description = "A resource resolver factory is only " +
-                       "available (registered) if all resource providers mentioned in this configuration " +
-                       "are available. Each entry is refers to the name of a registered provider.")
+    @AttributeDefinition(
+            name = "Required Providers ",
+            description = "A resource resolver factory is only "
+                    + "available (registered) if all resource providers mentioned in this configuration "
+                    + "are available. Each entry is refers to the name of a registered provider.")
     String[] resource_resolver_required_providernames() default {REQUIRED_PROVIDER_NAME};
 
     /**
@@ -90,107 +97,125 @@ public @interface ResourceResolverFactoryConfig {
      * multivalue properties at the moment. So we just add a dummy direct
      * mapping.
      */
-    @AttributeDefinition(name = "Virtual URLs",
-        description = "List of virtual URLs and there mappings to real URLs. " +
-                    "Format is <externalURL>:<internalURL>. Mappings are " +
-                    "applied on the complete request URL only.")
+    @AttributeDefinition(
+            name = "Virtual URLs",
+            description = "List of virtual URLs and there mappings to real URLs. "
+                    + "Format is <externalURL>:<internalURL>. Mappings are "
+                    + "applied on the complete request URL only.")
     String[] resource_resolver_virtual() default {"/:/"};
 
-    @AttributeDefinition(name = "URL Mappings",
-        description = "List of mappings to apply to paths. Incoming mappings are " +
-                    "applied to request paths to map to resource paths, " +
-                    "outgoing mappings are applied to map resource paths to paths used on subsequent " +
-                    "requests. Form is <internalPathPrefix><op><externalPathPrefix> where <op> is " +
-                    "\">\" for incoming mappings, \"<\" for outgoing mappings and \":\" for mappings " +
-                    "applied in both directions. Mappings are applied in configuration order by " +
-                    "comparing and replacing URL prefixes. Note: The use of \"-\" as the <op> value " +
-                    "indicating a mapping in both directions is deprecated.")
+    @AttributeDefinition(
+            name = "URL Mappings",
+            description = "List of mappings to apply to paths. Incoming mappings are "
+                    + "applied to request paths to map to resource paths, "
+                    + "outgoing mappings are applied to map resource paths to paths used on subsequent "
+                    + "requests. Form is <internalPathPrefix><op><externalPathPrefix> where <op> is "
+                    + "\">\" for incoming mappings, \"<\" for outgoing mappings and \":\" for mappings "
+                    + "applied in both directions. Mappings are applied in configuration order by "
+                    + "comparing and replacing URL prefixes. Note: The use of \"-\" as the <op> value "
+                    + "indicating a mapping in both directions is deprecated.")
     String[] resource_resolver_mapping() default {"/:/", "/content/:/"};
 
-    @AttributeDefinition(name = "Mapping Location",
-        description = "The path to the root of the configuration to setup and configure " +
-                      "the ResourceResolver mapping. The default value is /etc/map.")
+    @AttributeDefinition(
+            name = "Mapping Location",
+            description = "The path to the root of the configuration to setup and configure "
+                    + "the ResourceResolver mapping. The default value is /etc/map.")
     String resource_resolver_map_location() default MapEntries.DEFAULT_MAP_ROOT;
 
-    @AttributeDefinition(name = "Mapping Observation",
-        description = "The paths where vanity paths or aliases can be found. These paths are used to " +
-                      "listen for resource events.")
+    @AttributeDefinition(
+            name = "Mapping Observation",
+            description = "The paths where vanity paths or aliases can be found. These paths are used to "
+                    + "listen for resource events.")
     String[] resource_resolver_map_observation() default "/";
 
-    @AttributeDefinition(name = "Default Vanity Path Redirect Status",
-        description = "The default status code used when a sling:vanityPath is configured to redirect " +
-                    "and does not have a specific status code associated with it " +
-                    "(via a sling:redirectStatus property)")
-    int resource_resolver_default_vanity_redirect_status() default MapEntries.DEFAULT_DEFAULT_VANITY_PATH_REDIRECT_STATUS;
-
-    @AttributeDefinition(name = "Enable Vanity Paths",
-        description = "This flag controls whether all resources with a sling:vanityPath property " +
-                            "are processed and added to the mappoing table.")
+    @AttributeDefinition(
+            name = "Default Vanity Path Redirect Status",
+            description = "The default status code used when a sling:vanityPath is configured to redirect "
+                    + "and does not have a specific status code associated with it "
+                    + "(via a sling:redirectStatus property)")
+    int resource_resolver_default_vanity_redirect_status() default
+            MapEntries.DEFAULT_DEFAULT_VANITY_PATH_REDIRECT_STATUS;
+
+    @AttributeDefinition(
+            name = "Enable Vanity Paths",
+            description = "This flag controls whether all resources with a sling:vanityPath property "
+                    + "are processed and added to the mappoing table.")
     boolean resource_resolver_enable_vanitypath() default true;
 
-    @AttributeDefinition(name = "Vanity Path Cache Init In Background",
-        description = "This flag controls whether the vanity path cache will be initialized immediately or later as a background task.")
+    @AttributeDefinition(
+            name = "Vanity Path Cache Init In Background",
+            description =
+                    "This flag controls whether the vanity path cache will be initialized immediately or later as a background task.")
     boolean resource_resolver_vanitypath_cache_in_background() default false;
 
-    @AttributeDefinition(name = "Maximum number of cached vanity path entries",
-        description = "The maximum number of cached vanity path entries. " +
-                    "Default is -1 (no limit)")
+    @AttributeDefinition(
+            name = "Maximum number of cached vanity path entries",
+            description = "The maximum number of cached vanity path entries. " + "Default is -1 (no limit)")
     int resource_resolver_vanitypath_maxEntries() default -1;
 
-    @AttributeDefinition(name = "Limit the maximum number of cached vanity path entries only at startup",
-        description = "Limit the maximum number of cached vanity path entries only at startup. " +
-                      "Default is true")
+    @AttributeDefinition(
+            name = "Limit the maximum number of cached vanity path entries only at startup",
+            description =
+                    "Limit the maximum number of cached vanity path entries only at startup. " + "Default is true")
     boolean resource_resolver_vanitypath_maxEntries_startup() default true;
 
-    @AttributeDefinition(name = "Maximum number of vanity bloom filter bytes",
-        description = "The maximum number of vanity bloom filter bytes. " +
-                      "Changing this value is subject to vanity bloom filter rebuild")
+    @AttributeDefinition(
+            name = "Maximum number of vanity bloom filter bytes",
+            description = "The maximum number of vanity bloom filter bytes. "
+                    + "Changing this value is subject to vanity bloom filter rebuild")
     int resource_resolver_vanitypath_bloomfilter_maxBytes() default 1024000;
 
-    @AttributeDefinition(name = "Optimize alias resolution",
-        description ="This flag controls whether to optimize" +
-                     " the alias resolution by creating an internal cache of aliases. NOTE: this setting will be removed " +
-                     " with the optimized resolution being the default (see SLING-12025).")
+    @AttributeDefinition(
+            name = "Optimize alias resolution",
+            description = "This flag controls whether to optimize"
+                    + " the alias resolution by creating an internal cache of aliases. NOTE: this setting will be removed "
+                    + " with the optimized resolution being the default (see SLING-12025).")
     boolean resource_resolver_optimize_alias_resolution() default true;
 
-    @AttributeDefinition(name = "Allowed Optimized Alias Locations",
-         description = "This setting can contain a list of path prefixes, e.g. /libs/, /content/. If " +
-                 "such a list is configured, for alias optimization, only paths from resources starting with this prefix " +
-                 "are considered. If the list is empty, all paths are used.)")
+    @AttributeDefinition(
+            name = "Allowed Optimized Alias Locations",
+            description = "This setting can contain a list of path prefixes, e.g. /libs/, /content/. If "
+                    + "such a list is configured, for alias optimization, only paths from resources starting with this prefix "
+                    + "are considered. If the list is empty, all paths are used.)")
     String[] resource_resolver_allowed_alias_locations();
 
-    @AttributeDefinition(name = "Allowed Vanity Path Location",
-        description ="This setting can contain a list of path prefixes, e.g. /libs/, /content/. If " +
-            "such a list is configured, only vanity paths from resources starting with this prefix " +
-            " are considered. If the list is empty, all vanity paths are used.")
+    @AttributeDefinition(
+            name = "Allowed Vanity Path Location",
+            description = "This setting can contain a list of path prefixes, e.g. /libs/, /content/. If "
+                    + "such a list is configured, only vanity paths from resources starting with this prefix "
+                    + " are considered. If the list is empty, all vanity paths are used.")
     String[] resource_resolver_vanitypath_allowlist();
 
-    @AttributeDefinition(name = "Denied Vanity Path Location",
-        description ="This setting can contain a list of path prefixes, e.g. /misc/. If " +
-            "such a list is configured,vanity paths from resources starting with this prefix " +
-            " are not considered. If the list is empty, all vanity paths are used.")
+    @AttributeDefinition(
+            name = "Denied Vanity Path Location",
+            description = "This setting can contain a list of path prefixes, e.g. /misc/. If "
+                    + "such a list is configured,vanity paths from resources starting with this prefix "
+                    + " are not considered. If the list is empty, all vanity paths are used.")
     String[] resource_resolver_vanitypath_denylist();
 
-    @AttributeDefinition(name = "Vanity Path Precedence",
-        description ="This flag controls whether vanity paths" +
-                     " will have precedence over existing /etc/map mapping when resolving paths to resources")
+    @AttributeDefinition(
+            name = "Vanity Path Precedence",
+            description = "This flag controls whether vanity paths"
+                    + " will have precedence over existing /etc/map mapping when resolving paths to resources")
     boolean resource_resolver_vanity_precedence() default false;
 
-    @AttributeDefinition(name = "Paranoid Provider Handling",
-        description = "If this flag is enabled, an unregistration of a resource provider (not factory), "
-                      + "is causing the resource resolver factory to restart, potentially cleaning up "
-                      + "for memory leaks caused by objects hold from that resource provider.")
+    @AttributeDefinition(
+            name = "Paranoid Provider Handling",
+            description = "If this flag is enabled, an unregistration of a resource provider (not factory), "
+                    + "is causing the resource resolver factory to restart, potentially cleaning up "
+                    + "for memory leaks caused by objects hold from that resource provider.")
     boolean resource_resolver_providerhandling_paranoid() default false;
 
-    @AttributeDefinition(name = "Log resource resolver closing",
-        description = "When enabled CRUD operations with a closed resource resolver will log a stack trace " +
-                      "with the point where the used resolver was closed. It's advisable to not enable this feature on " +
-                      "production systems.")
+    @AttributeDefinition(
+            name = "Log resource resolver closing",
+            description = "When enabled CRUD operations with a closed resource resolver will log a stack trace "
+                    + "with the point where the used resolver was closed. It's advisable to not enable this feature on "
+                    + "production systems.")
     boolean resource_resolver_log_closing() default false;
 
-    @AttributeDefinition(name = "Log unclosed resource resolvers",
-            description = "When enabled unclosed resource resolvers will be logged. Not closing " +
-                          "a resource resolver is a bug in the code using the resolver and should be fixed.")
+    @AttributeDefinition(
+            name = "Log unclosed resource resolvers",
+            description = "When enabled unclosed resource resolvers will be logged. Not closing "
+                    + "a resource resolver is a bug in the code using the resolver and should be fixed.")
     boolean resource_resolver_log_unclosed() default true;
 }
-
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverFactoryImpl.java b/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverFactoryImpl.java
index 98505637..84949726 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverFactoryImpl.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverFactoryImpl.java
@@ -62,8 +62,10 @@ public class ResourceResolverFactoryImpl implements ResourceResolverFactory {
      * @see org.apache.sling.api.resource.ResourceResolverFactory#getServiceResourceResolver(java.util.Map)
      */
     @Override
-    public ResourceResolver getServiceResourceResolver(final Map<String, Object> passedAuthenticationInfo) throws LoginException {
-        final Map<String, Object> authenticationInfo = CommonResourceResolverFactoryImpl.sanitizeAuthenticationInfo(passedAuthenticationInfo, PASSWORD);
+    public ResourceResolver getServiceResourceResolver(final Map<String, Object> passedAuthenticationInfo)
+            throws LoginException {
+        final Map<String, Object> authenticationInfo =
+                CommonResourceResolverFactoryImpl.sanitizeAuthenticationInfo(passedAuthenticationInfo, PASSWORD);
         final Object info = authenticationInfo.get(SUBSERVICE);
         final String subServiceName = (info instanceof String) ? (String) info : null;
 
@@ -72,12 +74,13 @@ public class ResourceResolverFactoryImpl implements ResourceResolverFactory {
         // this should yield guest access or no access at all. For now
         // no access is granted if there is no service user defined for
         // the bundle.
-        final Iterable<String> principalNames = this.serviceUserMapper.getServicePrincipalNames(this.usingBundle, subServiceName);
+        final Iterable<String> principalNames =
+                this.serviceUserMapper.getServicePrincipalNames(this.usingBundle, subServiceName);
         if (principalNames == null) {
             final String userName = this.serviceUserMapper.getServiceUserID(this.usingBundle, subServiceName);
             if (userName == null) {
-                throw new LoginException("Cannot derive user name for bundle "
-                        + this.usingBundle + " and sub service " + subServiceName);
+                throw new LoginException("Cannot derive user name for bundle " + this.usingBundle + " and sub service "
+                        + subServiceName);
             } else {
                 // ensure proper user name
                 authenticationInfo.put(ResourceResolverFactory.USER, userName);
@@ -93,8 +96,7 @@ public class ResourceResolverFactoryImpl implements ResourceResolverFactory {
      * @see org.apache.sling.api.resource.ResourceResolverFactory#getResourceResolver(java.util.Map)
      */
     @Override
-    public ResourceResolver getResourceResolver(
-            final Map<String, Object> authenticationInfo) throws LoginException {
+    public ResourceResolver getResourceResolver(final Map<String, Object> authenticationInfo) throws LoginException {
         return commonFactory.getResourceResolver(authenticationInfo);
     }
 
@@ -102,8 +104,8 @@ public class ResourceResolverFactoryImpl implements ResourceResolverFactory {
      * @see org.apache.sling.api.resource.ResourceResolverFactory#getAdministrativeResourceResolver(java.util.Map)
      */
     @Override
-    public ResourceResolver getAdministrativeResourceResolver(
-            Map<String, Object> authenticationInfo) throws LoginException {
+    public ResourceResolver getAdministrativeResourceResolver(Map<String, Object> authenticationInfo)
+            throws LoginException {
         // usingBundle is required as bundles must now be allow listed to use this method
         if (usingBundle == null) {
             throw new LoginException("usingBundle is null");
@@ -130,4 +132,4 @@ public class ResourceResolverFactoryImpl implements ResourceResolverFactory {
     public List<String> getSearchPath() {
         return commonFactory.getSearchPath();
     }
-}
\ No newline at end of file
+}
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java b/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java
index e6473abc..6c1a10ad 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java
@@ -18,8 +18,6 @@
  */
 package org.apache.sling.resourceresolver.impl;
 
-import static org.apache.commons.lang3.StringUtils.defaultString;
-
 import java.io.Closeable;
 import java.util.Arrays;
 import java.util.Collections;
@@ -36,7 +34,6 @@ import java.util.StringTokenizer;
 import java.util.concurrent.ConcurrentHashMap;
 
 import jakarta.servlet.http.HttpServletRequest;
-
 import org.apache.commons.lang3.StringUtils;
 import org.apache.sling.adapter.annotations.Adaptable;
 import org.apache.sling.adapter.annotations.Adapter;
@@ -70,7 +67,11 @@ import org.jetbrains.annotations.Nullable;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-@Adaptable(adaptableClass = ResourceResolver.class, adapters = { @Adapter(ResourceMapper.class) })
+import static org.apache.commons.lang3.StringUtils.defaultString;
+
+@Adaptable(
+        adaptableClass = ResourceResolver.class,
+        adapters = {@Adapter(ResourceMapper.class)})
 public class ResourceResolverImpl extends SlingAdaptable implements ResourceResolver {
 
     /** Default logger */
@@ -88,10 +89,8 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
     // "xyzjcr:content"
     public static final String JCR_CONTENT_LEAF = "/jcr:content";
 
-
     protected static final String PARENT_RT_CACHEKEY = ResourceResolverImpl.class.getName() + ".PARENT_RT";
 
-
     /** The factory which created this resource resolver. */
     private final CommonResourceResolverFactoryImpl factory;
 
@@ -101,20 +100,29 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
     /** Resource resolver context. */
     private final ResourceResolverContext context;
 
-    protected final Map<ResourceTypeInformation,Boolean> resourceTypeLookupCache = new ConcurrentHashMap<>();
+    protected final Map<ResourceTypeInformation, Boolean> resourceTypeLookupCache = new ConcurrentHashMap<>();
 
     // Store the resourceSupertype mapping (supertype can be null)
-    protected final Map<String,Optional<String>> parentResourceTypeMap = new ConcurrentHashMap<>();
+    protected final Map<String, Optional<String>> parentResourceTypeMap = new ConcurrentHashMap<>();
 
-    private Map<String,Object> propertyMap;
+    private Map<String, Object> propertyMap;
 
     private volatile Exception closedResolverException;
 
-    public ResourceResolverImpl(final CommonResourceResolverFactoryImpl factory, final boolean isAdmin, final Map<String, Object> authenticationInfo) throws LoginException {
+    public ResourceResolverImpl(
+            final CommonResourceResolverFactoryImpl factory,
+            final boolean isAdmin,
+            final Map<String, Object> authenticationInfo)
+            throws LoginException {
         this(factory, isAdmin, authenticationInfo, factory.getResourceProviderTracker());
     }
 
-    ResourceResolverImpl(final CommonResourceResolverFactoryImpl factory, final boolean isAdmin, final Map<String, Object> authenticationInfo, final ResourceProviderStorageProvider resourceProviderTracker) throws LoginException {
+    ResourceResolverImpl(
+            final CommonResourceResolverFactoryImpl factory,
+            final boolean isAdmin,
+            final Map<String, Object> authenticationInfo,
+            final ResourceProviderStorageProvider resourceProviderTracker)
+            throws LoginException {
         this.factory = factory;
         this.context = new ResourceResolverContext(this, factory.getResourceAccessSecurityTracker());
         this.control = createControl(resourceProviderTracker, authenticationInfo, isAdmin);
@@ -127,7 +135,8 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
      * @param authenticationInfo The auth info
      * @throws LoginException if auth to a required provider fails
      */
-    private ResourceResolverImpl(final ResourceResolverImpl resolver, final Map<String, Object> authenticationInfo) throws LoginException {
+    private ResourceResolverImpl(final ResourceResolverImpl resolver, final Map<String, Object> authenticationInfo)
+            throws LoginException {
         this.factory = resolver.factory;
         Map<String, Object> authInfo = new HashMap<>();
         if (resolver.control.getAuthenticationInfo() != null) {
@@ -150,13 +159,18 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
      * @return A control
      * @throws LoginException If auth to the required providers fails.
      */
-    private ResourceResolverControl createControl(final ResourceProviderStorageProvider resourceProviderTracker,
+    private ResourceResolverControl createControl(
+            final ResourceProviderStorageProvider resourceProviderTracker,
             final Map<String, Object> authenticationInfo,
             final boolean isAdmin)
-    throws LoginException {
-        final ResourceResolverControl control = new ResourceResolverControl(isAdmin, authenticationInfo, resourceProviderTracker);
+            throws LoginException {
+        final ResourceResolverControl control =
+                new ResourceResolverControl(isAdmin, authenticationInfo, resourceProviderTracker);
 
-        this.context.getProviderManager().authenticateAll(resourceProviderTracker.getResourceProviderStorage().getAuthRequiredHandlers(), control);
+        this.context
+                .getProviderManager()
+                .authenticateAll(
+                        resourceProviderTracker.getResourceProviderStorage().getAuthRequiredHandlers(), control);
 
         return control;
     }
@@ -165,8 +179,7 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
      * @see org.apache.sling.api.resource.ResourceResolver#clone(Map)
      */
     @Override
-    public ResourceResolver clone(final Map<String, Object> authenticationInfo)
-            throws LoginException {
+    public ResourceResolver clone(final Map<String, Object> authenticationInfo) throws LoginException {
         // ensure resolver is still live
         checkClosed();
 
@@ -194,14 +207,14 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
         this.factory.unregister(this, this.control);
     }
 
-    private void clearPropertyMap(){
+    private void clearPropertyMap() {
         if (propertyMap != null) {
             for (Entry<String, Object> entry : propertyMap.entrySet()) {
-                if (entry.getValue()  instanceof Closeable) {
+                if (entry.getValue() instanceof Closeable) {
                     try {
                         ((Closeable) entry.getValue()).close();
                     } catch (Exception e) {
-                        logger.warn("ignoring exception while closing the value for key [{}] ", entry.getKey(),e);
+                        logger.warn("ignoring exception while closing the value for key [{}] ", entry.getKey(), e);
                     }
                 }
             }
@@ -223,7 +236,8 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
             throw new IllegalStateException("Resource resolver is already closed.");
         }
         if (!this.factory.isLive()) {
-            throw new IllegalStateException("Resource resolver factory which created this resolver is no longer active.");
+            throw new IllegalStateException(
+                    "Resource resolver factory which created this resolver is no longer active.");
         }
     }
 
@@ -329,7 +343,7 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
         absPath = unmangleNamespaces(absPath);
 
         // Assume http://localhost:80 if request is null
-        String[] realPathList = { absPath };
+        String[] realPathList = {absPath};
         String requestPath;
         if (request != null) {
             requestPath = getMapPath(request.scheme, request.serverName, request.serverPort, absPath);
@@ -347,13 +361,17 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
 
             String[] mappedPath = null;
 
-            final Iterator<MapEntry> mapEntriesIterator = this.factory.getMapEntries().getResolveMapsIterator(requestPath);
+            final Iterator<MapEntry> mapEntriesIterator =
+                    this.factory.getMapEntries().getResolveMapsIterator(requestPath);
             while (mapEntriesIterator.hasNext()) {
                 final MapEntry mapEntry = mapEntriesIterator.next();
                 mappedPath = mapEntry.replace(requestPath);
                 if (mappedPath != null) {
                     if (logger.isDebugEnabled()) {
-                        logger.debug("resolve: MapEntry {} matches, mapped path is {}", mapEntry, Arrays.toString(mappedPath));
+                        logger.debug(
+                                "resolve: MapEntry {} matches, mapped path is {}",
+                                mapEntry,
+                                Arrays.toString(mappedPath));
                     }
                     if (mapEntry.isInternal()) {
                         // internal redirect
@@ -363,8 +381,9 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
 
                     // external redirect
                     logger.debug("resolve: Returning external redirect");
-                    return this.factory.getResourceDecoratorTracker().decorate(
-                            new RedirectResource(this, absPath, mappedPath[0], mapEntry.getStatus()));
+                    return this.factory
+                            .getResourceDecoratorTracker()
+                            .decorate(new RedirectResource(this, absPath, mappedPath[0], mapEntry.getStatus()));
                 }
             }
 
@@ -387,7 +406,7 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
             try {
                 final URI uri = new URI(mappedPath[0], false);
                 requestPath = getMapPath(uri.getScheme(), uri.getHost(), uri.getPort(), uri.getPath());
-                realPathList = new String[] { uri.getPath() };
+                realPathList = new String[] {uri.getPath()};
 
                 logger.debug("resolve: Mapped path is an URL, using new request path {}", requestPath);
             } catch (final URIException use) {
@@ -405,7 +424,6 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
             final ParsedParameters parsedPath = new ParsedParameters(realPathList[i]);
             final String realPath = parsedPath.getRawPath();
 
-
             // first check whether the requested resource is a StarResource
             if (StarResource.appliesTo(realPath)) {
                 logger.debug("resolve: Mapped path {} is a Star Resource", realPath);
@@ -421,14 +439,13 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
 
                 } else {
 
-                    for(final String path : factory.getSearchPath()) {
+                    for (final String path : factory.getSearchPath()) {
                         logger.debug("resolve: Try relative mapped path with search path entry {}", path);
                         res = resolveInternal(path + realPath, parsedPath.getParameters());
-                        if ( res != null ) {
+                        if (res != null) {
                             break;
                         }
                     }
-
                 }
             }
         }
@@ -437,7 +454,8 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
         if (res == null) {
             final ParsedParameters parsedPath = new ParsedParameters(realPathList[0]);
             final String resourcePath = ensureAbsPath(parsedPath.getRawPath());
-            logger.debug("resolve: Path {} does not resolve, returning NonExistingResource at {}", absPath, resourcePath);
+            logger.debug(
+                    "resolve: Path {} does not resolve, returning NonExistingResource at {}", absPath, resourcePath);
 
             res = new NonExistingResource(this, resourcePath);
             // SLING-864: if the path contains a dot we assume this to be
@@ -465,7 +483,7 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
     @Override
     public String map(final String resourcePath) {
         checkClosed();
-        return map((HttpServletRequest)null, resourcePath);
+        return map((HttpServletRequest) null, resourcePath);
     }
 
     /**
@@ -530,7 +548,7 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
         checkClosed();
 
         String absolutePath = path;
-        if (absolutePath != null && !absolutePath.startsWith("/") && base != null && base.getPath() != null ) {
+        if (absolutePath != null && !absolutePath.startsWith("/") && base != null && base.getPath() != null) {
             absolutePath = appendToPath(base.getPath(), absolutePath);
         }
 
@@ -549,21 +567,30 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
     private static String appendToPath(final String pathWithParameters, final String segmentToAppend) {
         final ParsedParameters parsed = new ParsedParameters(pathWithParameters);
         if (parsed.getParametersString() == null) {
-            return new StringBuilder(parsed.getRawPath()).append('/').append(segmentToAppend).toString();
+            return new StringBuilder(parsed.getRawPath())
+                    .append('/')
+                    .append(segmentToAppend)
+                    .toString();
         } else {
-            return new StringBuilder(parsed.getRawPath()).append('/').append(segmentToAppend).append(parsed.getParametersString()).toString();
+            return new StringBuilder(parsed.getRawPath())
+                    .append('/')
+                    .append(segmentToAppend)
+                    .append(parsed.getParametersString())
+                    .toString();
         }
     }
 
     private Resource getResourceInternal(Resource parent, String path) {
 
         Resource result = null;
-        if ( path != null ) {
+        if (path != null) {
             // if the path is absolute, normalize . and .. segments and get res
             if (path.startsWith("/")) {
                 final ParsedParameters parsedPath = new ParsedParameters(path);
                 path = ResourceUtil.normalize(parsedPath.getRawPath());
-                result = (path != null) ? getAbsoluteResourceInternal(parent, path, parsedPath.getParameters(), false) : null;
+                result = (path != null)
+                        ? getAbsoluteResourceInternal(parent, path, parsedPath.getParameters(), false)
+                        : null;
                 if (result != null) {
                     result = this.factory.getResourceDecoratorTracker().decorate(result);
                 }
@@ -593,7 +620,8 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
         if (parent instanceof ResourceWrapper) {
             return listChildren(((ResourceWrapper) parent).getResource());
         }
-        return new ResourceIteratorDecorator(this.factory.getResourceDecoratorTracker(), this.control.listChildren(this.context, parent));
+        return new ResourceIteratorDecorator(
+                this.factory.getResourceDecoratorTracker(), this.control.listChildren(this.context, parent));
     }
 
     /**
@@ -624,7 +652,8 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
     public Iterator<Resource> findResources(final String query, final String language) throws SlingException {
         checkClosed();
 
-        return new ResourceIteratorDecorator(this.factory.getResourceDecoratorTracker(),
+        return new ResourceIteratorDecorator(
+                this.factory.getResourceDecoratorTracker(),
                 control.findResources(this.context, query, defaultString(language, DEFAULT_QUERY_LANGUAGE)));
     }
 
@@ -648,23 +677,23 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
         checkClosed();
 
         // Try auth info first
-        if ( this.control.getAuthenticationInfo() != null ) {
+        if (this.control.getAuthenticationInfo() != null) {
             final Object impUser = this.control.getAuthenticationInfo().get(ResourceResolverFactory.USER_IMPERSONATION);
-            if ( impUser != null ) {
+            if (impUser != null) {
                 return impUser.toString();
             }
             final Object user = this.control.getAuthenticationInfo().get(ResourceResolverFactory.USER);
-            if ( user != null ) {
+            if (user != null) {
                 return user.toString();
             }
         }
         // Try attributes
         final Object impUser = this.getAttribute(ResourceResolverFactory.USER_IMPERSONATION);
-        if ( impUser != null ) {
+        if (impUser != null) {
             return impUser.toString();
         }
         final Object user = this.getAttribute(ResourceResolverFactory.USER);
-        if ( user != null ) {
+        if (user != null) {
             return user.toString();
         }
 
@@ -681,7 +710,7 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
      */
     @SuppressWarnings("unchecked")
     private <AdapterType> AdapterType getSession(final Class<AdapterType> type) {
-        if ( !this.searchedSession ) {
+        if (!this.searchedSession) {
             this.searchedSession = true;
             this.cachedSession = this.control.adaptTo(this.context, type);
         }
@@ -702,12 +731,15 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
             return getSession(type);
         }
 
-        if ( type == ResourceMapper.class )
-            return (AdapterType) new ResourceMapperImpl(this, factory.getResourceDecoratorTracker(), factory.getMapEntries(),
+        if (type == ResourceMapper.class)
+            return (AdapterType) new ResourceMapperImpl(
+                    this,
+                    factory.getResourceDecoratorTracker(),
+                    factory.getMapEntries(),
                     factory.getNamespaceMangler());
 
         final AdapterType result = this.control.adaptTo(this.context, type);
-        if ( result != null ) {
+        if (result != null) {
             return result;
         }
 
@@ -770,7 +802,7 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
     public Resource resolveInternal(final String absPath, final Map<String, String> parameters) {
         Resource resource = null;
         if (absPath != null && !absPath.isEmpty() && !absPath.startsWith("/")) {
-            logger.debug("resolveInternal: absolute path expected {} ",absPath);
+            logger.debug("resolveInternal: absolute path expected {} ", absPath);
             return resource; // resource is null at this point
         }
         String curPath = absPath;
@@ -794,7 +826,9 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
             resource.getResourceMetadata().setResolutionPathInfo(rpi);
             resource.getResourceMetadata().setParameterMap(parameters);
 
-            logger.debug("resolveInternal: Found resource {} with path info {} for {}", new Object[] { resource, rpi, absPath });
+            logger.debug(
+                    "resolveInternal: Found resource {} with path info {} for {}",
+                    new Object[] {resource, rpi, absPath});
 
         } else {
 
@@ -804,8 +838,8 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
             // resource tree to find a match
             resource = getAbsoluteResourceInternal(null, "/", parameters, true);
 
-            //no read access on / drilling further down
-            //SLING-5638
+            // no read access on / drilling further down
+            // SLING-5638
             if (resource == null) {
                 resource = getAbsoluteResourceInternal(absPath, parameters, true);
                 if (resource != null) {
@@ -815,7 +849,7 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
 
             final StringBuilder resolutionPath = new StringBuilder();
             final StringTokenizer tokener = new StringTokenizer(tokenizedPath, "/");
-            final int delimCount = StringUtils.countMatches(tokenizedPath,'/');
+            final int delimCount = StringUtils.countMatches(tokenizedPath, '/');
             final int redundantDelimCount = delimCount - tokener.countTokens();
 
             while (resource != null && tokener.hasMoreTokens()) {
@@ -860,8 +894,9 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
                 resource.getResourceMetadata().setResolutionPathInfo(pathInfo);
                 resource.getResourceMetadata().setParameterMap(parameters);
 
-                logger.debug("resolveInternal: Found resource {} with path info {} for {}", new Object[] { resource, pathInfo,
-                        absPath });
+                logger.debug(
+                        "resolveInternal: Found resource {} with path info {} for {}",
+                        new Object[] {resource, pathInfo, absPath});
             }
         }
 
@@ -870,17 +905,19 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
 
     private Resource getChildInternal(final Resource parent, final String childName) {
         final String path;
-        if ( childName.startsWith("/") ) {
+        if (childName.startsWith("/")) {
             path = childName;
         } else {
             path = parent.getPath() + '/' + childName;
         }
-        Resource child = getAbsoluteResourceInternal(parent, ResourceUtil.normalize(path), EMPTY_PARAMETERS, true );
+        Resource child = getAbsoluteResourceInternal(parent, ResourceUtil.normalize(path), EMPTY_PARAMETERS, true);
         if (child != null) {
             final String alias = ResourceResolverControl.getProperty(child, PROP_REDIRECT_INTERNAL);
             if (alias != null) {
                 // TODO: might be a redirect ??
-                logger.warn("getChildInternal: Internal redirect to {} for Resource {} is not supported yet, ignoring", alias,
+                logger.warn(
+                        "getChildInternal: Internal redirect to {} for Resource {} is not supported yet, ignoring",
+                        alias,
                         child);
             }
 
@@ -890,24 +927,28 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
 
         // we do not have a child with the exact name, so we look for
         // a child, whose alias matches the childName
-        if (factory.getMapEntries().isOptimizeAliasResolutionEnabled()){
+        if (factory.getMapEntries().isOptimizeAliasResolutionEnabled()) {
             logger.debug("getChildInternal: Optimize Alias Resolution is Enabled");
-            //optimization made in SLING-2521
-            final Optional<String> aliasedResourceName = factory.getMapEntries().getAliasMap(parent.getPath()).entrySet()
-                    .stream().filter(e -> e.getValue().contains(childName)).findFirst().map(Map.Entry::getKey);
+            // optimization made in SLING-2521
+            final Optional<String> aliasedResourceName =
+                    factory.getMapEntries().getAliasMap(parent.getPath()).entrySet().stream()
+                            .filter(e -> e.getValue().contains(childName))
+                            .findFirst()
+                            .map(Map.Entry::getKey);
             if (aliasedResourceName.isPresent()) {
                 final String aliasPath;
-                if ( aliasedResourceName.get().startsWith("/") ) {
+                if (aliasedResourceName.get().startsWith("/")) {
                     aliasPath = aliasedResourceName.get();
                 } else {
                     aliasPath = parent.getPath() + '/' + aliasedResourceName.get();
                 }
-                final Resource aliasedChild = getAbsoluteResourceInternal(parent, ResourceUtil.normalize(aliasPath), EMPTY_PARAMETERS, true );
+                final Resource aliasedChild =
+                        getAbsoluteResourceInternal(parent, ResourceUtil.normalize(aliasPath), EMPTY_PARAMETERS, true);
                 logger.debug("getChildInternal: Found Resource {} with alias {} to use", aliasedChild, childName);
                 return aliasedChild;
             }
         } else {
-            if ( this.factory.isOptimizeAliasResolutionEnabled() ) {
+            if (this.factory.isOptimizeAliasResolutionEnabled()) {
                 this.factory.getMapEntries().logDisableAliasOptimization();
             }
             logger.debug("getChildInternal: Optimize Alias Resolution is Disabled");
@@ -919,8 +960,10 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
                     if (aliases != null) {
                         for (final String alias : aliases) {
                             if (childName.equals(alias)) {
-                                logger.debug("getChildInternal: Found Resource {} with alias {} to use", child, childName);
-                                final Resource aliasedChild = getAbsoluteResourceInternal(parent, ResourceUtil.normalize(child.getPath()) , EMPTY_PARAMETERS, true);
+                                logger.debug(
+                                        "getChildInternal: Found Resource {} with alias {} to use", child, childName);
+                                final Resource aliasedChild = getAbsoluteResourceInternal(
+                                        parent, ResourceUtil.normalize(child.getPath()), EMPTY_PARAMETERS, true);
                                 return aliasedChild;
                             }
                         }
@@ -937,7 +980,11 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
     /**
      * Creates a resource with the given path if existing
      */
-    private Resource getAbsoluteResourceInternal(@Nullable final Resource parent, @Nullable final String path, final Map<String, String> parameters, final boolean isResolve) {
+    private Resource getAbsoluteResourceInternal(
+            @Nullable final Resource parent,
+            @Nullable final String path,
+            final Map<String, String> parameters,
+            final boolean isResolve) {
         if (path == null || path.length() == 0 || path.charAt(0) != '/') {
             logger.debug("getResourceInternal: Path must be absolute {}", path);
             return null; // path must be absolute
@@ -965,7 +1012,8 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
      * Creates a resource, traversing bottom up, to the highest readable resource.
      *
      */
-    private Resource getAbsoluteResourceInternal(String absPath, final Map<String, String> parameters, final boolean isResolved) {
+    private Resource getAbsoluteResourceInternal(
+            String absPath, final Map<String, String> parameters, final boolean isResolved) {
 
         if (!absPath.contains("/") || "/".equals(absPath)) {
             return null;
@@ -1005,8 +1053,8 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
     }
 
     private String unmangleNamespaces(String absPath) {
-        if (absPath != null && factory.getNamespaceMangler() != null ) {
-            absPath = ((JcrNamespaceMangler)factory.getNamespaceMangler()).unmangleNamespaces(this, logger, absPath);
+        if (absPath != null && factory.getNamespaceMangler() != null) {
+            absPath = ((JcrNamespaceMangler) factory.getNamespaceMangler()).unmangleNamespaces(this, logger, absPath);
         }
 
         return absPath;
@@ -1016,12 +1064,11 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
      * @see org.apache.sling.api.resource.ResourceResolver#delete(org.apache.sling.api.resource.Resource)
      */
     @Override
-    public void delete(final Resource resource)
-            throws PersistenceException {
+    public void delete(final Resource resource) throws PersistenceException {
         checkClosed();
 
         // check if the resource is non existing - throws NPE if resource is null as stated in the API
-        if ( ResourceUtil.isNonExistingResource(resource) ) {
+        if (ResourceUtil.isNonExistingResource(resource)) {
             // nothing to do
             return;
         }
@@ -1037,21 +1084,21 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
             throws PersistenceException {
         checkClosed();
         // if parent or name is null, we get an NPE as stated in the API
-        if ( name == null ) {
+        if (name == null) {
             throw new NullPointerException("name");
         }
         // name should be a name not a path
-        if ( name.indexOf("/") != -1 ) {
+        if (name.indexOf("/") != -1) {
             throw new IllegalArgumentException("Name should not contain a slash: " + name);
         }
         final String path;
-        if ( parent.getPath().equals("/") ) {
+        if (parent.getPath().equals("/")) {
             path = parent.getPath() + name;
         } else {
             path = parent.getPath() + "/" + name;
         }
         // experimental code for handling synthetic resources
-        if ( ResourceUtil.isSyntheticResource(parent) ) {
+        if (ResourceUtil.isSyntheticResource(parent)) {
             Resource grandParent = parent.getParent();
             if (grandParent != null) {
                 this.create(grandParent, parent.getName(), null);
@@ -1102,11 +1149,11 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
     /**
      * @see org.apache.sling.api.resource.ResourceResolver#hasChildren()
      */
-	@Override
+    @Override
     public boolean hasChildren(Resource resource) {
         checkClosed();
-		return listChildren(resource).hasNext();
-	}
+        return listChildren(resource).hasNext();
+    }
 
     /**
      * @see org.apache.sling.api.resource.ResourceResolver#getParentResourceType(org.apache.sling.api.resource.Resource)
@@ -1115,9 +1162,10 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
     public String getParentResourceType(final Resource resource) {
         checkClosed();
         String resourceSuperType = null;
-        if ( resource != null ) {
+        if (resource != null) {
             if (parentResourceTypeMap.containsKey(resource.getPath())) {
-                resourceSuperType = parentResourceTypeMap.get(resource.getPath()).orElse(null);
+                resourceSuperType =
+                        parentResourceTypeMap.get(resource.getPath()).orElse(null);
             } else {
                 resourceSuperType = getParentResourceTypeInternal(resource);
                 parentResourceTypeMap.put(resource.getPath(), Optional.ofNullable(resourceSuperType));
@@ -1151,11 +1199,12 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
     public boolean isResourceType(final Resource resource, final String resourceType) {
         checkClosed();
 
-        if ( resource != null && resourceType != null ) {
-             ResourceTypeInformation key = new ResourceTypeInformation(resource.getResourceType(),resource.getResourceSuperType(), resourceType);
-             Boolean value = resourceTypeLookupCache.computeIfAbsent(key,
-                     (k) -> isResourceTypeInternal(resource, resourceType));
-             return value.booleanValue();
+        if (resource != null && resourceType != null) {
+            ResourceTypeInformation key = new ResourceTypeInformation(
+                    resource.getResourceType(), resource.getResourceSuperType(), resourceType);
+            Boolean value =
+                    resourceTypeLookupCache.computeIfAbsent(key, (k) -> isResourceTypeInternal(resource, resourceType));
+            return value.booleanValue();
         } else {
             return false;
         }
@@ -1172,24 +1221,27 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
     boolean isResourceTypeInternal(final Resource resource, final String resourceType) {
         boolean result = false;
         if (ResourceTypeUtil.areResourceTypesEqual(resourceType, resource.getResourceType(), factory.getSearchPath())) {
-             // direct match
-             result = true;
-         } else {
-
-             Set<String> superTypesChecked = new HashSet<>();
-             String superType = this.getParentResourceType(resource);
-             while (!result && superType != null) {
-                 if (ResourceTypeUtil.areResourceTypesEqual(resourceType, superType, factory.getSearchPath())) {
-                     result = true;
-                 } else {
-                     superTypesChecked.add(superType);
-                     superType = this.getParentResourceType(superType);
-                     if (superType != null && superTypesChecked.contains(superType)) {
-                         throw new SlingException("Cyclic dependency for resourceSuperType hierarchy detected on resource " + resource.getPath(), null);
-                     }
-                 }
-             }
-         }
+            // direct match
+            result = true;
+        } else {
+
+            Set<String> superTypesChecked = new HashSet<>();
+            String superType = this.getParentResourceType(resource);
+            while (!result && superType != null) {
+                if (ResourceTypeUtil.areResourceTypesEqual(resourceType, superType, factory.getSearchPath())) {
+                    result = true;
+                } else {
+                    superTypesChecked.add(superType);
+                    superType = this.getParentResourceType(superType);
+                    if (superType != null && superTypesChecked.contains(superType)) {
+                        throw new SlingException(
+                                "Cyclic dependency for resourceSuperType hierarchy detected on resource "
+                                        + resource.getPath(),
+                                null);
+                    }
+                }
+            }
+        }
         return result;
     }
 
@@ -1209,13 +1261,13 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
         checkClosed();
         Resource rsrc = null;
         final String parentPath = ResourceUtil.getParent(child.getPath());
-        if ( parentPath != null ) {
+        if (parentPath != null) {
             // if the parent path is relative, resolve using search paths.
-            if ( !parentPath.startsWith("/") ) {
+            if (!parentPath.startsWith("/")) {
                 rsrc = context.getResourceResolver().getResource(parentPath);
             } else {
                 rsrc = this.control.getParent(this.context, parentPath, child);
-                if (rsrc != null ) {
+                if (rsrc != null) {
                     rsrc.getResourceMetadata().setResolutionPath(rsrc.getPath());
                     rsrc = this.factory.getResourceDecoratorTracker().decorate(rsrc);
                 }
@@ -1228,7 +1280,7 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
     public Resource copy(final String srcAbsPath, final String destAbsPath) throws PersistenceException {
         checkClosed();
         Resource rsrc = this.control.copy(this.context, srcAbsPath, destAbsPath);
-        if (rsrc != null ) {
+        if (rsrc != null) {
             rsrc.getResourceMetadata().setResolutionPath(rsrc.getPath());
             rsrc = this.factory.getResourceDecoratorTracker().decorate(rsrc);
         }
@@ -1239,7 +1291,7 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
     public Resource move(final String srcAbsPath, final String destAbsPath) throws PersistenceException {
         checkClosed();
         Resource rsrc = this.control.move(this.context, srcAbsPath, destAbsPath);
-        if (rsrc != null ) {
+        if (rsrc != null) {
             rsrc.getResourceMetadata().setResolutionPath(rsrc.getPath());
             rsrc = this.factory.getResourceDecoratorTracker().decorate(rsrc);
         }
@@ -1247,7 +1299,7 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
     }
 
     @Override
-    public Map<String,Object> getPropertyMap() {
+    public Map<String, Object> getPropertyMap() {
         if (propertyMap == null) {
             propertyMap = new HashMap<>();
         }
@@ -1261,7 +1313,7 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
         String s2;
         String s3;
 
-        public ResourceTypeInformation (String resourceType, String resourceSuperType, String resourceTypeToCompareTo) {
+        public ResourceTypeInformation(String resourceType, String resourceSuperType, String resourceTypeToCompareTo) {
             this.s1 = resourceType;
             this.s2 = resourceSuperType;
             this.s3 = resourceTypeToCompareTo;
@@ -1277,12 +1329,9 @@ public class ResourceResolverImpl extends SlingAdaptable implements ResourceReso
 
         @Override
         public boolean equals(Object obj) {
-            if (this == obj)
-                return true;
-            if (obj == null)
-                return false;
-            if (getClass() != obj.getClass())
-                return false;
+            if (this == obj) return true;
+            if (obj == null) return false;
+            if (getClass() != obj.getClass()) return false;
             ResourceTypeInformation other = (ResourceTypeInformation) obj;
             return Objects.equals(s1, other.s1) && Objects.equals(s2, other.s2) && Objects.equals(s3, other.s3);
         }
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverMetrics.java b/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverMetrics.java
index 4c19e48b..7578ee33 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverMetrics.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverMetrics.java
@@ -47,9 +47,7 @@ import org.osgi.service.component.annotations.Reference;
  *
  *  org.apache.sling.resourceresolver.unclosedResourceResolvers -- the total number of unclosed resource resolvers
  */
-
-
-@Component(service=ResourceResolverMetrics.class)
+@Component(service = ResourceResolverMetrics.class)
 public class ResourceResolverMetrics {
 
     protected static final String METRICS_PREFIX = "org.apache.sling.resourceresolver";
@@ -99,16 +97,39 @@ public class ResourceResolverMetrics {
 
     @Activate
     protected void activate(BundleContext bundleContext) {
-        numberOfVanityPathsGauge = registerGauge(bundleContext, METRICS_PREFIX + ".numberOfVanityPaths", () -> numberOfVanityPathsSupplier);
-        numberOfResourcesWithVanityPathsOnStartupGauge = registerGauge(bundleContext, METRICS_PREFIX + ".numberOfResourcesWithVanityPathsOnStartup", () -> numberOfResourcesWithVanityPathsOnStartupSupplier);
-        numberOfVanityPathLookupsGauge = registerGauge(bundleContext, METRICS_PREFIX + ".numberOfVanityPathLookups", () -> numberOfVanityPathLookupsSupplier);
-        numberOfVanityPathBloomNegativesGauge = registerGauge(bundleContext, METRICS_PREFIX + ".numberOfVanityPathBloomNegatives", () -> numberOfVanityPathBloomNegativesSupplier);
-        numberOfVanityPathBloomFalsePositivesGauge = registerGauge(bundleContext, METRICS_PREFIX + ".numberOfVanityPathBloomFalsePositives", () -> numberOfVanityPathBloomFalsePositivesSupplier);
-        numberOfResourcesWithAliasedChildrenGauge = registerGauge(bundleContext, METRICS_PREFIX + ".numberOfResourcesWithAliasedChildren", () -> numberOfResourcesWithAliasedChildrenSupplier);
-        numberOfResourcesWithAliasesOnStartupGauge = registerGauge(bundleContext, METRICS_PREFIX + ".numberOfResourcesWithAliasesOnStartup", () -> numberOfResourcesWithAliasesOnStartupSupplier);
-        numberOfDetectedInvalidAliasesGauge = registerGauge(bundleContext, METRICS_PREFIX + ".numberOfDetectedInvalidAliases", () -> numberOfDetectedInvalidAliasesSupplier);
-        numberOfDetectedConflictingAliasesGauge = registerGauge(bundleContext, METRICS_PREFIX + ".numberOfDetectedConflictingAliases", () -> numberOfDetectedConflictingAliasesSupplier);
-        unclosedResourceResolvers = metricsService.counter(METRICS_PREFIX  + ".unclosedResourceResolvers");
+        numberOfVanityPathsGauge = registerGauge(
+                bundleContext, METRICS_PREFIX + ".numberOfVanityPaths", () -> numberOfVanityPathsSupplier);
+        numberOfResourcesWithVanityPathsOnStartupGauge = registerGauge(
+                bundleContext,
+                METRICS_PREFIX + ".numberOfResourcesWithVanityPathsOnStartup",
+                () -> numberOfResourcesWithVanityPathsOnStartupSupplier);
+        numberOfVanityPathLookupsGauge = registerGauge(
+                bundleContext, METRICS_PREFIX + ".numberOfVanityPathLookups", () -> numberOfVanityPathLookupsSupplier);
+        numberOfVanityPathBloomNegativesGauge = registerGauge(
+                bundleContext,
+                METRICS_PREFIX + ".numberOfVanityPathBloomNegatives",
+                () -> numberOfVanityPathBloomNegativesSupplier);
+        numberOfVanityPathBloomFalsePositivesGauge = registerGauge(
+                bundleContext,
+                METRICS_PREFIX + ".numberOfVanityPathBloomFalsePositives",
+                () -> numberOfVanityPathBloomFalsePositivesSupplier);
+        numberOfResourcesWithAliasedChildrenGauge = registerGauge(
+                bundleContext,
+                METRICS_PREFIX + ".numberOfResourcesWithAliasedChildren",
+                () -> numberOfResourcesWithAliasedChildrenSupplier);
+        numberOfResourcesWithAliasesOnStartupGauge = registerGauge(
+                bundleContext,
+                METRICS_PREFIX + ".numberOfResourcesWithAliasesOnStartup",
+                () -> numberOfResourcesWithAliasesOnStartupSupplier);
+        numberOfDetectedInvalidAliasesGauge = registerGauge(
+                bundleContext,
+                METRICS_PREFIX + ".numberOfDetectedInvalidAliases",
+                () -> numberOfDetectedInvalidAliasesSupplier);
+        numberOfDetectedConflictingAliasesGauge = registerGauge(
+                bundleContext,
+                METRICS_PREFIX + ".numberOfDetectedConflictingAliases",
+                () -> numberOfDetectedConflictingAliasesSupplier);
+        unclosedResourceResolvers = metricsService.counter(METRICS_PREFIX + ".unclosedResourceResolvers");
     }
 
     @Deactivate
@@ -213,7 +234,8 @@ public class ResourceResolverMetrics {
      * @return the ServiceRegistration for this metric (must be unregistered!)
      */
     @SuppressWarnings("unchecked")
-    private ServiceRegistration<Gauge<Long>> registerGauge(BundleContext context, String name, Supplier<Supplier<Long>> supplier) {
+    private ServiceRegistration<Gauge<Long>> registerGauge(
+            BundleContext context, String name, Supplier<Supplier<Long>> supplier) {
 
         ResourceResolverGauge gauge = new ResourceResolverGauge(supplier);
         @SuppressWarnings("all")
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/ResourceTypeUtil.java b/src/main/java/org/apache/sling/resourceresolver/impl/ResourceTypeUtil.java
index 2ba9e046..36c6e14a 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/ResourceTypeUtil.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/ResourceTypeUtil.java
@@ -41,8 +41,10 @@ public class ResourceTypeUtil {
      * @param anotherResourceType Another resource type to compare with {@link resourceType}.
      * @return <code>true</code> if the resource type equals the given resource type.
      */
-    public static boolean areResourceTypesEqual(@NotNull String resourceType, @NotNull String anotherResourceType, @NotNull List<String> searchPath) {
-        return relativizeResourceType(resourceType, searchPath).equals(relativizeResourceType(anotherResourceType, searchPath));
+    public static boolean areResourceTypesEqual(
+            @NotNull String resourceType, @NotNull String anotherResourceType, @NotNull List<String> searchPath) {
+        return relativizeResourceType(resourceType, searchPath)
+                .equals(relativizeResourceType(anotherResourceType, searchPath));
     }
 
     /**
@@ -62,5 +64,4 @@ public class ResourceTypeUtil {
         }
         return resourceType;
     }
-
 }
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/VanityPathConfigurer.java b/src/main/java/org/apache/sling/resourceresolver/impl/VanityPathConfigurer.java
index f6808f11..721ee6fe 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/VanityPathConfigurer.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/VanityPathConfigurer.java
@@ -47,24 +47,26 @@ class VanityPathConfigurer {
         this.config = c;
         this.vanityPathConfig = null;
 
-        final List<String> includes = this.configureVanityPathPrefixes(c.resource_resolver_vanitypath_allowlist(),
-            deprecatedConfig == null ? null : deprecatedConfig.resource_resolver_vanitypath_whitelist(),
-            "resource.resolver.vanitypath.allowlist",
-            "resource.resolver.vanitypath.whitelist");
-
-        final List<String> excludes = this.configureVanityPathPrefixes(c.resource_resolver_vanitypath_denylist(),
-            deprecatedConfig == null ? null : deprecatedConfig.resource_resolver_vanitypath_blacklist(),
-            "resource.resolver.vanitypath.denylist",
-            "resource.resolver.vanitypath.blacklist");
-        if ( includes != null || excludes != null ) {
+        final List<String> includes = this.configureVanityPathPrefixes(
+                c.resource_resolver_vanitypath_allowlist(),
+                deprecatedConfig == null ? null : deprecatedConfig.resource_resolver_vanitypath_whitelist(),
+                "resource.resolver.vanitypath.allowlist",
+                "resource.resolver.vanitypath.whitelist");
+
+        final List<String> excludes = this.configureVanityPathPrefixes(
+                c.resource_resolver_vanitypath_denylist(),
+                deprecatedConfig == null ? null : deprecatedConfig.resource_resolver_vanitypath_blacklist(),
+                "resource.resolver.vanitypath.denylist",
+                "resource.resolver.vanitypath.blacklist");
+        if (includes != null || excludes != null) {
             this.vanityPathConfig = new ArrayList<>();
-            if ( includes != null ) {
-                for(final String val : includes) {
+            if (includes != null) {
+                for (final String val : includes) {
                     this.vanityPathConfig.add(new VanityPathConfig(val, false));
                 }
             }
-            if ( excludes != null ) {
-                for(final String val : excludes) {
+            if (excludes != null) {
+                for (final String val : excludes) {
                     this.vanityPathConfig.add(new VanityPathConfig(val, true));
                 }
             }
@@ -88,7 +90,6 @@ class VanityPathConfigurer {
         return this.vanityPathConfig;
     }
 
-
     public boolean hasVanityPathPrecedence() {
         return this.config.resource_resolver_vanity_precedence();
     }
@@ -109,18 +110,22 @@ class VanityPathConfigurer {
         return value != null && value.length > 0;
     }
 
-    List<String> configureVanityPathPrefixes(final String[] pathPrefixes, final String[] pathPrefixesFallback,
-                                     String pathPrefixesPropertyName, String pathPrefixesFallbackPropertyName) {
-        if (isDefined(pathPrefixes) && isDefined(pathPrefixesFallback) ) {
+    List<String> configureVanityPathPrefixes(
+            final String[] pathPrefixes,
+            final String[] pathPrefixesFallback,
+            String pathPrefixesPropertyName,
+            String pathPrefixesFallbackPropertyName) {
+        if (isDefined(pathPrefixes) && isDefined(pathPrefixesFallback)) {
             logger.error("Both properties, " + pathPrefixesPropertyName + " and " + pathPrefixesFallbackPropertyName
-                + ", were defined. Using " + pathPrefixesPropertyName + " for configuring vanity paths. "
-                + "Please remove the other property from your configuration.");
+                    + ", were defined. Using " + pathPrefixesPropertyName + " for configuring vanity paths. "
+                    + "Please remove the other property from your configuration.");
             return filterVanityPathPrefixes(pathPrefixes);
         } else if (isDefined(pathPrefixes)) {
             return filterVanityPathPrefixes(pathPrefixes);
         } else if (isDefined(pathPrefixesFallback)) {
-            logger.warn("The property " + pathPrefixesPropertyName + " was not set. Using the " +
-                pathPrefixesFallbackPropertyName + " instead. Please update your configuration to use " + pathPrefixesPropertyName);
+            logger.warn("The property " + pathPrefixesPropertyName + " was not set. Using the "
+                    + pathPrefixesFallbackPropertyName + " instead. Please update your configuration to use "
+                    + pathPrefixesPropertyName);
             return filterVanityPathPrefixes(pathPrefixesFallback);
         }
         return null;
@@ -139,4 +144,4 @@ class VanityPathConfigurer {
         }
         return prefixList.isEmpty() ? null : prefixList;
     }
-}
\ No newline at end of file
+}
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/console/ResourceResolverWebConsolePlugin.java b/src/main/java/org/apache/sling/resourceresolver/impl/console/ResourceResolverWebConsolePlugin.java
index 7d440a18..9eb11918 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/console/ResourceResolverWebConsolePlugin.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/console/ResourceResolverWebConsolePlugin.java
@@ -18,6 +18,13 @@
  */
 package org.apache.sling.resourceresolver.impl.console;
 
+import javax.servlet.Servlet;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletRequestWrapper;
+import javax.servlet.http.HttpServletResponse;
+
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.io.UnsupportedEncodingException;
@@ -32,13 +39,6 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 
-import javax.servlet.Servlet;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletRequestWrapper;
-import javax.servlet.http.HttpServletResponse;
-
 import org.apache.sling.api.request.ResponseUtil;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.api.resource.mapping.ResourceMapper;
@@ -77,7 +77,8 @@ public class ResourceResolverWebConsolePlugin extends HttpServlet {
 
     private final transient BundleContext bundleContext;
 
-    public ResourceResolverWebConsolePlugin(final BundleContext context,
+    public ResourceResolverWebConsolePlugin(
+            final BundleContext context,
             final CommonResourceResolverFactoryImpl resolverFactory,
             final RuntimeService runtimeService) {
         this.resolverFactory = resolverFactory;
@@ -85,8 +86,7 @@ public class ResourceResolverWebConsolePlugin extends HttpServlet {
         this.bundleContext = context;
 
         Dictionary<String, Object> props = new Hashtable<String, Object>();
-        props.put(Constants.SERVICE_DESCRIPTION,
-                "Apache Sling Resource Resolver Web Console Plugin");
+        props.put(Constants.SERVICE_DESCRIPTION, "Apache Sling Resource Resolver Web Console Plugin");
         props.put(Constants.SERVICE_VENDOR, "The Apache Software Foundation");
         props.put(Constants.SERVICE_PID, getClass().getName());
         props.put("felix.webconsole.label", "jcrresolver");
@@ -106,9 +106,8 @@ public class ResourceResolverWebConsolePlugin extends HttpServlet {
     }
 
     @Override
-    protected void doGet(final HttpServletRequest request,
-            final HttpServletResponse response) throws ServletException,
-    IOException {
+    protected void doGet(final HttpServletRequest request, final HttpServletResponse response)
+            throws ServletException, IOException {
         final String msg = request.getParameter(PAR_MSG);
         final String test;
         if (msg != null) {
@@ -133,8 +132,7 @@ public class ResourceResolverWebConsolePlugin extends HttpServlet {
         pw.println("<tr class='content'>");
         pw.println("<td class='content'>Namespace Mangling</td>");
         pw.print("<td class='content' colspan='2'>");
-        pw.print(resolverFactory.isMangleNamespacePrefixes() ? "Enabled"
-                : "Disabled");
+        pw.print(resolverFactory.isMangleNamespacePrefixes() ? "Enabled" : "Disabled");
         pw.print("</td>");
         pw.println("</tr>");
         pw.println("<tr class='content'>");
@@ -168,10 +166,8 @@ public class ResourceResolverWebConsolePlugin extends HttpServlet {
             pw.print(ResponseUtil.escapeXml(test));
         }
         pw.println("' class='input' size='50'>");
-        pw.println("&nbsp;&nbsp;<input type='submit' name='" + ATTR_SUBMIT
-                + "' value='Resolve' class='submit'>");
-        pw.println("&nbsp;&nbsp;<input type='submit' name='" + ATTR_SUBMIT
-                + "' value='Map' class='submit'>");
+        pw.println("&nbsp;&nbsp;<input type='submit' name='" + ATTR_SUBMIT + "' value='Resolve' class='submit'>");
+        pw.println("&nbsp;&nbsp;<input type='submit' name='" + ATTR_SUBMIT + "' value='Map' class='submit'>");
         pw.print("</form>");
         pw.print("</td>");
         pw.println("</tr>");
@@ -205,12 +201,11 @@ public class ResourceResolverWebConsolePlugin extends HttpServlet {
         dumpDTOsHtml(pw);
 
         pw.println("</table>");
-
     }
 
     @Override
-    protected void doPost(HttpServletRequest request,
-            HttpServletResponse response) throws ServletException, IOException {
+    protected void doPost(HttpServletRequest request, HttpServletResponse response)
+            throws ServletException, IOException {
 
         final String test = request.getParameter(ATTR_TEST);
         String msg = null;
@@ -221,7 +216,8 @@ public class ResourceResolverWebConsolePlugin extends HttpServlet {
                 // prepare the request for the resource resolver
                 HttpServletRequest helper = new ResolverRequest(request, test);
 
-                resolver = resolverFactory.getServiceResourceResolver(this.resolverFactory.getServiceUserAuthenticationInfo("console"));
+                resolver = resolverFactory.getServiceResourceResolver(
+                        this.resolverFactory.getServiceUserAuthenticationInfo("console"));
 
                 // map or resolve as instructed
                 Object result;
@@ -249,43 +245,34 @@ public class ResourceResolverWebConsolePlugin extends HttpServlet {
                     resolver.close();
                 }
             }
-
         }
 
         // finally redirect
-        final String path = request.getContextPath() + request.getServletPath()
-        + request.getPathInfo();
+        final String path = request.getContextPath() + request.getServletPath() + request.getPathInfo();
         final String redirectTo;
         if (msg == null) {
             redirectTo = path;
         } else {
-            redirectTo = path + '?' + PAR_MSG + '=' + encodeParam(msg) + '&'
-                    + PAR_TEST + '=' + encodeParam(test);
+            redirectTo = path + '?' + PAR_MSG + '=' + encodeParam(msg) + '&' + PAR_TEST + '=' + encodeParam(test);
         }
         response.sendRedirect(redirectTo);
     }
 
     private static String mappingsToString(Collection<String> allMappings) {
-        if ( allMappings.size() == 0 )
-            return ""; // should not happen
-        if ( allMappings.size() == 1)
-            return allMappings.iterator().next();
+        if (allMappings.size() == 0) return ""; // should not happen
+        if (allMappings.size() == 1) return allMappings.iterator().next();
 
         StringBuilder out = new StringBuilder();
-        for ( Iterator<String> it = allMappings.iterator(); it.hasNext(); ) {
-            if ( out.length() == 0 ) {
+        for (Iterator<String> it = allMappings.iterator(); it.hasNext(); ) {
+            if (out.length() == 0) {
                 out.append("Primary: ").append(it.next());
-                if ( it.hasNext() )
-                    out.append(". Other candidates:");
-            }
-            else
-                out.append(' ').append(it.next()).append(',');
+                if (it.hasNext()) out.append(". Other candidates:");
+            } else out.append(' ').append(it.next()).append(',');
         }
 
         out.setCharAt(out.length() - 1, '.');
 
         return out.toString();
-
     }
 
     private String encodeParam(final String value) {
@@ -315,8 +302,7 @@ public class ResourceResolverWebConsolePlugin extends HttpServlet {
 
     // ---------- internal
 
-    private void dumpMapHtml(PrintWriter pw, String title, String description,
-            Collection<MapEntry> list) {
+    private void dumpMapHtml(PrintWriter pw, String title, String description, Collection<MapEntry> list) {
 
         titleHtml(pw, title, description);
 
@@ -355,7 +341,6 @@ public class ResourceResolverWebConsolePlugin extends HttpServlet {
                 pw.print(String.valueOf(entry.getStatus()));
             }
             pw.println("</td></tr>");
-
         }
     }
 
@@ -379,8 +364,7 @@ public class ResourceResolverWebConsolePlugin extends HttpServlet {
         pw.println("</tr>");
     }
 
-    private void dumpMapText(PrintWriter pw, String title,
-            Collection<MapEntry> list) {
+    private void dumpMapText(PrintWriter pw, String title, Collection<MapEntry> list) {
 
         pw.println(title);
 
@@ -389,8 +373,7 @@ public class ResourceResolverWebConsolePlugin extends HttpServlet {
 
         for (MapEntry entry : list) {
             final List<String> redir = Arrays.asList(entry.getRedirect());
-            final String status = entry.isInternal() ? "internal"
-                    : "external: " + entry.getStatus();
+            final String status = entry.isInternal() ? "internal" : "external: " + entry.getStatus();
             pw.printf(format, entry.getPattern(), redir, status);
         }
     }
@@ -398,13 +381,13 @@ public class ResourceResolverWebConsolePlugin extends HttpServlet {
     @SuppressWarnings("rawtypes")
     private ServiceReference<ResourceProvider<?>> getServiceReference(final long id) {
         try {
-            final Collection<ServiceReference<ResourceProvider>> refs = this.bundleContext.getServiceReferences(ResourceProvider.class,
-                    "(" + Constants.SERVICE_ID + "=" + String.valueOf(id) + ")");
-            if ( refs != null && !refs.isEmpty() ) {
+            final Collection<ServiceReference<ResourceProvider>> refs = this.bundleContext.getServiceReferences(
+                    ResourceProvider.class, "(" + Constants.SERVICE_ID + "=" + String.valueOf(id) + ")");
+            if (refs != null && !refs.isEmpty()) {
                 final ServiceReference rp = refs.iterator().next();
                 return rp;
             }
-        } catch ( final InvalidSyntaxException ise) {
+        } catch (final InvalidSyntaxException ise) {
             // ignore
         }
         return null;
@@ -421,17 +404,17 @@ public class ResourceResolverWebConsolePlugin extends HttpServlet {
         pw.println("</tr>");
 
         final RuntimeDTO runtimeDTO = this.runtimeService.getRuntimeDTO();
-        for(final ResourceProviderDTO dto : runtimeDTO.providers) {
+        for (final ResourceProviderDTO dto : runtimeDTO.providers) {
             // get service reference
             final ServiceReference<ResourceProvider<?>> ref = this.getServiceReference(dto.serviceId);
             final StringBuilder sb = new StringBuilder();
-            if ( dto.name != null ) {
+            if (dto.name != null) {
                 sb.append(dto.name);
                 sb.append(' ');
             } else {
                 sb.append("<unnamed> ");
             }
-            if ( ref != null ) {
+            if (ref != null) {
                 sb.append("(serviceId = ");
                 sb.append(dto.serviceId);
                 sb.append(", bundleId = ");
@@ -471,7 +454,7 @@ public class ResourceResolverWebConsolePlugin extends HttpServlet {
             pw.println("</td></tr>");
         }
 
-        if ( runtimeDTO.failedProviders.length > 0 ) {
+        if (runtimeDTO.failedProviders.length > 0) {
             titleHtml(pw, "Failed Resource Providers", "Lists all failed providers.");
 
             pw.println("<tr class='content'>");
@@ -480,17 +463,17 @@ public class ResourceResolverWebConsolePlugin extends HttpServlet {
             pw.println("<th class='content'>Reason</th>");
             pw.println("</tr>");
 
-            for(final ResourceProviderFailureDTO dto : runtimeDTO.failedProviders) {
+            for (final ResourceProviderFailureDTO dto : runtimeDTO.failedProviders) {
                 // get service reference
                 final ServiceReference<ResourceProvider<?>> ref = this.getServiceReference(dto.serviceId);
                 final StringBuilder sb = new StringBuilder();
-                if ( dto.name != null ) {
+                if (dto.name != null) {
                     sb.append(dto.name);
                     sb.append(' ');
                 } else {
                     sb.append("<unnamed> ");
                 }
-                if ( ref != null ) {
+                if (ref != null) {
                     sb.append("(serviceId = ");
                     sb.append(dto.serviceId);
                     sb.append(", bundleId = ");
@@ -521,17 +504,17 @@ public class ResourceResolverWebConsolePlugin extends HttpServlet {
         pw.printf(format, "Provider", "Path", "Configuration");
 
         final RuntimeDTO runtimeDTO = this.runtimeService.getRuntimeDTO();
-        for(final ResourceProviderDTO dto : runtimeDTO.providers) {
+        for (final ResourceProviderDTO dto : runtimeDTO.providers) {
             // get service reference
             final ServiceReference<ResourceProvider<?>> ref = this.getServiceReference(dto.serviceId);
             final StringBuilder sb = new StringBuilder();
-            if ( dto.name != null ) {
+            if (dto.name != null) {
                 sb.append(dto.name);
                 sb.append(' ');
             } else {
                 sb.append("<unnamed> ");
             }
-            if ( ref != null ) {
+            if (ref != null) {
                 sb.append("(serviceId = ");
                 sb.append(dto.serviceId);
                 sb.append(", bundleId = ");
@@ -556,21 +539,21 @@ public class ResourceResolverWebConsolePlugin extends HttpServlet {
             pw.printf(format, sb.toString(), dto.path, config.toString());
         }
         pw.println();
-        if ( runtimeDTO.failedProviders.length > 0 ) {
+        if (runtimeDTO.failedProviders.length > 0) {
             pw.println("Failed Resource Providers");
             pw.printf(format, "Provider", "Path", "Reason");
 
-            for(final ResourceProviderFailureDTO dto : runtimeDTO.failedProviders) {
+            for (final ResourceProviderFailureDTO dto : runtimeDTO.failedProviders) {
                 // get service reference
                 final ServiceReference<ResourceProvider<?>> ref = this.getServiceReference(dto.serviceId);
                 final StringBuilder sb = new StringBuilder();
-                if ( dto.name != null ) {
+                if (dto.name != null) {
                     sb.append(dto.name);
                     sb.append(' ');
                 } else {
                     sb.append("<unnamed> ");
                 }
-                if ( ref != null ) {
+                if (ref != null) {
                     sb.append("(serviceId = ");
                     sb.append(dto.serviceId);
                     sb.append(", bundleId = ");
@@ -602,8 +585,7 @@ public class ResourceResolverWebConsolePlugin extends HttpServlet {
 
         private final URI uri;
 
-        public ResolverRequest(HttpServletRequest request, String uriString)
-                throws URIException {
+        public ResolverRequest(HttpServletRequest request, String uriString) throws URIException {
             super(request);
             uri = new URI(uriString, false);
         }
@@ -636,5 +618,4 @@ public class ResourceResolverWebConsolePlugin extends HttpServlet {
             }
         }
     }
-
 }
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/helper/RedirectResource.java b/src/main/java/org/apache/sling/resourceresolver/impl/helper/RedirectResource.java
index 43c241b0..0a865343 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/helper/RedirectResource.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/helper/RedirectResource.java
@@ -30,7 +30,7 @@ import org.apache.sling.api.resource.SyntheticResource;
 import org.apache.sling.api.resource.ValueMap;
 import org.apache.sling.api.wrappers.ValueMapDecorator;
 
-@Adaptable(adaptableClass = Resource.class, adapters = @Adapter(value = { Map.class, ValueMap.class }))
+@Adaptable(adaptableClass = Resource.class, adapters = @Adapter(value = {Map.class, ValueMap.class}))
 public final class RedirectResource extends SyntheticResource {
 
     static final String RT_SLING_REDIRECT = "sling:redirect";
@@ -41,8 +41,7 @@ public final class RedirectResource extends SyntheticResource {
 
     private final Map<String, Object> values;
 
-    public RedirectResource(final ResourceResolver resolver, final String path,
-            final String target, final int status) {
+    public RedirectResource(final ResourceResolver resolver, final String path, final String target, final int status) {
         super(resolver, path, RT_SLING_REDIRECT);
 
         final Map<String, Object> props = new HashMap<String, Object>();
@@ -69,4 +68,4 @@ public final class RedirectResource extends SyntheticResource {
     public String toString() {
         return super.toString() + ", values=" + values;
     }
-}
\ No newline at end of file
+}
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourceDecoratorTracker.java b/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourceDecoratorTracker.java
index 6616bd58..3eea04a8 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourceDecoratorTracker.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourceDecoratorTracker.java
@@ -79,8 +79,8 @@ public class ResourceDecoratorTracker {
      * @param decorator The decorator
      * @param ref The service reference
      */
-    public void bindResourceDecorator(final ResourceDecorator decorator,
-            final ServiceReference<ResourceDecorator> ref) {
+    public void bindResourceDecorator(
+            final ResourceDecorator decorator, final ServiceReference<ResourceDecorator> ref) {
         synchronized (this.resourceDecorators) {
             this.resourceDecorators.add(new ResourceDecoratorEntry(decorator, ref));
             Collections.sort(this.resourceDecorators);
@@ -115,8 +115,7 @@ public class ResourceDecoratorTracker {
         if (this.resourceDecorators.size() > 0) {
             decorators = new ResourceDecorator[this.resourceDecorators.size()];
             int index = 0;
-            final Iterator<ResourceDecoratorEntry> i = this.resourceDecorators
-                    .iterator();
+            final Iterator<ResourceDecoratorEntry> i = this.resourceDecorators.iterator();
             while (i.hasNext()) {
                 decorators[index] = i.next().decorator;
                 index++;
@@ -130,8 +129,7 @@ public class ResourceDecoratorTracker {
     /**
      * Internal class to keep track of the resource decorators.
      */
-    private static final class ResourceDecoratorEntry implements
-            Comparable<ResourceDecoratorEntry> {
+    private static final class ResourceDecoratorEntry implements Comparable<ResourceDecoratorEntry> {
 
         final Comparable<Object> comparable;
 
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourceIteratorDecorator.java b/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourceIteratorDecorator.java
index 2611c949..64c8a607 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourceIteratorDecorator.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourceIteratorDecorator.java
@@ -31,8 +31,7 @@ public class ResourceIteratorDecorator implements Iterator<Resource> {
 
     private final Iterator<Resource> iterator;
 
-    public ResourceIteratorDecorator(final ResourceDecoratorTracker tracker,
-            final Iterator<Resource> iterator) {
+    public ResourceIteratorDecorator(final ResourceDecoratorTracker tracker, final Iterator<Resource> iterator) {
         this.tracker = tracker;
         this.iterator = iterator;
     }
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourcePathIterator.java b/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourcePathIterator.java
index 17482ebc..bf47a0a3 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourcePathIterator.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourcePathIterator.java
@@ -1,18 +1,20 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information 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
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * 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
  *
- *      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.
+ * 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.
  */
 package org.apache.sling.resourceresolver.impl.helper;
 
@@ -95,5 +97,4 @@ public class ResourcePathIterator implements Iterator<String> {
     public void remove() {
         throw new UnsupportedOperationException("remove");
     }
-
 }
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourceResolverContext.java b/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourceResolverContext.java
index 31b003a2..91778f33 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourceResolverContext.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourceResolverContext.java
@@ -1,27 +1,27 @@
 /*
  * 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.resourceresolver.impl.helper;
 
-import org.jetbrains.annotations.NotNull;
-
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.resourceresolver.impl.ResourceAccessSecurityTracker;
 import org.apache.sling.resourceresolver.impl.providers.stateful.ProviderManager;
+import org.jetbrains.annotations.NotNull;
 
 /**
  * The resource resolver context.
@@ -34,7 +34,8 @@ public class ResourceResolverContext {
 
     private final ProviderManager providerManager;
 
-    public ResourceResolverContext(@NotNull final ResourceResolver resolver, @NotNull final ResourceAccessSecurityTracker tracker) {
+    public ResourceResolverContext(
+            @NotNull final ResourceResolver resolver, @NotNull final ResourceAccessSecurityTracker tracker) {
         this.resolver = resolver;
         this.providerManager = new ProviderManager(resolver, tracker);
     }
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourceResolverControl.java b/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourceResolverControl.java
index 0c0eb62a..c025b892 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourceResolverControl.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourceResolverControl.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.resourceresolver.impl.helper;
 
@@ -45,9 +46,9 @@ import org.apache.sling.api.resource.SyntheticResource;
 import org.apache.sling.api.resource.ValueMap;
 import org.apache.sling.api.resource.path.PathBuilder;
 import org.apache.sling.resourceresolver.impl.providers.ResourceProviderHandler;
+import org.apache.sling.resourceresolver.impl.providers.ResourceProviderInfo.Mode;
 import org.apache.sling.resourceresolver.impl.providers.ResourceProviderStorage;
 import org.apache.sling.resourceresolver.impl.providers.ResourceProviderStorageProvider;
-import org.apache.sling.resourceresolver.impl.providers.ResourceProviderInfo.Mode;
 import org.apache.sling.resourceresolver.impl.providers.stateful.AuthenticatedResourceProvider;
 import org.apache.sling.resourceresolver.impl.providers.tree.Node;
 import org.apache.sling.resourceresolver.impl.providers.tree.PathTree;
@@ -72,9 +73,8 @@ public class ResourceResolverControl {
     private static final Logger logger = LoggerFactory.getLogger(ResourceResolverControl.class);
 
     private static final String[] FORBIDDEN_ATTRIBUTES = new String[] {
-            ResourceResolverFactory.PASSWORD,
-            ResourceProvider.AUTH_SERVICE_BUNDLE,
-            ResourceResolverFactory.SUBSERVICE};
+        ResourceResolverFactory.PASSWORD, ResourceProvider.AUTH_SERVICE_BUNDLE, ResourceResolverFactory.SUBSERVICE
+    };
 
     /** Is this a resource resolver for an admin? */
     private final boolean isAdmin;
@@ -98,7 +98,8 @@ public class ResourceResolverControl {
      * @param authenticationInfo The auth info
      * @param resourceProviderTracker Tracker for all providers
      */
-    public ResourceResolverControl(final boolean isAdmin,
+    public ResourceResolverControl(
+            final boolean isAdmin,
             final Map<String, Object> authenticationInfo,
             final ResourceProviderStorageProvider resourceProviderTracker) {
         this.authenticatedProviders = new IdentityHashMap<>();
@@ -135,15 +136,15 @@ public class ResourceResolverControl {
      * Logs out from all providers.
      */
     private void logout() {
-        for(final Map.Entry<ResourceProviderHandler, Object> entry : this.authenticatedProviders.entrySet()) {
+        for (final Map.Entry<ResourceProviderHandler, Object> entry : this.authenticatedProviders.entrySet()) {
             try {
                 final ResourceProvider<Object> rp = entry.getKey().getResourceProvider();
-                if ( rp != null ) {
+                if (rp != null) {
                     rp.logout(entry.getValue());
-                } else if ( entry.getValue() instanceof Closeable ) {
-                    ((Closeable)entry.getValue()).close();
+                } else if (entry.getValue() instanceof Closeable) {
+                    ((Closeable) entry.getValue()).close();
                 }
-            } catch ( final Throwable t ) {
+            } catch (final Throwable t) {
                 // we ignore everything from there to not stop this thread
             }
         }
@@ -155,7 +156,8 @@ public class ResourceResolverControl {
      * @param context The context
      */
     public void refresh(@NotNull final ResourceResolverContext context) {
-        for (final AuthenticatedResourceProvider p : context.getProviderManager().getAllUsedRefreshable()) {
+        for (final AuthenticatedResourceProvider p :
+                context.getProviderManager().getAllUsedRefreshable()) {
             p.refresh();
         }
         if (this.resourceTypeResourceResolver != null) {
@@ -169,7 +171,8 @@ public class ResourceResolverControl {
      * @return {@code true} if all providers are live
      */
     public boolean isLive(@NotNull final ResourceResolverContext context) {
-        for (final AuthenticatedResourceProvider p : context.getProviderManager().getAllAuthenticated()) {
+        for (final AuthenticatedResourceProvider p :
+                context.getProviderManager().getAllAuthenticated()) {
             if (!p.isLive()) {
                 return false;
             }
@@ -189,12 +192,15 @@ public class ResourceResolverControl {
      * @param child The child resource
      * @return The parent or {@code null}
      */
-    public Resource getParent(@NotNull final ResourceResolverContext context, @NotNull final String parentPath, @NotNull final Resource child) {
+    public Resource getParent(
+            @NotNull final ResourceResolverContext context,
+            @NotNull final String parentPath,
+            @NotNull final Resource child) {
         final AuthenticatedResourceProvider childProvider = getBestMatchingProvider(context, child.getPath());
         final AuthenticatedResourceProvider parentProvider = getBestMatchingProvider(context, parentPath);
-        if ( parentProvider != null ) {
+        if (parentProvider != null) {
             final Resource parentCandidate;
-            if ( childProvider == parentProvider ) {
+            if (childProvider == parentProvider) {
                 parentCandidate = parentProvider.getParent(child);
             } else {
                 parentCandidate = parentProvider.getResource(parentPath, null, null);
@@ -205,7 +211,8 @@ public class ResourceResolverControl {
         }
 
         if (isIntermediatePath(parentPath)) {
-            return new SyntheticResource(context.getResourceResolver(), parentPath, ResourceProvider.RESOURCE_TYPE_SYNTHETIC);
+            return new SyntheticResource(
+                    context.getResourceResolver(), parentPath, ResourceProvider.RESOURCE_TYPE_SYNTHETIC);
         }
         return null;
     }
@@ -232,8 +239,11 @@ public class ResourceResolverControl {
      * @param isResolve Whether this is a resolve or get call
      * @return The resource or {@code null}
      */
-    public Resource getResource(final ResourceResolverContext context,
-            String path, Resource parent, Map<String, String> parameters,
+    public Resource getResource(
+            final ResourceResolverContext context,
+            String path,
+            Resource parent,
+            Map<String, String> parameters,
             boolean isResolve) {
         if (path == null || path.length() == 0 || path.charAt(0) != '/') {
             logger.debug("Not absolute {}", path);
@@ -241,7 +251,7 @@ public class ResourceResolverControl {
         }
 
         final AuthenticatedResourceProvider provider = this.getBestMatchingProvider(context, path);
-        if ( provider != null ) {
+        if (provider != null) {
             final Resource resourceCandidate = provider.getResource(path, parent, parameters);
             if (resourceCandidate != null) {
                 return resourceCandidate;
@@ -293,10 +303,11 @@ public class ResourceResolverControl {
         // children of the 'parent' provider
         Iterator<Resource> realChildren = null;
         final AuthenticatedResourceProvider provider = this.getBestMatchingProvider(context, parentPath);
-        if ( provider != null ) {
+        if (provider != null) {
             realChildren = provider.listChildren(parent);
         }
-        return listChildrenInternal(context, getResourceProviderStorage().getTree().getNode(parentPath), parent, realChildren);
+        return listChildrenInternal(
+                context, getResourceProviderStorage().getTree().getNode(parentPath), parent, realChildren);
     }
 
     /**
@@ -308,11 +319,12 @@ public class ResourceResolverControl {
      * @return The children
      */
     @SuppressWarnings("unchecked")
-    public Iterator<Resource> listChildrenInternal(final ResourceResolverContext context, 
-        final Node<ResourceProviderHandler> node,
-        final Resource parent,
-        final Iterator<Resource> realChildren) {
-        
+    public Iterator<Resource> listChildrenInternal(
+            final ResourceResolverContext context,
+            final Node<ResourceProviderHandler> node,
+            final Resource parent,
+            final Iterator<Resource> realChildren) {
+
         final Set<String> visitedNames = new HashSet<>();
 
         IteratorChain<Resource> chain = new IteratorChain<>();
@@ -322,48 +334,54 @@ public class ResourceResolverControl {
             final List<Resource> syntheticList = new ArrayList<>();
             final List<Resource> providerList = new ArrayList<>();
 
-            for (final Entry<String, Node<ResourceProviderHandler>> entry : node.getChildren().entrySet()) {
+            for (final Entry<String, Node<ResourceProviderHandler>> entry :
+                    node.getChildren().entrySet()) {
                 final String name = entry.getKey();
                 final ResourceProviderHandler handler = entry.getValue().getValue();
                 PathBuilder pathBuilder = new PathBuilder(parent.getPath());
                 pathBuilder.append(name);
                 final String childPath = pathBuilder.toString();
                 if (handler == null) {
-                    syntheticList.add(new SyntheticResource(context.getResourceResolver(), childPath, ResourceProvider.RESOURCE_TYPE_SYNTHETIC));
+                    syntheticList.add(new SyntheticResource(
+                            context.getResourceResolver(), childPath, ResourceProvider.RESOURCE_TYPE_SYNTHETIC));
                 } else {
                     Resource rsrc = null;
                     try {
-                        final AuthenticatedResourceProvider rp = context.getProviderManager().getOrCreateProvider(handler, this);
+                        final AuthenticatedResourceProvider rp =
+                                context.getProviderManager().getOrCreateProvider(handler, this);
                         rsrc = rp == null ? null : rp.getResource(childPath, parent, null);
-                    } catch ( final LoginException ignore) {
+                    } catch (final LoginException ignore) {
                         // ignore
                     }
-                    if ( rsrc != null ) {
+                    if (rsrc != null) {
                         providerList.add(rsrc);
                     } else {
                         // if there is a child provider underneath, we need to create a synthetic resource
                         // otherwise we need to make sure that no one else is providing this child
-                        if ( !entry.getValue().getChildren().isEmpty() ) {
-                            syntheticList.add(new SyntheticResource(context.getResourceResolver(), childPath, ResourceProvider.RESOURCE_TYPE_SYNTHETIC));
+                        if (!entry.getValue().getChildren().isEmpty()) {
+                            syntheticList.add(new SyntheticResource(
+                                    context.getResourceResolver(),
+                                    childPath,
+                                    ResourceProvider.RESOURCE_TYPE_SYNTHETIC));
                         } else {
                             visitedNames.add(name);
                         }
                     }
                 }
             }
-            if ( !providerList.isEmpty() ) {
+            if (!providerList.isEmpty()) {
                 chain.addIterator(providerList.iterator());
             }
-            if ( realChildren != null ) {
+            if (realChildren != null) {
                 chain.addIterator(realChildren);
             }
-            if ( !syntheticList.isEmpty() ) {
+            if (!syntheticList.isEmpty()) {
                 chain.addIterator(syntheticList.iterator());
             }
-        } else if ( realChildren != null ) {
+        } else if (realChildren != null) {
             chain.addIterator(realChildren);
         }
-        if ( chain.size() == 0 ) {
+        if (chain.size() == 0) {
             return Collections.EMPTY_LIST.iterator();
         }
         return new UniqueResourceIterator(visitedNames, chain);
@@ -376,13 +394,14 @@ public class ResourceResolverControl {
      */
     public Collection<String> getAttributeNames(final ResourceResolverContext context) {
         final Set<String> names = new LinkedHashSet<>();
-        for (final AuthenticatedResourceProvider p : context.getProviderManager().getAllBestEffort(getResourceProviderStorage().getAttributableHandlers(), this)) {
+        for (final AuthenticatedResourceProvider p : context.getProviderManager()
+                .getAllBestEffort(getResourceProviderStorage().getAttributableHandlers(), this)) {
             p.getAttributeNames(names);
         }
-        if ( this.authenticationInfo != null ) {
+        if (this.authenticationInfo != null) {
             names.addAll(authenticationInfo.keySet());
         }
-        for(final String key : FORBIDDEN_ATTRIBUTES) {
+        for (final String key : FORBIDDEN_ATTRIBUTES) {
             names.remove(key);
         }
         return names;
@@ -397,18 +416,19 @@ public class ResourceResolverControl {
      * @return Attribute value or {@code null}
      */
     public Object getAttribute(final ResourceResolverContext context, final String name) {
-        for(final String key : FORBIDDEN_ATTRIBUTES) {
+        for (final String key : FORBIDDEN_ATTRIBUTES) {
             if (key.equals(name)) {
                 return null;
             }
         }
-        for (final AuthenticatedResourceProvider p : context.getProviderManager().getAllBestEffort(getResourceProviderStorage().getAttributableHandlers(), this)) {
+        for (final AuthenticatedResourceProvider p : context.getProviderManager()
+                .getAllBestEffort(getResourceProviderStorage().getAttributableHandlers(), this)) {
             final Object attribute = p.getAttribute(name);
             if (attribute != null) {
                 return attribute;
             }
         }
-        return this.authenticationInfo != null ? this.authenticationInfo.get(name) :null;
+        return this.authenticationInfo != null ? this.authenticationInfo.get(name) : null;
     }
 
     /**
@@ -423,17 +443,18 @@ public class ResourceResolverControl {
      * @throws PersistenceException
      *             If creation fails
      */
-    public Resource create(final ResourceResolverContext context,
-            final String path, final Map<String, Object> properties)
-                    throws PersistenceException {
+    public Resource create(
+            final ResourceResolverContext context, final String path, final Map<String, Object> properties)
+            throws PersistenceException {
         final AuthenticatedResourceProvider provider = getBestMatchingModifiableProvider(context, path);
-        if ( provider != null ) {
+        if (provider != null) {
             final Resource creationResultResource = provider.create(context.getResourceResolver(), path, properties);
             if (creationResultResource != null) {
                 return creationResultResource;
             }
         }
-        throw new UnsupportedOperationException("create '" + ResourceUtil.getName(path) + "' at " + ResourceUtil.getParent(path));
+        throw new UnsupportedOperationException(
+                "create '" + ResourceUtil.getName(path) + "' at " + ResourceUtil.getParent(path));
     }
 
     /**
@@ -448,25 +469,36 @@ public class ResourceResolverControl {
      * @throws IllegalArgumentException If input parameters are wrong
      * @see ResourceResolver#orderBefore(Resource, String, String)
      */
-    public boolean orderBefore(@NotNull final ResourceResolverContext context,  @NotNull final Resource parent, @NotNull final String name, @Nullable final String followingSiblingName)
+    public boolean orderBefore(
+            @NotNull final ResourceResolverContext context,
+            @NotNull final Resource parent,
+            @NotNull final String name,
+            @Nullable final String followingSiblingName)
             throws UnsupportedOperationException, PersistenceException, IllegalArgumentException {
         final AuthenticatedResourceProvider provider = getBestMatchingModifiableProvider(context, parent.getPath());
         if (provider != null) {
             // make sure all children are from the same provider and both names are valid
-            AuthenticatedResourceProvider childProvider = getBestMatchingModifiableProvider(context, createDescendantPath(parent.getPath(), name));
+            AuthenticatedResourceProvider childProvider =
+                    getBestMatchingModifiableProvider(context, createDescendantPath(parent.getPath(), name));
             if (childProvider == null) {
-                throw new IllegalArgumentException("The given name '" + name + "' is not a valid child name in resource " + parent.getPath());
+                throw new IllegalArgumentException(
+                        "The given name '" + name + "' is not a valid child name in resource " + parent.getPath());
             }
             if (provider != childProvider) {
-                throw new UnsupportedOperationException("orderBefore '" + name + "' at " + parent.getPath() + " not supported as children are not provided by the same provider as the parent resource");
+                throw new UnsupportedOperationException("orderBefore '" + name + "' at " + parent.getPath()
+                        + " not supported as children are not provided by the same provider as the parent resource");
             }
             if (followingSiblingName != null) {
-                childProvider = getBestMatchingModifiableProvider(context, createDescendantPath(parent.getPath(), followingSiblingName));
+                childProvider = getBestMatchingModifiableProvider(
+                        context, createDescendantPath(parent.getPath(), followingSiblingName));
                 if (childProvider == null) {
-                    throw new IllegalArgumentException("The given name '" + followingSiblingName + "' is not a valid child name in resource " + parent.getPath());
+                    throw new IllegalArgumentException("The given name '" + followingSiblingName
+                            + "' is not a valid child name in resource " + parent.getPath());
                 }
                 if (provider != childProvider) {
-                    throw new UnsupportedOperationException("orderBefore '" + name + "', '" + followingSiblingName + "' at " + parent.getPath() + " not supported as sibling child resources are not provided by the same provider");
+                    throw new UnsupportedOperationException(
+                            "orderBefore '" + name + "', '" + followingSiblingName + "' at " + parent.getPath()
+                                    + " not supported as sibling child resources are not provided by the same provider");
                 }
             }
             return provider.orderBefore(parent, name, followingSiblingName);
@@ -504,7 +536,7 @@ public class ResourceResolverControl {
     public void delete(final ResourceResolverContext context, final Resource resource) throws PersistenceException {
         final String path = resource.getPath();
         final AuthenticatedResourceProvider provider = getBestMatchingModifiableProvider(context, path);
-        if ( provider != null ) {
+        if (provider != null) {
             provider.delete(resource);
             return;
         }
@@ -516,7 +548,8 @@ public class ResourceResolverControl {
      * @param context The context
      */
     public void revert(final ResourceResolverContext context) {
-        for (final AuthenticatedResourceProvider p : context.getProviderManager().getAllUsedModifiable()) {
+        for (final AuthenticatedResourceProvider p :
+                context.getProviderManager().getAllUsedModifiable()) {
             p.revert();
         }
     }
@@ -527,7 +560,8 @@ public class ResourceResolverControl {
      * @throws PersistenceException If operation fails
      */
     public void commit(final ResourceResolverContext context) throws PersistenceException {
-        for (final AuthenticatedResourceProvider p : context.getProviderManager().getAllUsedModifiable()) {
+        for (final AuthenticatedResourceProvider p :
+                context.getProviderManager().getAllUsedModifiable()) {
             p.commit();
         }
     }
@@ -538,7 +572,8 @@ public class ResourceResolverControl {
      * @return {@code true} if there are uncommited changes
      */
     public boolean hasChanges(final ResourceResolverContext context) {
-        for (final AuthenticatedResourceProvider p : context.getProviderManager().getAllUsedModifiable()) {
+        for (final AuthenticatedResourceProvider p :
+                context.getProviderManager().getAllUsedModifiable()) {
             if (p.hasChanges()) {
                 return true;
             }
@@ -553,7 +588,8 @@ public class ResourceResolverControl {
      */
     public String[] getSupportedLanguages(final ResourceResolverContext context) {
         final Set<String> supportedLanguages = new LinkedHashSet<>();
-        for (AuthenticatedResourceProvider p : context.getProviderManager().getAllBestEffort(getResourceProviderStorage().getLanguageQueryableHandlers(), this)) {
+        for (AuthenticatedResourceProvider p : context.getProviderManager()
+                .getAllBestEffort(getResourceProviderStorage().getLanguageQueryableHandlers(), this)) {
             supportedLanguages.addAll(Arrays.asList(p.getSupportedLanguages()));
         }
         return supportedLanguages.toArray(new String[supportedLanguages.size()]);
@@ -566,8 +602,8 @@ public class ResourceResolverControl {
      * @param language The language
      * @return The result
      */
-    public Iterator<Resource> findResources(final ResourceResolverContext context,
-            final String query, final String language) {
+    public Iterator<Resource> findResources(
+            final ResourceResolverContext context, final String query, final String language) {
         final List<AuthenticatedResourceProvider> queryableRP = getQueryableProviders(context, language);
         final List<Iterator<Resource>> iterators = new ArrayList<>(queryableRP.size());
         for (AuthenticatedResourceProvider p : queryableRP) {
@@ -577,10 +613,10 @@ public class ResourceResolverControl {
     }
 
     private List<AuthenticatedResourceProvider> getQueryableProviders(
-            final ResourceResolverContext context,
-            final String language) {
+            final ResourceResolverContext context, final String language) {
         final List<AuthenticatedResourceProvider> queryableProviders = new ArrayList<>();
-        for (final AuthenticatedResourceProvider p : context.getProviderManager().getAllBestEffort(getResourceProviderStorage().getLanguageQueryableHandlers(), this)) {
+        for (final AuthenticatedResourceProvider p : context.getProviderManager()
+                .getAllBestEffort(getResourceProviderStorage().getLanguageQueryableHandlers(), this)) {
             if (ArrayUtils.contains(p.getSupportedLanguages(), language)) {
                 queryableProviders.add(p);
             }
@@ -595,8 +631,8 @@ public class ResourceResolverControl {
      * @param language The language
      * @return The result
      */
-    public Iterator<Map<String, Object>> queryResources(final ResourceResolverContext context,
-            final String query, final String language) {
+    public Iterator<Map<String, Object>> queryResources(
+            final ResourceResolverContext context, final String query, final String language) {
         final List<AuthenticatedResourceProvider> queryableRP = getQueryableProviders(context, language);
         final List<Iterator<Map<String, Object>>> iterators = new ArrayList<>(queryableRP.size());
         for (AuthenticatedResourceProvider p : queryableRP) {
@@ -615,7 +651,8 @@ public class ResourceResolverControl {
      */
     @SuppressWarnings("unchecked")
     public <AdapterType> AdapterType adaptTo(final ResourceResolverContext context, Class<AdapterType> type) {
-        for (AuthenticatedResourceProvider p : context.getProviderManager().getAllBestEffort(getResourceProviderStorage().getAdaptableHandlers(), this)) {
+        for (AuthenticatedResourceProvider p : context.getProviderManager()
+                .getAllBestEffort(getResourceProviderStorage().getAdaptableHandlers(), this)) {
             final Object adaptee = p.adaptTo(type);
             if (adaptee != null) {
                 return (AdapterType) adaptee;
@@ -624,9 +661,10 @@ public class ResourceResolverControl {
         return null;
     }
 
-    private AuthenticatedResourceProvider checkExistence(final ResourceResolverContext context, final String path,
-            final String type) throws PersistenceException {
-        final Node<ResourceProviderHandler> node = getResourceProviderStorage().getTree().getBestMatchingNode(path);
+    private AuthenticatedResourceProvider checkExistence(
+            final ResourceResolverContext context, final String path, final String type) throws PersistenceException {
+        final Node<ResourceProviderHandler> node =
+                getResourceProviderStorage().getTree().getBestMatchingNode(path);
         if (node == null) {
             throw new PersistenceException(type.concat(" resource does not exist."), null, path, null);
         }
@@ -654,8 +692,9 @@ public class ResourceResolverControl {
      * @return The responsible provider or {@code null}
      * @throws PersistenceException If something goes wrong
      */
-    public AuthenticatedResourceProvider checkSourceAndDest(final ResourceResolverContext context,
-            final String srcAbsPath, final String destAbsPath) throws PersistenceException {
+    public AuthenticatedResourceProvider checkSourceAndDest(
+            final ResourceResolverContext context, final String srcAbsPath, final String destAbsPath)
+            throws PersistenceException {
         // check source
         final AuthenticatedResourceProvider srcProvider = checkExistence(context, srcAbsPath, "Source");
         // check destination
@@ -663,7 +702,8 @@ public class ResourceResolverControl {
 
         // check for sub providers of src and dest
         if (srcProvider == destProvider) {
-            final PathTree<ResourceProviderHandler> providerTree = getResourceProviderStorage().getTree();
+            final PathTree<ResourceProviderHandler> providerTree =
+                    getResourceProviderStorage().getTree();
             final boolean sourceHasProvider = hasSubProvider(context, providerTree.getNode(srcAbsPath));
             final boolean destHasProvider = hasSubProvider(context, providerTree.getNode(destAbsPath));
             if (!(sourceHasProvider || destHasProvider)) {
@@ -675,7 +715,8 @@ public class ResourceResolverControl {
 
     private boolean hasSubProvider(ResourceResolverContext context, Node<ResourceProviderHandler> node) {
         if (node != null) {
-            for (final Node<ResourceProviderHandler> childNode : node.getChildren().values()) {
+            for (final Node<ResourceProviderHandler> childNode :
+                    node.getChildren().values()) {
                 final ResourceProviderHandler handler = childNode.getValue();
                 if (handler != null) {
                     try {
@@ -694,11 +735,16 @@ public class ResourceResolverControl {
         return false;
     }
 
-    private void copy(final ResourceResolverContext context, final Resource src, final String dstPath, final List<Resource> newNodes) throws PersistenceException {
+    private void copy(
+            final ResourceResolverContext context,
+            final Resource src,
+            final String dstPath,
+            final List<Resource> newNodes)
+            throws PersistenceException {
         final ValueMap vm = src.getValueMap();
         final String createPath = new PathBuilder(dstPath).append(src.getName()).toString();
         newNodes.add(this.create(context, createPath, vm));
-        for(final Resource c : src.getChildren()) {
+        for (final Resource c : src.getChildren()) {
             copy(context, c, createPath, newNodes);
         }
     }
@@ -713,10 +759,11 @@ public class ResourceResolverControl {
      * @return The copied resources
      * @throws PersistenceException if operation fails
      */
-    public Resource copy(final ResourceResolverContext context,
-            final String srcAbsPath, final String destAbsPath) throws PersistenceException {
-        final AuthenticatedResourceProvider optimizedSourceProvider = checkSourceAndDest(context, srcAbsPath, destAbsPath);
-        if ( optimizedSourceProvider != null && optimizedSourceProvider.copy(srcAbsPath, destAbsPath) ) {
+    public Resource copy(final ResourceResolverContext context, final String srcAbsPath, final String destAbsPath)
+            throws PersistenceException {
+        final AuthenticatedResourceProvider optimizedSourceProvider =
+                checkSourceAndDest(context, srcAbsPath, destAbsPath);
+        if (optimizedSourceProvider != null && optimizedSourceProvider.copy(srcAbsPath, destAbsPath)) {
             return this.getResource(context, destAbsPath + '/' + ResourceUtil.getName(srcAbsPath), null, null, false);
         }
 
@@ -728,8 +775,8 @@ public class ResourceResolverControl {
             rollback = false;
             return newResources.get(0);
         } finally {
-            if ( rollback ) {
-                for(final Resource rsrc : newResources) {
+            if (rollback) {
+                for (final Resource rsrc : newResources) {
                     this.delete(context, rsrc);
                 }
             }
@@ -746,10 +793,11 @@ public class ResourceResolverControl {
      * @return The moved resource
      * @throws PersistenceException if operation fails
      */
-    public Resource move(final ResourceResolverContext context,
-            String srcAbsPath, String destAbsPath) throws PersistenceException {
-        final AuthenticatedResourceProvider optimizedSourceProvider = checkSourceAndDest(context, srcAbsPath, destAbsPath);
-        if ( optimizedSourceProvider != null && optimizedSourceProvider.move(srcAbsPath, destAbsPath) ) {
+    public Resource move(final ResourceResolverContext context, String srcAbsPath, String destAbsPath)
+            throws PersistenceException {
+        final AuthenticatedResourceProvider optimizedSourceProvider =
+                checkSourceAndDest(context, srcAbsPath, destAbsPath);
+        if (optimizedSourceProvider != null && optimizedSourceProvider.move(srcAbsPath, destAbsPath)) {
             return this.getResource(context, destAbsPath + '/' + ResourceUtil.getName(srcAbsPath), null, null, false);
         }
         final Resource srcResource = this.getResource(context, srcAbsPath, null, null, false);
@@ -761,8 +809,8 @@ public class ResourceResolverControl {
             rollback = false;
             return newResources.get(0);
         } finally {
-            if ( rollback ) {
-                for(final Resource rsrc : newResources) {
+            if (rollback) {
+                for (final Resource rsrc : newResources) {
                     this.delete(context, rsrc);
                 }
             }
@@ -783,12 +831,15 @@ public class ResourceResolverControl {
      * @param path The path
      * @return The best matching provider or {@code null}
      */
-    private @Nullable AuthenticatedResourceProvider getBestMatchingProvider(final ResourceResolverContext context,
-            final String path) {
+    private @Nullable AuthenticatedResourceProvider getBestMatchingProvider(
+            final ResourceResolverContext context, final String path) {
         try {
-            final Node<ResourceProviderHandler> node = resourceProviderTracker.getResourceProviderStorage().getTree().getBestMatchingNode(path);
+            final Node<ResourceProviderHandler> node = resourceProviderTracker
+                    .getResourceProviderStorage()
+                    .getTree()
+                    .getBestMatchingNode(path);
             return node == null ? null : context.getProviderManager().getOrCreateProvider(node.getValue(), this);
-        } catch ( final LoginException le ) {
+        } catch (final LoginException le) {
             // ignore
             return null;
         }
@@ -800,40 +851,42 @@ public class ResourceResolverControl {
      * @param path The path
      * @return The modifiable provider or {@code null}
      */
-    @Nullable AuthenticatedResourceProvider getBestMatchingModifiableProvider(
-            final ResourceResolverContext context,
-            final String path)  {
+    @Nullable
+    AuthenticatedResourceProvider getBestMatchingModifiableProvider(
+            final ResourceResolverContext context, final String path) {
         String resourcePath = path;
         do {
-            final Node<ResourceProviderHandler> node = resourceProviderTracker.getResourceProviderStorage().getTree().getBestMatchingNode(resourcePath);
-            if ( node.getValue().getInfo().isModifiable() ) {
+            final Node<ResourceProviderHandler> node = resourceProviderTracker
+                    .getResourceProviderStorage()
+                    .getTree()
+                    .getBestMatchingNode(resourcePath);
+            if (node.getValue().getInfo().isModifiable()) {
                 try {
                     return context.getProviderManager().getOrCreateProvider(node.getValue(), this);
-                } catch ( final LoginException le ) {
+                } catch (final LoginException le) {
                     // ignore
                     return null;
-                }    
+                }
             }
-            if ( node.getValue().getInfo().getMode() == Mode.PASSTHROUGH ) {
+            if (node.getValue().getInfo().getMode() == Mode.PASSTHROUGH) {
                 resourcePath = ResourceUtil.getParent(resourcePath);
             } else {
                 resourcePath = null;
             }
-        } while ( resourcePath != null );
+        } while (resourcePath != null);
         return null;
     }
 
-
     /**
      * Close all dynamic resource providers.
      */
     public void close() {
         if (this.isClosed.compareAndSet(false, true)) {
             this.logout();
-            if ( this.resourceTypeResourceResolver != null ) {
+            if (this.resourceTypeResourceResolver != null) {
                 try {
                     this.resourceTypeResourceResolver.close();
-                } catch ( final Throwable t) {
+                } catch (final Throwable t) {
                     // the resolver (or the underlying provider) might already be terminated (bundle stopped etc.)
                     // so we ignore anything from here
                 }
@@ -843,12 +896,11 @@ public class ResourceResolverControl {
     }
 
     private ResourceResolver getResourceTypeResourceResolver(
-            final ResourceResolverFactory factory,
-            final ResourceResolver resolver) {
-        if ( this.isAdmin ) {
+            final ResourceResolverFactory factory, final ResourceResolver resolver) {
+        if (this.isAdmin) {
             return resolver;
         } else {
-            if ( this.resourceTypeResourceResolver == null ) {
+            if (this.resourceTypeResourceResolver == null) {
                 try {
                     // make sure we're getting the resourceTypeResourceResolver on behalf of
                     // the resourceresolver bundle
@@ -875,17 +927,15 @@ public class ResourceResolverControl {
      * @see org.apache.sling.api.resource.ResourceResolver#getParentResourceType(java.lang.String)
      */
     public String getParentResourceType(
-            final ResourceResolverFactory factory,
-            final ResourceResolver resolver,
-            final String resourceType) {
+            final ResourceResolverFactory factory, final ResourceResolver resolver, final String resourceType) {
         // normalize resource type to a path string
         final String rtPath = (resourceType == null ? null : ResourceUtil.resourceTypeToPath(resourceType));
         // get the resource type resource and check its super type
         String resourceSuperType = null;
 
-        if ( rtPath != null ) {
+        if (rtPath != null) {
             ResourceResolver adminResolver = this.getResourceTypeResourceResolver(factory, resolver);
-            if ( adminResolver != null ) {
+            if (adminResolver != null) {
                 final Resource rtResource = adminResolver.getResource(rtPath);
                 if (rtResource != null) {
                     resourceSuperType = rtResource.getResourceSuperType();
@@ -955,8 +1005,8 @@ public class ResourceResolverControl {
      * @param handler The handler
      * @param providerState The state
      */
-    public void registerAuthenticatedProvider(@NotNull ResourceProviderHandler handler,
-            @Nullable Object providerState) {
+    public void registerAuthenticatedProvider(
+            @NotNull ResourceProviderHandler handler, @Nullable Object providerState) {
         this.authenticatedProviders.put(handler, providerState);
     }
 
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/helper/StarResource.java b/src/main/java/org/apache/sling/resourceresolver/impl/helper/StarResource.java
index 9b1c0297..276ae4ba 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/helper/StarResource.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/helper/StarResource.java
@@ -30,11 +30,11 @@ import org.apache.sling.api.resource.SyntheticResource;
  * Used to provide the equivalent of an empty Node for GET requests to
  * *.something (SLING-344)
  */
-@Adaptable(adaptableClass = Resource.class, adapters = @Adapter(value = { String.class }))
+@Adaptable(adaptableClass = Resource.class, adapters = @Adapter(value = {String.class}))
 public class StarResource extends SyntheticResource {
 
-    final static String SLASH_STAR = "/*";
-    public final static String DEFAULT_RESOURCE_TYPE = "sling:syntheticStarResource";
+    static final String SLASH_STAR = "/*";
+    public static final String DEFAULT_RESOURCE_TYPE = "sling:syntheticStarResource";
 
     private static final String UNSET_RESOURCE_SUPER_TYPE = "<unset>";
 
@@ -50,7 +50,7 @@ public class StarResource extends SyntheticResource {
     /**
      * True if a StarResource should be used for the given request, if a real
      * Resource was not found
-     * @param path the path 
+     * @param path the path
      * @return true if the StarResource should be used, false otherwise
      */
     public static boolean appliesTo(String path) {
@@ -68,8 +68,7 @@ public class StarResource extends SyntheticResource {
     }
 
     public StarResource(ResourceResolver resourceResolver, String path) {
-        super(resourceResolver, getResourceMetadata(path),
-                DEFAULT_RESOURCE_TYPE);
+        super(resourceResolver, getResourceMetadata(path), DEFAULT_RESOURCE_TYPE);
         resourceSuperType = UNSET_RESOURCE_SUPER_TYPE;
     }
 
@@ -98,7 +97,7 @@ public class StarResource extends SyntheticResource {
         return super.adaptTo(type);
     }
 
-    /** Get our ResourceMetadata for given path 
+    /** Get our ResourceMetadata for given path
      * @path the path
      * @return the resource metadata for the given path
      * */
@@ -109,11 +108,10 @@ public class StarResource extends SyntheticResource {
         final int index = path.indexOf(SLASH_STAR);
         if (index >= 0) {
             result.setResolutionPath(path.substring(0, index) + SLASH_STAR);
-            result.setResolutionPathInfo(path.substring(index
-                    + SLASH_STAR.length()));
+            result.setResolutionPathInfo(path.substring(index + SLASH_STAR.length()));
         } else {
             result.setResolutionPath(path);
         }
         return result;
     }
-}
\ No newline at end of file
+}
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/helper/URI.java b/src/main/java/org/apache/sling/resourceresolver/impl/helper/URI.java
index 2df7eb20..f9c81020 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/helper/URI.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/helper/URI.java
@@ -130,8 +130,7 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
     // ----------------------------------------------------------- Constructors
 
     /** Create an instance as an internal use */
-    protected URI() {
-    }
+    protected URI() {}
 
     /**
      * Construct a URI from a string with the given charset. The input string
@@ -146,8 +145,7 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
      * @see #getProtocolCharset
      * @since 3.0
      */
-    public URI(String s, boolean escaped, String charset) throws URIException,
-            NullPointerException {
+    public URI(String s, boolean escaped, String charset) throws URIException, NullPointerException {
         protocolCharset = charset;
         parseUriReference(s, escaped);
     }
@@ -164,8 +162,7 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
      * @see #getProtocolCharset
      * @since 3.0
      */
-    public URI(String s, boolean escaped) throws URIException,
-            NullPointerException {
+    public URI(String s, boolean escaped) throws URIException, NullPointerException {
         parseUriReference(s, escaped);
     }
 
@@ -191,8 +188,7 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
      * @throws URIException If the URI cannot be created.
      * @see #getDefaultProtocolCharset
      */
-    public URI(String scheme, String schemeSpecificPart, String fragment)
-            throws URIException {
+    public URI(String scheme, String schemeSpecificPart, String fragment) throws URIException {
 
         // validate and contruct the URI character sequence
         if (scheme == null) {
@@ -204,8 +200,7 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
         } else {
             throw new URIException(URIException.PARSING, "incorrect scheme");
         }
-        _opaque = encode(schemeSpecificPart, allowed_opaque_part,
-            getProtocolCharset());
+        _opaque = encode(schemeSpecificPart, allowed_opaque_part, getProtocolCharset());
         // Set flag
         _is_opaque_part = true;
         _fragment = fragment == null ? null : fragment.toCharArray();
@@ -238,8 +233,7 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
      * @throws URIException If the new URI cannot be created.
      * @see #getDefaultProtocolCharset
      */
-    public URI(String scheme, String authority, String path, String query,
-            String fragment) throws URIException {
+    public URI(String scheme, String authority, String path, String query, String fragment) throws URIException {
 
         // validate and contruct the URI character sequence
         StringBuilder buff = new StringBuilder();
@@ -253,8 +247,7 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
         }
         if (path != null) { // accept empty path
             if ((scheme != null || authority != null) && !path.startsWith("/")) {
-                throw new URIException(URIException.PARSING,
-                    "abs_path requested");
+                throw new URIException(URIException.PARSING, "abs_path requested");
             }
             buff.append(path);
         }
@@ -279,8 +272,7 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
      * @throws URIException If the new URI cannot be created.
      * @see #getDefaultProtocolCharset
      */
-    public URI(String scheme, String userinfo, String host, int port)
-            throws URIException {
+    public URI(String scheme, String userinfo, String host, int port) throws URIException {
 
         this(scheme, userinfo, host, port, null, null, null);
     }
@@ -296,8 +288,7 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
      * @throws URIException If the new URI cannot be created.
      * @see #getDefaultProtocolCharset
      */
-    public URI(String scheme, String userinfo, String host, int port,
-            String path) throws URIException {
+    public URI(String scheme, String userinfo, String host, int port, String path) throws URIException {
 
         this(scheme, userinfo, host, port, path, null, null);
     }
@@ -314,8 +305,7 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
      * @throws URIException If the new URI cannot be created.
      * @see #getDefaultProtocolCharset
      */
-    public URI(String scheme, String userinfo, String host, int port,
-            String path, String query) throws URIException {
+    public URI(String scheme, String userinfo, String host, int port, String path, String query) throws URIException {
 
         this(scheme, userinfo, host, port, path, query, null);
     }
@@ -333,13 +323,17 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
      * @throws URIException If the new URI cannot be created.
      * @see #getDefaultProtocolCharset
      */
-    public URI(String scheme, String userinfo, String host, int port,
-            String path, String query, String fragment) throws URIException {
+    public URI(String scheme, String userinfo, String host, int port, String path, String query, String fragment)
+            throws URIException {
 
-        this(scheme, (host == null) ? null : ((userinfo != null)
-                ? userinfo + '@'
-                : "")
-            + host + ((port != -1) ? ":" + port : ""), path, query, fragment);
+        this(
+                scheme,
+                (host == null)
+                        ? null
+                        : ((userinfo != null) ? userinfo + '@' : "") + host + ((port != -1) ? ":" + port : ""),
+                path,
+                query,
+                fragment);
     }
 
     /**
@@ -352,8 +346,7 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
      * @throws URIException If the new URI cannot be created.
      * @see #getDefaultProtocolCharset
      */
-    public URI(String scheme, String host, String path, String fragment)
-            throws URIException {
+    public URI(String scheme, String host, String path, String fragment) throws URIException {
 
         this(scheme, host, path, null, fragment);
     }
@@ -446,16 +439,14 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
         }
         if (base._is_opaque_part || relative._is_opaque_part) {
             this._scheme = base._scheme;
-            this._is_opaque_part = base._is_opaque_part
-                || relative._is_opaque_part;
+            this._is_opaque_part = base._is_opaque_part || relative._is_opaque_part;
             this._opaque = relative._opaque;
             this._fragment = relative._fragment;
             this.setURI();
             return;
         }
         boolean schemesEqual = Arrays.equals(base._scheme, relative._scheme);
-        if (relative._scheme != null
-            && (!schemesEqual || relative._authority != null)) {
+        if (relative._scheme != null && (!schemesEqual || relative._authority != null)) {
             this._scheme = relative._scheme;
             this._is_net_path = relative._is_net_path;
             this._authority = relative._authority;
@@ -498,10 +489,8 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
             this._path = relative._path;
         }
         // resolve the path and query if necessary
-        if (relative._authority == null
-            && (relative._scheme == null || schemesEqual)) {
-            if ((relative._path == null || relative._path.length == 0)
-                && relative._query == null) {
+        if (relative._authority == null && (relative._scheme == null || schemesEqual)) {
+            if ((relative._path == null || relative._path.length == 0) && relative._query == null) {
                 // handle a reference to the current document, see RFC 2396
                 // section 5.2 step 2
                 this._path = base._path;
@@ -629,7 +618,7 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
     /**
      * The root path.
      */
-    protected static final char[] rootPath = { '/' };
+    protected static final char[] rootPath = {'/'};
 
     // ---------------------- Generous characters for each component validation
 
@@ -1776,12 +1765,9 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
      * @return URI character sequence
      * @throws URIException null component or unsupported character encoding
      */
-
-    protected static char[] encode(String original, BitSet allowed,
-            String charset) throws URIException {
+    protected static char[] encode(String original, BitSet allowed, String charset) throws URIException {
         if (original == null) {
-            throw new IllegalArgumentException(
-                "Original string may not be null");
+            throw new IllegalArgumentException("Original string may not be null");
         }
         if (allowed == null) {
             throw new IllegalArgumentException("Allowed bitset may not be null");
@@ -1823,11 +1809,9 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
      * @throws URIException incomplete trailing escape pattern or unsupported
      *             character encoding
      */
-    protected static String decode(char[] component, String charset)
-            throws URIException {
+    protected static String decode(char[] component, String charset) throws URIException {
         if (component == null) {
-            throw new IllegalArgumentException(
-                "Component array of chars may not be null");
+            throw new IllegalArgumentException("Component array of chars may not be null");
         }
         return decode(new String(component), charset);
     }
@@ -1866,11 +1850,9 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
      *             character encoding
      * @since 3.0
      */
-    protected static String decode(String component, String charset)
-            throws URIException {
+    protected static String decode(String component, String charset) throws URIException {
         if (component == null) {
-            throw new IllegalArgumentException(
-                "Component array of chars may not be null");
+            throw new IllegalArgumentException("Component array of chars may not be null");
         }
         byte[] rawdata = decodeUrl(getAsciiBytes(component));
         return getString(rawdata, charset);
@@ -1927,8 +1909,7 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
      * @param generous those characters that are allowed within a component
      * @return if true, it's the correct URI character sequence
      */
-    protected boolean validate(char[] component, int soffset, int eoffset,
-            BitSet generous) {
+    protected boolean validate(char[] component, int soffset, int eoffset, BitSet generous) {
         // validate each component by generous characters
         if (eoffset == -1) {
             eoffset = component.length - 1;
@@ -1983,8 +1964,7 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
      * @param escaped <code>true</code> if <code>original</code> is escaped
      * @throws URIException If an error occurs.
      */
-    protected void parseUriReference(String original, boolean escaped)
-            throws URIException {
+    protected void parseUriReference(String original, boolean escaped) throws URIException {
 
         // validate and contruct the URI character sequence
         if (original == null) {
@@ -2007,10 +1987,10 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
          */
         boolean delim = false;
         if (length > 0) {
-            char[] firstDelimiter = { tmp.charAt(0) };
+            char[] firstDelimiter = {tmp.charAt(0)};
             if (validate(firstDelimiter, delims)) {
                 if (length >= 2) {
-                    char[] lastDelimiter = { tmp.charAt(length - 1) };
+                    char[] lastDelimiter = {tmp.charAt(length - 1)};
                     if (validate(lastDelimiter, delims)) {
                         delim = true;
                     }
@@ -2020,20 +2000,18 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
         if (delim) {
             tmp = tmp.substring(1, length - 1);
             length = length - 2;
-        }
-        else {
+        } else {
             tmp = original;
             length = original.length();
             int idx = 0;
-            while (idx < length  && tmp.charAt(idx) <= ' ') {
+            while (idx < length && tmp.charAt(idx) <= ' ') {
                 idx++;
             }
             if (idx > 0) {
                 if (idx < length) {
                     tmp = tmp.substring(idx);
                     length -= idx;
-                }
-                else {
+                } else {
                     tmp = "";
                     length = 0;
                 }
@@ -2051,8 +2029,7 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
         boolean isStartedFromPath = false;
         int atColon = tmp.indexOf(':');
         int atSlash = tmp.indexOf('/');
-        if ((atColon <= 0 && !tmp.startsWith("//"))
-            || (atSlash >= 0 && atSlash < atColon)) {
+        if ((atColon <= 0 && !tmp.startsWith("//")) || (atSlash >= 0 && atSlash < atColon)) {
             isStartedFromPath = true;
         }
 
@@ -2092,14 +2069,11 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
         if (0 <= at && at < length && tmp.charAt(at) == '/') {
             // Set flag
             _is_hier_part = true;
-            if (at + 2 < length && tmp.charAt(at + 1) == '/'
-                && !isStartedFromPath) {
+            if (at + 2 < length && tmp.charAt(at + 1) == '/' && !isStartedFromPath) {
                 // the temporary index to start the search from
                 int next = indexFirstOf(tmp, "/?#", at + 2);
                 if (next == -1) {
-                    next = (tmp.substring(at + 2).length() == 0)
-                            ? at + 2
-                            : tmp.length();
+                    next = (tmp.substring(at + 2).length() == 0) ? at + 2 : tmp.length();
                 }
                 parseAuthority(tmp.substring(at + 2, next), escaped);
                 from = at = next;
@@ -2124,20 +2098,12 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
                 next = tmp.length();
             }
             if (!_is_abs_path) {
-                if (!escaped
-                    && prevalidate(tmp.substring(from, next),
-                        disallowed_rel_path)
-                    || escaped
-                    && validate(tmp.substring(from, next).toCharArray(),
-                        rel_path)) {
+                if (!escaped && prevalidate(tmp.substring(from, next), disallowed_rel_path)
+                        || escaped && validate(tmp.substring(from, next).toCharArray(), rel_path)) {
                     // Set flag
                     _is_rel_path = true;
-                } else if (!escaped
-                    && prevalidate(tmp.substring(from, next),
-                        disallowed_opaque_part)
-                    || escaped
-                    && validate(tmp.substring(from, next).toCharArray(),
-                        opaque_part)) {
+                } else if (!escaped && prevalidate(tmp.substring(from, next), disallowed_opaque_part)
+                        || escaped && validate(tmp.substring(from, next).toCharArray(), opaque_part)) {
                     // Set flag
                     _is_opaque_part = true;
                 } else {
@@ -2174,8 +2140,7 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
                     throw new URIException("Invalid query");
                 }
             } else {
-                _query = encode(tmp.substring(at + 1, next), allowed_query,
-                    charset);
+                _query = encode(tmp.substring(at + 1, next), allowed_query, charset);
             }
             at = next;
         }
@@ -2192,8 +2157,7 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
             } else {
                 _fragment = (escaped)
                         ? tmp.substring(at + 1).toCharArray()
-                        : encode(tmp.substring(at + 1), allowed_fragment,
-                            charset);
+                        : encode(tmp.substring(at + 1), allowed_fragment, charset);
             }
         }
 
@@ -2293,8 +2257,7 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
      * @param escaped <code>true</code> if <code>original</code> is escaped
      * @throws URIException If an error occurs.
      */
-    protected void parseAuthority(String original, boolean escaped)
-            throws URIException {
+    protected void parseAuthority(String original, boolean escaped) throws URIException {
 
         // Reset flags
         _is_reg_name = _is_server = _is_hostname = _is_IPv4address = _is_IPv6reference = false;
@@ -2309,8 +2272,7 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
             // each protocol extented from URI supports the specific userinfo
             _userinfo = (escaped)
                     ? original.substring(0, next).toCharArray()
-                    : encode(original.substring(0, next), allowed_userinfo,
-                        charset);
+                    : encode(original.substring(0, next), allowed_userinfo, charset);
             from = next + 1;
         }
         next = original.indexOf('[', from);
@@ -2323,8 +2285,7 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
             // In IPv6reference, '[', ']' should be excluded
             _host = (escaped)
                     ? original.substring(from, next).toCharArray()
-                    : encode(original.substring(from, next),
-                        allowed_IPv6reference, charset);
+                    : encode(original.substring(from, next), allowed_IPv6reference, charset);
             // Set flag
             _is_IPv6reference = true;
         } else { // only for !_is_IPv6reference
@@ -2359,14 +2320,12 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
                 _authority = encode(original, allowed_reg_name, charset);
             }
         } else {
-            if (original.length() - 1 > next && hasPort
-                && original.charAt(next) == ':') { // not empty
+            if (original.length() - 1 > next && hasPort && original.charAt(next) == ':') { // not empty
                 from = next + 1;
                 try {
                     _port = Integer.parseInt(original.substring(from));
                 } catch (NumberFormatException error) {
-                    throw new URIException(URIException.PARSING,
-                        "invalid port number");
+                    throw new URIException(URIException.PARSING, "invalid port number");
                 }
             }
             // set a server-based naming authority
@@ -2613,12 +2572,10 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
      * @param charset the default charset for each protocol
      * @throws DefaultCharsetChanged default charset changed
      */
-    public static void setDefaultProtocolCharset(String charset)
-            throws DefaultCharsetChanged {
+    public static void setDefaultProtocolCharset(String charset) throws DefaultCharsetChanged {
 
         defaultProtocolCharset = charset;
-        throw new DefaultCharsetChanged(DefaultCharsetChanged.PROTOCOL_CHARSET,
-            "the default protocol charset changed");
+        throw new DefaultCharsetChanged(DefaultCharsetChanged.PROTOCOL_CHARSET, "the default protocol charset changed");
     }
 
     /**
@@ -2648,9 +2605,7 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
      * @see #getDefaultProtocolCharset
      */
     public String getProtocolCharset() {
-        return (protocolCharset != null)
-                ? protocolCharset
-                : defaultProtocolCharset;
+        return (protocolCharset != null) ? protocolCharset : defaultProtocolCharset;
     }
 
     /**
@@ -2685,12 +2640,10 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
      * @param charset the default charset for the document
      * @throws DefaultCharsetChanged default charset changed
      */
-    public static void setDefaultDocumentCharset(String charset)
-            throws DefaultCharsetChanged {
+    public static void setDefaultDocumentCharset(String charset) throws DefaultCharsetChanged {
 
         defaultDocumentCharset = charset;
-        throw new DefaultCharsetChanged(DefaultCharsetChanged.DOCUMENT_CHARSET,
-            "the default document charset changed");
+        throw new DefaultCharsetChanged(DefaultCharsetChanged.DOCUMENT_CHARSET, "the default document charset changed");
     }
 
     /**
@@ -2760,8 +2713,7 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
      *             fails
      * @throws NullPointerException null authority
      */
-    public void setRawAuthority(char[] escapedAuthority) throws URIException,
-            NullPointerException {
+    public void setRawAuthority(char[] escapedAuthority) throws URIException, NullPointerException {
 
         parseAuthority(new String(escapedAuthority), true);
         setURI();
@@ -2776,8 +2728,7 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
      * @throws URIException If {@link #parseAuthority(java.lang.String,boolean)}
      *             fails
      */
-    public void setEscapedAuthority(String escapedAuthority)
-            throws URIException {
+    public void setEscapedAuthority(String escapedAuthority) throws URIException {
 
         parseAuthority(escapedAuthority, true);
         setURI();
@@ -2808,8 +2759,7 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
      * @throws URIException If {@link #decode} fails
      */
     public String getAuthority() throws URIException {
-        return (_authority == null) ? null : decode(_authority,
-            getProtocolCharset());
+        return (_authority == null) ? null : decode(_authority, getProtocolCharset());
     }
 
     // ----------------------------------------------------------- The userinfo
@@ -2842,8 +2792,7 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
      * @see #getAuthority
      */
     public String getUserinfo() throws URIException {
-        return (_userinfo == null) ? null : decode(_userinfo,
-            getProtocolCharset());
+        return (_userinfo == null) ? null : decode(_userinfo, getProtocolCharset());
     }
 
     // --------------------------------------------------------------- The host
@@ -2924,12 +2873,10 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
         escapedPath = removeFragmentIdentifier(escapedPath);
         if (_is_net_path || _is_abs_path) {
             if (escapedPath[0] != '/') {
-                throw new URIException(URIException.PARSING,
-                    "not absolute path");
+                throw new URIException(URIException.PARSING, "not absolute path");
             }
             if (!validate(escapedPath, abs_path)) {
-                throw new URIException(URIException.ESCAPING,
-                    "escaped absolute path not valid");
+                throw new URIException(URIException.ESCAPING, "escaped absolute path not valid");
             }
             _path = escapedPath;
         } else if (_is_rel_path) {
@@ -2937,19 +2884,15 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
             if (at == 0) {
                 throw new URIException(URIException.PARSING, "incorrect path");
             }
-            if (at > 0 && !validate(escapedPath, 0, at - 1, rel_segment)
-                && !validate(escapedPath, at, -1, abs_path) || at < 0
-                && !validate(escapedPath, 0, -1, rel_segment)) {
+            if (at > 0 && !validate(escapedPath, 0, at - 1, rel_segment) && !validate(escapedPath, at, -1, abs_path)
+                    || at < 0 && !validate(escapedPath, 0, -1, rel_segment)) {
 
-                throw new URIException(URIException.ESCAPING,
-                    "escaped relative path not valid");
+                throw new URIException(URIException.ESCAPING, "escaped relative path not valid");
             }
             _path = escapedPath;
         } else if (_is_opaque_part) {
-            if (!uric_no_slash.get(escapedPath[0])
-                && !validate(escapedPath, 1, -1, uric)) {
-                throw new URIException(URIException.ESCAPING,
-                    "escaped opaque part not valid");
+            if (!uric_no_slash.get(escapedPath[0]) && !validate(escapedPath, 1, -1, uric)) {
+                throw new URIException(URIException.ESCAPING, "escaped opaque part not valid");
             }
             _opaque = escapedPath;
         } else {
@@ -2997,14 +2940,11 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
             StringBuilder buff = new StringBuilder(path.length());
             int at = path.indexOf('/');
             if (at == 0) { // never 0
-                throw new URIException(URIException.PARSING,
-                    "incorrect relative path");
+                throw new URIException(URIException.PARSING, "incorrect relative path");
             }
             if (at > 0) {
-                buff.append(encode(path.substring(0, at), allowed_rel_path,
-                    charset));
-                buff.append(encode(path.substring(at), allowed_abs_path,
-                    charset));
+                buff.append(encode(path.substring(0, at), allowed_rel_path, charset));
+                buff.append(encode(path.substring(at), allowed_abs_path, charset));
             } else {
                 buff.append(encode(path, allowed_rel_path, charset));
             }
@@ -3028,8 +2968,7 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
      * @return the resolved path
      * @throws URIException no more higher path level to be resolved
      */
-    protected char[] resolvePath(char[] basePath, char[] relPath)
-            throws URIException {
+    protected char[] resolvePath(char[] basePath, char[] relPath) throws URIException {
 
         // REMINDME: paths are never null
         String base = (basePath == null) ? "" : new String(basePath);
@@ -3250,8 +3189,7 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
      */
     public String getName() throws URIException {
         char[] basename = getRawName();
-        return (basename == null) ? null : decode(getRawName(),
-            getProtocolCharset());
+        return (basename == null) ? null : decode(getRawName(), getProtocolCharset());
     }
 
     // ----------------------------------------------------- The path and query
@@ -3297,8 +3235,7 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
      */
     public String getPathQuery() throws URIException {
         char[] rawPathQuery = getRawPathQuery();
-        return (rawPathQuery == null) ? null : decode(rawPathQuery,
-            getProtocolCharset());
+        return (rawPathQuery == null) ? null : decode(rawPathQuery, getProtocolCharset());
     }
 
     // -------------------------------------------------------------- The query
@@ -3318,8 +3255,7 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
         // remove the fragment identifier
         escapedQuery = removeFragmentIdentifier(escapedQuery);
         if (!validate(escapedQuery, query)) {
-            throw new URIException(URIException.ESCAPING,
-                "escaped query not valid");
+            throw new URIException(URIException.ESCAPING, "escaped query not valid");
         }
         _query = escapedQuery;
         setURI();
@@ -3411,8 +3347,7 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
             return;
         }
         if (!validate(escapedFragment, fragment)) {
-            throw new URIException(URIException.ESCAPING,
-                "escaped fragment not valid");
+            throw new URIException(URIException.ESCAPING, "escaped fragment not valid");
         }
         _fragment = escapedFragment;
         hash = 0;
@@ -3486,8 +3421,7 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
      * @see #decode
      */
     public String getFragment() throws URIException {
-        return (_fragment == null) ? null : decode(_fragment,
-            getProtocolCharset());
+        return (_fragment == null) ? null : decode(_fragment, getProtocolCharset());
     }
 
     // ------------------------------------------------------------- Utilities
@@ -3539,8 +3473,7 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
         // All occurrences of "/./" in the buffer are replaced with "/"
         int index = -1;
         while ((index = normalized.indexOf("/./")) != -1) {
-            normalized = normalized.substring(0, index)
-                + normalized.substring(index + 2);
+            normalized = normalized.substring(0, index) + normalized.substring(index + 2);
         }
 
         // If the buffer ends with "/.", the "." is removed.
@@ -3559,15 +3492,13 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
         while ((index = normalized.indexOf("/../", startIndex)) != -1) {
             int slashIndex = normalized.lastIndexOf('/', index - 1);
             if (slashIndex >= 0) {
-                normalized = normalized.substring(0, slashIndex)
-                    + normalized.substring(index + 3);
+                normalized = normalized.substring(0, slashIndex) + normalized.substring(index + 3);
             } else {
                 startIndex = index + 3;
             }
         }
         if (normalized.endsWith("/..")) {
-            int slashIndex = normalized.lastIndexOf('/',
-                normalized.length() - 4);
+            int slashIndex = normalized.lastIndexOf('/', normalized.length() - 4);
             if (slashIndex >= 0) {
                 normalized = normalized.substring(0, slashIndex + 1);
             }
@@ -3587,8 +3518,7 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
             normalized = normalized.substring(index + 3);
         }
         if (normalized.endsWith("/..")) {
-            int slashIndex = normalized.lastIndexOf('/',
-                normalized.length() - 4);
+            int slashIndex = normalized.lastIndexOf('/', normalized.length() - 4);
             if (slashIndex < 0) {
                 normalized = "/";
             }
@@ -3704,8 +3634,7 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
      *             input stream cannot be found.
      * @throws IOException If an IO problem occurs.
      */
-    private void readObject(ObjectInputStream ois)
-            throws ClassNotFoundException, IOException {
+    private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException {
 
         ois.defaultReadObject();
     }
@@ -3875,8 +3804,7 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
      */
     public String getURIReference() throws URIException {
         char[] uriReference = getRawURIReference();
-        return (uriReference == null) ? null : decode(uriReference,
-            getProtocolCharset());
+        return (uriReference == null) ? null : decode(uriReference, getProtocolCharset());
     }
 
     /**
@@ -3962,7 +3890,6 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
         public String getReason() {
             return reason;
         }
-
     }
 
     /**
@@ -3976,6 +3903,7 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
 
         /** A mapping of language code to charset */
         private static final HashMap<String, String> LOCALE_TO_CHARSET_MAP;
+
         static {
             LOCALE_TO_CHARSET_MAP = new HashMap<String, String>();
             LOCALE_TO_CHARSET_MAP.put("ar", "ISO-8859-6");
@@ -4037,7 +3965,6 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
             charset = LOCALE_TO_CHARSET_MAP.get(locale.getLanguage());
             return charset; // may be null
         }
-
     }
 
     // from EncodingUtils...
@@ -4058,8 +3985,7 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
         }
 
         if (charset == null || charset.length() == 0) {
-            throw new IllegalArgumentException(
-                "charset may not be null or empty");
+            throw new IllegalArgumentException("charset may not be null or empty");
         }
 
         try {
@@ -4115,8 +4041,7 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
         }
 
         if (charset == null || charset.length() == 0) {
-            throw new IllegalArgumentException(
-                "charset may not be null or empty");
+            throw new IllegalArgumentException("charset may not be null or empty");
         }
 
         try {
@@ -4177,10 +4102,8 @@ public class URI implements Cloneable, Comparable<URI>, Serializable {
                 buffer.write(b);
             } else {
                 buffer.write('%');
-                char hex1 = Character.toUpperCase(Character.forDigit(
-                    (b >> 4) & 0xF, 16));
-                char hex2 = Character.toUpperCase(Character.forDigit(b & 0xF,
-                    16));
+                char hex1 = Character.toUpperCase(Character.forDigit((b >> 4) & 0xF, 16));
+                char hex2 = Character.toUpperCase(Character.forDigit(b & 0xF, 16));
                 buffer.write(hex1);
                 buffer.write(hex2);
             }
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/helper/URIException.java b/src/main/java/org/apache/sling/resourceresolver/impl/helper/URIException.java
index 435cc5cd..b489f8d2 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/helper/URIException.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/helper/URIException.java
@@ -36,8 +36,7 @@ public class URIException extends SlingException {
     /**
      * Default constructor.
      */
-    public URIException() {
-    }
+    public URIException() {}
 
     /**
      * The constructor with a reason code argument.
@@ -120,5 +119,4 @@ public class URIException extends SlingException {
     public int getReasonCode() {
         return reasonCode;
     }
-
 }
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/helper/UniqueResourceIterator.java b/src/main/java/org/apache/sling/resourceresolver/impl/helper/UniqueResourceIterator.java
index 1f0cadea..ead5b667 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/helper/UniqueResourceIterator.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/helper/UniqueResourceIterator.java
@@ -56,4 +56,3 @@ public class UniqueResourceIterator extends AbstractIterator<Resource> {
         return null;
     }
 }
-
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/legacy/LegacyResourceProviderAdapter.java b/src/main/java/org/apache/sling/resourceresolver/impl/legacy/LegacyResourceProviderAdapter.java
index 68e34e68..82dd0a96 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/legacy/LegacyResourceProviderAdapter.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/legacy/LegacyResourceProviderAdapter.java
@@ -24,9 +24,6 @@ import java.util.Collection;
 import java.util.Iterator;
 import java.util.Map;
 
-import org.jetbrains.annotations.Nullable;
-import org.jetbrains.annotations.NotNull;
-
 import org.apache.sling.api.adapter.Adaptable;
 import org.apache.sling.api.resource.AttributableResourceProvider;
 import org.apache.sling.api.resource.DynamicResourceProvider;
@@ -42,6 +39,8 @@ import org.apache.sling.spi.resource.provider.QueryLanguageProvider;
 import org.apache.sling.spi.resource.provider.ResolveContext;
 import org.apache.sling.spi.resource.provider.ResourceContext;
 import org.apache.sling.spi.resource.provider.ResourceProvider;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 
 @SuppressWarnings("deprecation")
 public class LegacyResourceProviderAdapter extends ResourceProvider<Object> implements Closeable {
@@ -52,19 +51,21 @@ public class LegacyResourceProviderAdapter extends ResourceProvider<Object> impl
 
     private final boolean ownsRoot;
 
-    public LegacyResourceProviderAdapter(org.apache.sling.api.resource.ResourceProvider rp, String[] languages, boolean ownsRoot) {
+    public LegacyResourceProviderAdapter(
+            org.apache.sling.api.resource.ResourceProvider rp, String[] languages, boolean ownsRoot) {
         this.rp = rp;
         this.languages = languages;
         this.ownsRoot = ownsRoot;
     }
 
-    @SuppressWarnings({ "rawtypes", "unchecked" })
+    @SuppressWarnings({"rawtypes", "unchecked"})
     @Override
-    public Resource getResource(ResolveContext<Object> ctx, String path, ResourceContext resourceContext, Resource parent) {
+    public Resource getResource(
+            ResolveContext<Object> ctx, String path, ResourceContext resourceContext, Resource parent) {
         Resource resourceCandidate;
         if (rp instanceof ParametrizableResourceProvider) {
-            resourceCandidate = ((ParametrizableResourceProvider) rp).getResource(ctx.getResourceResolver(), path,
-                    resourceContext.getResolveParameters());
+            resourceCandidate = ((ParametrizableResourceProvider) rp)
+                    .getResource(ctx.getResourceResolver(), path, resourceContext.getResolveParameters());
         } else {
             resourceCandidate = rp.getResource(ctx.getResourceResolver(), path);
         }
@@ -93,13 +94,13 @@ public class LegacyResourceProviderAdapter extends ResourceProvider<Object> impl
                 && resource.getResourceMetadata().containsKey(ResourceMetadata.INTERNAL_CONTINUE_RESOLVING);
     }
 
-    @SuppressWarnings({ "rawtypes", "unchecked" })
+    @SuppressWarnings({"rawtypes", "unchecked"})
     @Override
     public Iterator<Resource> listChildren(ResolveContext<Object> ctx, Resource parent) {
         Iterator<Resource> children = rp.listChildren(parent);
         if (children == null && !ownsRoot && ctx.getParentResourceProvider() != null) {
-            children = ctx.getParentResourceProvider().listChildren((ResolveContext) ctx.getParentResolveContext(),
-                    parent);
+            children = ctx.getParentResourceProvider()
+                    .listChildren((ResolveContext) ctx.getParentResolveContext(), parent);
         }
         return children;
     }
@@ -159,17 +160,18 @@ public class LegacyResourceProviderAdapter extends ResourceProvider<Object> impl
         logout(null);
     }
 
-    @SuppressWarnings({ "rawtypes", "unchecked" })
+    @SuppressWarnings({"rawtypes", "unchecked"})
     @Override
-    public Resource create(final @NotNull ResolveContext<Object> ctx, final String path,
-            final Map<String, Object> properties) throws PersistenceException {
+    public Resource create(
+            final @NotNull ResolveContext<Object> ctx, final String path, final Map<String, Object> properties)
+            throws PersistenceException {
         Resource createdResource = null;
         if (rp instanceof ModifyingResourceProvider) {
             createdResource = ((ModifyingResourceProvider) rp).create(ctx.getResourceResolver(), path, properties);
         }
         if (createdResource == null && !ownsRoot && ctx.getParentResourceProvider() != null) {
-            createdResource = ctx.getParentResourceProvider().create((ResolveContext) ctx.getParentResolveContext(),
-                    path, properties);
+            createdResource = ctx.getParentResourceProvider()
+                    .create((ResolveContext) ctx.getParentResolveContext(), path, properties);
         }
         return createdResource;
     }
@@ -213,10 +215,11 @@ public class LegacyResourceProviderAdapter extends ResourceProvider<Object> impl
 
     @SuppressWarnings("unchecked")
     @Override
-    public <AdapterType> AdapterType adaptTo(final @NotNull ResolveContext<Object> ctx, final @NotNull Class<AdapterType> type) {
-        if ( rp instanceof Adaptable ) {
-            final Object value = ((Adaptable)rp).adaptTo(type);
-            if ( value != null ) {
+    public <AdapterType> AdapterType adaptTo(
+            final @NotNull ResolveContext<Object> ctx, final @NotNull Class<AdapterType> type) {
+        if (rp instanceof Adaptable) {
+            final Object value = ((Adaptable) rp).adaptTo(type);
+            if (value != null) {
                 return (AdapterType) value;
             }
         }
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/legacy/LegacyResourceProviderFactoryAdapter.java b/src/main/java/org/apache/sling/resourceresolver/impl/legacy/LegacyResourceProviderFactoryAdapter.java
index 58f19156..265966e4 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/legacy/LegacyResourceProviderFactoryAdapter.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/legacy/LegacyResourceProviderFactoryAdapter.java
@@ -22,9 +22,6 @@ import java.util.Collection;
 import java.util.Iterator;
 import java.util.Map;
 
-import org.jetbrains.annotations.Nullable;
-import org.jetbrains.annotations.NotNull;
-
 import org.apache.commons.lang3.ArrayUtils;
 import org.apache.sling.api.resource.LoginException;
 import org.apache.sling.api.resource.PersistenceException;
@@ -35,8 +32,10 @@ import org.apache.sling.spi.resource.provider.QueryLanguageProvider;
 import org.apache.sling.spi.resource.provider.ResolveContext;
 import org.apache.sling.spi.resource.provider.ResourceContext;
 import org.apache.sling.spi.resource.provider.ResourceProvider;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 
-@SuppressWarnings({ "deprecation", "rawtypes", "unchecked" })
+@SuppressWarnings({"deprecation", "rawtypes", "unchecked"})
 public class LegacyResourceProviderFactoryAdapter extends ResourceProvider<LegacyResourceProviderAdapter> {
 
     private final ResourceProviderFactory rpFactory;
@@ -45,7 +44,8 @@ public class LegacyResourceProviderFactoryAdapter extends ResourceProvider<Legac
 
     private final boolean ownsRoot;
 
-    public LegacyResourceProviderFactoryAdapter(ResourceProviderFactory rpFactory, String[] languages, boolean ownsRoot) {
+    public LegacyResourceProviderFactoryAdapter(
+            ResourceProviderFactory rpFactory, String[] languages, boolean ownsRoot) {
         this.rpFactory = rpFactory;
         this.languages = languages;
         this.ownsRoot = ownsRoot;
@@ -55,7 +55,8 @@ public class LegacyResourceProviderFactoryAdapter extends ResourceProvider<Legac
     @NotNull
     public LegacyResourceProviderAdapter authenticate(final @NotNull Map<String, Object> authenticationInfo)
             throws LoginException {
-        return new LegacyResourceProviderAdapter(rpFactory.getResourceProvider(authenticationInfo), languages, ownsRoot);
+        return new LegacyResourceProviderAdapter(
+                rpFactory.getResourceProvider(authenticationInfo), languages, ownsRoot);
     }
 
     @Override
@@ -64,7 +65,11 @@ public class LegacyResourceProviderFactoryAdapter extends ResourceProvider<Legac
     }
 
     @Override
-    public Resource getResource(ResolveContext<LegacyResourceProviderAdapter> ctx, String path, ResourceContext resourceContext, Resource parent) {
+    public Resource getResource(
+            ResolveContext<LegacyResourceProviderAdapter> ctx,
+            String path,
+            ResourceContext resourceContext,
+            Resource parent) {
         return ctx.getProviderState().getResource((ResolveContext) ctx, path, resourceContext, parent);
     }
 
@@ -93,8 +98,8 @@ public class LegacyResourceProviderFactoryAdapter extends ResourceProvider<Legac
     }
 
     @Override
-    public Object getAttribute(final @NotNull ResolveContext<LegacyResourceProviderAdapter> ctx,
-            final @NotNull String name) {
+    public Object getAttribute(
+            final @NotNull ResolveContext<LegacyResourceProviderAdapter> ctx, final @NotNull String name) {
         return ctx.getProviderState().getAttribute((ResolveContext) ctx, name);
     }
 
@@ -104,14 +109,18 @@ public class LegacyResourceProviderFactoryAdapter extends ResourceProvider<Legac
     }
 
     @Override
-    public Resource create(final @NotNull ResolveContext<LegacyResourceProviderAdapter> ctx, final String path,
-            final Map<String, Object> properties) throws PersistenceException {
+    public Resource create(
+            final @NotNull ResolveContext<LegacyResourceProviderAdapter> ctx,
+            final String path,
+            final Map<String, Object> properties)
+            throws PersistenceException {
         return ctx.getProviderState().create((ResolveContext) ctx, path, properties);
     }
 
     @Override
-    public void delete(final @NotNull ResolveContext<LegacyResourceProviderAdapter> ctx,
-            final @NotNull Resource resource) throws PersistenceException {
+    public void delete(
+            final @NotNull ResolveContext<LegacyResourceProviderAdapter> ctx, final @NotNull Resource resource)
+            throws PersistenceException {
         ctx.getProviderState().delete((ResolveContext) ctx, resource);
     }
 
@@ -131,8 +140,9 @@ public class LegacyResourceProviderFactoryAdapter extends ResourceProvider<Legac
     }
 
     @Override
-    public <AdapterType> AdapterType adaptTo(final @NotNull ResolveContext<LegacyResourceProviderAdapter> ctx, final @NotNull Class<AdapterType> type) {
-        return (AdapterType) ctx.getProviderState().adaptTo((ResolveContext)ctx, type);
+    public <AdapterType> AdapterType adaptTo(
+            final @NotNull ResolveContext<LegacyResourceProviderAdapter> ctx, final @NotNull Class<AdapterType> type) {
+        return (AdapterType) ctx.getProviderState().adaptTo((ResolveContext) ctx, type);
     }
 
     private static class JCRQueryProviderAdapter implements QueryLanguageProvider<LegacyResourceProviderAdapter> {
@@ -149,15 +159,19 @@ public class LegacyResourceProviderFactoryAdapter extends ResourceProvider<Legac
         }
 
         @Override
-        public Iterator<Resource> findResources(ResolveContext<LegacyResourceProviderAdapter> ctx, String query,
-                String language) {
-            return ctx.getProviderState().getQueryLanguageProvider().findResources((ResolveContext) ctx, query, language);
+        public Iterator<Resource> findResources(
+                ResolveContext<LegacyResourceProviderAdapter> ctx, String query, String language) {
+            return ctx.getProviderState()
+                    .getQueryLanguageProvider()
+                    .findResources((ResolveContext) ctx, query, language);
         }
 
         @Override
-        public Iterator<ValueMap> queryResources(ResolveContext<LegacyResourceProviderAdapter> ctx, String query,
-                String language) {
-            return ctx.getProviderState().getQueryLanguageProvider().queryResources((ResolveContext) ctx, query, language);
+        public Iterator<ValueMap> queryResources(
+                ResolveContext<LegacyResourceProviderAdapter> ctx, String query, String language) {
+            return ctx.getProviderState()
+                    .getQueryLanguageProvider()
+                    .queryResources((ResolveContext) ctx, query, language);
         }
     }
 }
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/legacy/LegacyResourceProviderWhiteboard.java b/src/main/java/org/apache/sling/resourceresolver/impl/legacy/LegacyResourceProviderWhiteboard.java
index 9529bd1e..39173d8d 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/legacy/LegacyResourceProviderWhiteboard.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/legacy/LegacyResourceProviderWhiteboard.java
@@ -18,22 +18,6 @@
  */
 package org.apache.sling.resourceresolver.impl.legacy;
 
-import static org.apache.sling.api.resource.QueriableResourceProvider.LANGUAGES;
-import static org.apache.sling.api.resource.ResourceProvider.OWNS_ROOTS;
-import static org.apache.sling.api.resource.ResourceProvider.ROOTS;
-import static org.apache.sling.api.resource.ResourceProvider.USE_RESOURCE_ACCESS_SECURITY;
-import static org.apache.sling.api.resource.ResourceProviderFactory.PROPERTY_REQUIRED;
-import static org.apache.sling.spi.resource.provider.ResourceProvider.PROPERTY_ADAPTABLE;
-import static org.apache.sling.spi.resource.provider.ResourceProvider.PROPERTY_ATTRIBUTABLE;
-import static org.apache.sling.spi.resource.provider.ResourceProvider.PROPERTY_AUTHENTICATE;
-import static org.apache.sling.spi.resource.provider.ResourceProvider.PROPERTY_MODIFIABLE;
-import static org.apache.sling.spi.resource.provider.ResourceProvider.PROPERTY_NAME;
-import static org.apache.sling.spi.resource.provider.ResourceProvider.PROPERTY_REFRESHABLE;
-import static org.apache.sling.spi.resource.provider.ResourceProvider.PROPERTY_ROOT;
-import static org.apache.sling.spi.resource.provider.ResourceProvider.PROPERTY_USE_RESOURCE_ACCESS_SECURITY;
-import static org.osgi.framework.Constants.SERVICE_PID;
-import static org.osgi.framework.Constants.SERVICE_RANKING;
-
 import java.util.ArrayList;
 import java.util.Dictionary;
 import java.util.HashMap;
@@ -59,6 +43,22 @@ import org.osgi.service.component.annotations.ReferenceCardinality;
 import org.osgi.service.component.annotations.ReferencePolicy;
 import org.osgi.util.converter.Converters;
 
+import static org.apache.sling.api.resource.QueriableResourceProvider.LANGUAGES;
+import static org.apache.sling.api.resource.ResourceProvider.OWNS_ROOTS;
+import static org.apache.sling.api.resource.ResourceProvider.ROOTS;
+import static org.apache.sling.api.resource.ResourceProvider.USE_RESOURCE_ACCESS_SECURITY;
+import static org.apache.sling.api.resource.ResourceProviderFactory.PROPERTY_REQUIRED;
+import static org.apache.sling.spi.resource.provider.ResourceProvider.PROPERTY_ADAPTABLE;
+import static org.apache.sling.spi.resource.provider.ResourceProvider.PROPERTY_ATTRIBUTABLE;
+import static org.apache.sling.spi.resource.provider.ResourceProvider.PROPERTY_AUTHENTICATE;
+import static org.apache.sling.spi.resource.provider.ResourceProvider.PROPERTY_MODIFIABLE;
+import static org.apache.sling.spi.resource.provider.ResourceProvider.PROPERTY_NAME;
+import static org.apache.sling.spi.resource.provider.ResourceProvider.PROPERTY_REFRESHABLE;
+import static org.apache.sling.spi.resource.provider.ResourceProvider.PROPERTY_ROOT;
+import static org.apache.sling.spi.resource.provider.ResourceProvider.PROPERTY_USE_RESOURCE_ACCESS_SECURITY;
+import static org.osgi.framework.Constants.SERVICE_PID;
+import static org.osgi.framework.Constants.SERVICE_RANKING;
+
 @SuppressWarnings("deprecation")
 @Component
 public class LegacyResourceProviderWhiteboard {
@@ -67,17 +67,24 @@ public class LegacyResourceProviderWhiteboard {
 
     private Map<Object, List<ServiceRegistration>> registrations = new HashMap<>();
 
-    @Reference(service = ResourceProvider.class, cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC)
+    @Reference(
+            service = ResourceProvider.class,
+            cardinality = ReferenceCardinality.MULTIPLE,
+            policy = ReferencePolicy.DYNAMIC)
     protected void bindResourceProvider(final ServiceReference<ResourceProvider> ref) {
         final BundleContext bundleContext = ref.getBundle().getBundleContext();
         final ResourceProvider provider = bundleContext.getService(ref);
-        if ( provider != null ) {
+        if (provider != null) {
             final String[] propertyNames = ref.getPropertyKeys();
-            final boolean ownsRoot = Converters.standardConverter().convert(ref.getProperty(OWNS_ROOTS)).to(boolean.class);
+            final boolean ownsRoot = Converters.standardConverter()
+                    .convert(ref.getProperty(OWNS_ROOTS))
+                    .to(boolean.class);
 
             final List<ServiceRegistration> newServices = new ArrayList<>();
-            for (final String path : Converters.standardConverter().convert(ref.getProperty(ROOTS)).to(String[].class)) {
-                if ( path != null && !path.isEmpty() ) {
+            for (final String path : Converters.standardConverter()
+                    .convert(ref.getProperty(ROOTS))
+                    .to(String[].class)) {
+                if (path != null && !path.isEmpty()) {
                     final Dictionary<String, Object> newProps = new Hashtable<>();
                     newProps.put(PROPERTY_AUTHENTICATE, AuthType.no.toString());
                     newProps.put(PROPERTY_MODIFIABLE, provider instanceof ModifyingResourceProvider);
@@ -90,16 +97,20 @@ public class LegacyResourceProviderWhiteboard {
                         newProps.put(ORIGINAL_SERVICE_PID, ref.getProperty(SERVICE_PID));
                     }
                     if (ArrayUtils.contains(propertyNames, USE_RESOURCE_ACCESS_SECURITY)) {
-                        newProps.put(PROPERTY_USE_RESOURCE_ACCESS_SECURITY, ref.getProperty(USE_RESOURCE_ACCESS_SECURITY));
+                        newProps.put(
+                                PROPERTY_USE_RESOURCE_ACCESS_SECURITY, ref.getProperty(USE_RESOURCE_ACCESS_SECURITY));
                     }
                     if (ArrayUtils.contains(propertyNames, SERVICE_RANKING)) {
                         newProps.put(SERVICE_RANKING, ref.getProperty(SERVICE_RANKING));
                     }
 
-                    String[] languages = Converters.standardConverter().convert(ref.getProperty(LANGUAGES)).to(String[].class);
+                    String[] languages = Converters.standardConverter()
+                            .convert(ref.getProperty(LANGUAGES))
+                            .to(String[].class);
                     ServiceRegistration reg = bundleContext.registerService(
                             org.apache.sling.spi.resource.provider.ResourceProvider.class.getName(),
-                            new LegacyResourceProviderAdapter(provider, languages, ownsRoot), newProps);
+                            new LegacyResourceProviderAdapter(provider, languages, ownsRoot),
+                            newProps);
                     newServices.add(reg);
                 }
             }
@@ -113,19 +124,28 @@ public class LegacyResourceProviderWhiteboard {
         }
     }
 
-    @Reference(service = ResourceProviderFactory.class, cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC)
+    @Reference(
+            service = ResourceProviderFactory.class,
+            cardinality = ReferenceCardinality.MULTIPLE,
+            policy = ReferencePolicy.DYNAMIC)
     protected void bindResourceProviderFactory(final ServiceReference<ResourceProviderFactory> ref) {
         final BundleContext bundleContext = ref.getBundle().getBundleContext();
         final ResourceProviderFactory factory = bundleContext.getService(ref);
-        if ( factory != null ) {
+        if (factory != null) {
             final String[] propertyNames = ref.getPropertyKeys();
-            final boolean ownsRoot = Converters.standardConverter().convert(ref.getProperty(OWNS_ROOTS)).to(boolean.class);
+            final boolean ownsRoot = Converters.standardConverter()
+                    .convert(ref.getProperty(OWNS_ROOTS))
+                    .to(boolean.class);
 
             final List<ServiceRegistration> newServices = new ArrayList<>();
-            for (final String path : Converters.standardConverter().convert(ref.getProperty(ROOTS)).to(String[].class)) {
-                if ( path != null && !path.isEmpty() ) {
+            for (final String path : Converters.standardConverter()
+                    .convert(ref.getProperty(ROOTS))
+                    .to(String[].class)) {
+                if (path != null && !path.isEmpty()) {
                     final Dictionary<String, Object> newProps = new Hashtable<>();
-                    if (Converters.standardConverter().convert(ref.getProperty(PROPERTY_REQUIRED)).to(boolean.class)) {
+                    if (Converters.standardConverter()
+                            .convert(ref.getProperty(PROPERTY_REQUIRED))
+                            .to(boolean.class)) {
                         newProps.put(PROPERTY_AUTHENTICATE, AuthType.required.toString());
                     } else {
                         newProps.put(PROPERTY_AUTHENTICATE, AuthType.lazy.toString());
@@ -140,15 +160,19 @@ public class LegacyResourceProviderWhiteboard {
                         newProps.put(ORIGINAL_SERVICE_PID, ref.getProperty(SERVICE_PID));
                     }
                     if (ArrayUtils.contains(propertyNames, USE_RESOURCE_ACCESS_SECURITY)) {
-                        newProps.put(PROPERTY_USE_RESOURCE_ACCESS_SECURITY, ref.getProperty(USE_RESOURCE_ACCESS_SECURITY));
+                        newProps.put(
+                                PROPERTY_USE_RESOURCE_ACCESS_SECURITY, ref.getProperty(USE_RESOURCE_ACCESS_SECURITY));
                     }
                     if (ArrayUtils.contains(propertyNames, SERVICE_RANKING)) {
                         newProps.put(SERVICE_RANKING, ref.getProperty(SERVICE_RANKING));
                     }
-                    String[] languages = Converters.standardConverter().convert(ref.getProperty(LANGUAGES)).to(String[].class);
+                    String[] languages = Converters.standardConverter()
+                            .convert(ref.getProperty(LANGUAGES))
+                            .to(String[].class);
                     ServiceRegistration reg = bundleContext.registerService(
                             org.apache.sling.spi.resource.provider.ResourceProvider.class.getName(),
-                            new LegacyResourceProviderFactoryAdapter(factory, languages, ownsRoot), newProps);
+                            new LegacyResourceProviderFactoryAdapter(factory, languages, ownsRoot),
+                            newProps);
                     newServices.add(reg);
                 }
             }
@@ -156,8 +180,8 @@ public class LegacyResourceProviderWhiteboard {
         }
     }
 
-    protected void unbindResourceProviderFactory(final ResourceProviderFactory factory,
-            final Map<String, Object> props) {
+    protected void unbindResourceProviderFactory(
+            final ResourceProviderFactory factory, final Map<String, Object> props) {
         for (ServiceRegistration r : registrations.remove(factory)) {
             r.unregister();
         }
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/mapping/BloomFilterUtils.java b/src/main/java/org/apache/sling/resourceresolver/impl/mapping/BloomFilterUtils.java
index a947a2cf..79485c90 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/mapping/BloomFilterUtils.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/mapping/BloomFilterUtils.java
@@ -1,18 +1,20 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information 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
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * 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
  *
- *     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.
+ * 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.
  */
 package org.apache.sling.resourceresolver.impl.mapping;
 
@@ -62,7 +64,7 @@ public class BloomFilterUtils {
      * @param bloom the bloom filter
      * @param key the key
      */
-    public static void remove(byte[] bloom, Object key){
+    public static void remove(byte[] bloom, Object key) {
         throw new UnsupportedOperationException();
     }
 
@@ -106,5 +108,4 @@ public class BloomFilterUtils {
         hash = (hash >>> 16) ^ hash;
         return hash;
     }
-
 }
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/mapping/Interpolator.java b/src/main/java/org/apache/sling/resourceresolver/impl/mapping/Interpolator.java
index afa5147c..f81a580d 100755
--- a/src/main/java/org/apache/sling/resourceresolver/impl/mapping/Interpolator.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/mapping/Interpolator.java
@@ -1,28 +1,30 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information 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
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * 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
  *
- *      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.
+ * 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.
  */
 package org.apache.sling.resourceresolver.impl.mapping;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 /**
  * Replace place holders in a string
  */
@@ -148,10 +150,12 @@ public class Interpolator {
                     }
                 }
                 // replace and continue with replacement
-                result = result.substring(0, start).concat(replacement.toString()).concat(result.substring(index));
+                result = result.substring(0, start)
+                        .concat(replacement.toString())
+                        .concat(result.substring(index));
                 LOGGER.trace("Replacements found for: '{}': '{}'", newName, result);
             }
         }
         return result;
     }
-}
\ No newline at end of file
+}
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapConfigurationProvider.java b/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapConfigurationProvider.java
index aa225621..b731aed6 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapConfigurationProvider.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapConfigurationProvider.java
@@ -1,18 +1,20 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information 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
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * 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
  *
- * 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.
+ * 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.
  */
 package org.apache.sling.resourceresolver.impl.mapping;
 
@@ -60,7 +62,7 @@ public interface MapConfigurationProvider extends ResourceResolverFactory {
     boolean hasVanityPathPrecedence();
 
     Map<String, Object> getServiceUserAuthenticationInfo(final String subServiceName) throws LoginException;
-    
+
     public class VanityPathConfig implements Comparable<VanityPathConfig> {
         public final boolean isExclude;
         public final String prefix;
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java b/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java
index 3e241210..37029a62 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java
@@ -18,28 +18,6 @@
  */
 package org.apache.sling.resourceresolver.impl.mapping;
 
-import org.apache.sling.api.SlingConstants;
-import org.apache.sling.api.resource.LoginException;
-import org.apache.sling.api.resource.QuerySyntaxException;
-import org.apache.sling.api.resource.Resource;
-import org.apache.sling.api.resource.ResourceResolver;
-import org.apache.sling.api.resource.ResourceUtil;
-import org.apache.sling.api.resource.ValueMap;
-import org.apache.sling.api.resource.observation.ExternalResourceChangeListener;
-import org.apache.sling.api.resource.observation.ResourceChange;
-import org.apache.sling.api.resource.observation.ResourceChangeListener;
-import org.apache.sling.resourceresolver.impl.ResourceResolverImpl;
-import org.apache.sling.resourceresolver.impl.ResourceResolverMetrics;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-import org.osgi.framework.ServiceRegistration;
-import org.osgi.service.event.Event;
-import org.osgi.service.event.EventAdmin;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import javax.servlet.http.HttpServletResponse;
 
 import java.io.IOException;
@@ -68,10 +46,29 @@ import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.concurrent.locks.ReentrantLock;
 
-public class MapEntries implements
-    MapEntriesHandler,
-    ResourceChangeListener,
-    ExternalResourceChangeListener {
+import org.apache.sling.api.SlingConstants;
+import org.apache.sling.api.resource.LoginException;
+import org.apache.sling.api.resource.QuerySyntaxException;
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.api.resource.ResourceUtil;
+import org.apache.sling.api.resource.ValueMap;
+import org.apache.sling.api.resource.observation.ExternalResourceChangeListener;
+import org.apache.sling.api.resource.observation.ResourceChange;
+import org.apache.sling.api.resource.observation.ResourceChangeListener;
+import org.apache.sling.resourceresolver.impl.ResourceResolverImpl;
+import org.apache.sling.resourceresolver.impl.ResourceResolverMetrics;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.framework.ServiceRegistration;
+import org.osgi.service.event.Event;
+import org.osgi.service.event.EventAdmin;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class MapEntries implements MapEntriesHandler, ResourceChangeListener, ExternalResourceChangeListener {
 
     private static final String JCR_CONTENT = "jcr:content";
 
@@ -138,19 +135,20 @@ public class MapEntries implements
 
     final VanityPathHandler vph;
 
-    public MapEntries(final MapConfigurationProvider factory,
-            final BundleContext bundleContext, 
-            final EventAdmin eventAdmin, 
-            final StringInterpolationProvider stringInterpolationProvider, 
-            final Optional<ResourceResolverMetrics> metrics) 
-                    throws LoginException, IOException {
+    public MapEntries(
+            final MapConfigurationProvider factory,
+            final BundleContext bundleContext,
+            final EventAdmin eventAdmin,
+            final StringInterpolationProvider stringInterpolationProvider,
+            final Optional<ResourceResolverMetrics> metrics)
+            throws LoginException, IOException {
 
         this.resolver = factory.getServiceResourceResolver(factory.getServiceUserAuthenticationInfo("mapping"));
         this.factory = factory;
         this.eventAdmin = eventAdmin;
 
         this.resolveMapsMap = new ConcurrentHashMap<>(Map.of(GLOBAL_LIST_KEY, List.of()));
-        this.mapMaps = Collections.<MapEntry> emptyList();
+        this.mapMaps = Collections.<MapEntry>emptyList();
         this.aliasMapsMap = new ConcurrentHashMap<>();
         this.stringInterpolationProvider = stringInterpolationProvider;
 
@@ -182,7 +180,8 @@ public class MapEntries implements
         }
     }
 
-    private ServiceRegistration<ResourceChangeListener> registerResourceChangeListener(final BundleContext bundleContext) {
+    private ServiceRegistration<ResourceChangeListener> registerResourceChangeListener(
+            final BundleContext bundleContext) {
         final Dictionary<String, Object> props = new Hashtable<>(); // NOSONAR - required by OSGi APIs
         final String[] paths = new String[factory.getObservationPaths().length];
         for (int i = 0; i < paths.length; i++) {
@@ -205,7 +204,8 @@ public class MapEntries implements
             final Resource resource = this.resolver != null ? resolver.getResource(path) : null;
             if (resource != null) {
                 boolean changed = vph.doAddVanity(resource);
-                if (this.useOptimizeAliasResolution && resource.getValueMap().containsKey(ResourceResolverImpl.PROP_ALIAS)) {
+                if (this.useOptimizeAliasResolution
+                        && resource.getValueMap().containsKey(ResourceResolverImpl.PROP_ALIAS)) {
                     changed |= doAddAlias(resource);
                 }
                 return changed;
@@ -219,7 +219,7 @@ public class MapEntries implements
 
     private boolean updateResource(final String path, final AtomicBoolean resolverRefreshed) {
         final boolean isValidVanityPath = vph.isValidVanityPath(path);
-        if ( this.useOptimizeAliasResolution || isValidVanityPath) {
+        if (this.useOptimizeAliasResolution || isValidVanityPath) {
             this.initializing.lock();
 
             try {
@@ -227,13 +227,13 @@ public class MapEntries implements
                 final Resource resource = this.resolver != null ? resolver.getResource(path) : null;
                 if (resource != null) {
                     boolean changed = false;
-                    if ( isValidVanityPath ) {
+                    if (isValidVanityPath) {
                         // we remove the old vanity path first
                         changed |= vph.doRemoveVanity(path);
 
                         // add back vanity path
                         Resource contentRsrc = null;
-                        if ( !resource.getName().equals(JCR_CONTENT)) {
+                        if (!resource.getName().equals(JCR_CONTENT)) {
                             // there might be a JCR_CONTENT child resource
                             contentRsrc = resource.getChild(JCR_CONTENT);
                         }
@@ -266,7 +266,8 @@ public class MapEntries implements
         if (this.useOptimizeAliasResolution) {
             final String pathPrefix = path + "/";
             for (final String contentPath : this.aliasMapsMap.keySet()) {
-                if (path.startsWith(contentPath + "/") || path.equals(contentPath)
+                if (path.startsWith(contentPath + "/")
+                        || path.equals(contentPath)
                         || contentPath.startsWith(pathPrefix)) {
                     changed |= removeAlias(contentPath, path, resolverRefreshed);
                 }
@@ -322,7 +323,8 @@ public class MapEntries implements
 
         try {
             if (!initLocked) {
-                log.warn("dispose: Could not acquire initialization lock within 10 seconds; ongoing intialization may fail");
+                log.warn(
+                        "dispose: Could not acquire initialization lock within 10 seconds; ongoing intialization may fail");
             }
 
             // immediately set the resolver field to null to indicate
@@ -366,8 +368,11 @@ public class MapEntries implements
             key = requestPath.substring(secondIndex);
         }
 
-        return new MapEntryIterator(key, resolveMapsMap.get(GLOBAL_LIST_KEY),
-                vph::getCurrentMapEntryForVanityPath, this.factory.hasVanityPathPrecedence());
+        return new MapEntryIterator(
+                key,
+                resolveMapsMap.get(GLOBAL_LIST_KEY),
+                vph::getCurrentMapEntryForVanityPath,
+                this.factory.hasVanityPathPrecedence());
     }
 
     @Override
@@ -386,7 +391,7 @@ public class MapEntries implements
      *                          method returns
      */
     private void refreshResolverIfNecessary(final AtomicBoolean resolverRefreshed) {
-        if ( resolverRefreshed.compareAndSet(false, true) ) {
+        if (resolverRefreshed.compareAndSet(false, true)) {
             this.resolver.refresh();
         }
     }
@@ -402,13 +407,14 @@ public class MapEntries implements
      *         the path does not affect a config change, {@code null} if the config has already
      *         been reloaded.
      */
-    private Boolean handleConfigurationUpdate(final String path,
+    private Boolean handleConfigurationUpdate(
+            final String path,
             final AtomicBoolean hasReloadedConfig,
             final AtomicBoolean resolverRefreshed,
             final boolean isDelete) {
-        if ( this.factory.isMapConfiguration(path)
-             || (isDelete && this.factory.getMapRoot().startsWith(path + "/")) ) {
-            if ( hasReloadedConfig.compareAndSet(false, true) ) {
+        if (this.factory.isMapConfiguration(path)
+                || (isDelete && this.factory.getMapRoot().startsWith(path + "/"))) {
+            if (hasReloadedConfig.compareAndSet(false, true)) {
                 this.initializing.lock();
 
                 try {
@@ -461,7 +467,8 @@ public class MapEntries implements
 
             // during startup: just enqueue the events
             if (inStartup) {
-                if (type == ResourceChange.ChangeType.REMOVED || type == ResourceChange.ChangeType.ADDED
+                if (type == ResourceChange.ChangeType.REMOVED
+                        || type == ResourceChange.ChangeType.ADDED
                         || type == ResourceChange.ChangeType.CHANGED) {
                     Map.Entry<String, ResourceChange.ChangeType> entry = new SimpleEntry<>(path, type);
                     log.trace("enqueue: {}", entry);
@@ -481,7 +488,10 @@ public class MapEntries implements
         }
     }
 
-    private boolean handleResourceChange(ResourceChange.ChangeType type, String path, AtomicBoolean resolverRefreshed,
+    private boolean handleResourceChange(
+            ResourceChange.ChangeType type,
+            String path,
+            AtomicBoolean resolverRefreshed,
             AtomicBoolean hasReloadedConfig) {
         boolean changed = false;
 
@@ -521,9 +531,9 @@ public class MapEntries implements
 
     // ---------- internal
 
-    private String getActualContentPath(final String path){
+    private String getActualContentPath(final String path) {
         final String checkPath;
-        if ( path.endsWith(JCR_CONTENT_SUFFIX) ) {
+        if (path.endsWith(JCR_CONTENT_SUFFIX)) {
             checkPath = ResourceUtil.getParent(path);
         } else {
             checkPath = path;
@@ -537,13 +547,14 @@ public class MapEntries implements
     private void sendChangeEvent() {
         final EventAdmin local = this.eventAdmin;
         if (local != null) {
-            final Event event = new Event(SlingConstants.TOPIC_RESOURCE_RESOLVER_MAPPING_CHANGED,
-                            (Dictionary<String, ?>) null);
+            final Event event =
+                    new Event(SlingConstants.TOPIC_RESOURCE_RESOLVER_MAPPING_CHANGED, (Dictionary<String, ?>) null);
             local.postEvent(event);
         }
     }
 
-    private void loadResolverMap(final ResourceResolver resolver, final List<MapEntry> entries, final Map<String, MapEntry> mapEntries) {
+    private void loadResolverMap(
+            final ResourceResolver resolver, final List<MapEntry> entries, final Map<String, MapEntry> mapEntries) {
         // the standard map configuration
         final Resource res = resolver.getResource(this.factory.getMapRoot());
         if (res != null) {
@@ -551,8 +562,12 @@ public class MapEntries implements
         }
     }
 
-    private void gather(final ResourceResolver resolver, final List<MapEntry> entries, final Map<String, MapEntry> mapEntries,
-                    final Resource parent, final String parentPath) {
+    private void gather(
+            final ResourceResolver resolver,
+            final List<MapEntry> entries,
+            final Map<String, MapEntry> mapEntries,
+            final Resource parent,
+            final String parentPath) {
         // scheme list
         final Iterator<Resource> children = parent.listChildren();
         while (children.hasNext()) {
@@ -585,11 +600,11 @@ public class MapEntries implements
 
             // add resolution entries for this node
             MapEntry childResolveEntry = null;
-            try{
-                childResolveEntry=MapEntry.createResolveEntry(childPath, child, trailingSlash);
-            }catch (IllegalArgumentException iae){
-                //ignore this entry
-                log.debug("ignored entry due exception ",iae);
+            try {
+                childResolveEntry = MapEntry.createResolveEntry(childPath, child, trailingSlash);
+            } catch (IllegalArgumentException iae) {
+                // ignore this entry
+                log.debug("ignored entry due exception ", iae);
             }
             if (childResolveEntry != null) {
                 entries.add(childResolveEntry);
@@ -602,7 +617,6 @@ public class MapEntries implements
                     addMapEntry(mapEntries, mapEntry.getPattern(), mapEntry.getRedirect()[0], mapEntry.getStatus());
                 }
             }
-
         }
     }
 
@@ -618,7 +632,7 @@ public class MapEntries implements
                     final String url = "^" + ANY_SCHEME_HOST + extPath + "$";
                     final String redirect = intPath;
                     MapEntry mapEntry = getMapEntry(url, -1, redirect);
-                    if (mapEntry!=null){
+                    if (mapEntry != null) {
                         entries.add(mapEntry);
                     }
                 }
@@ -645,8 +659,9 @@ public class MapEntries implements
             }
 
             for (final Entry<String, List<String>> entry : map.entrySet()) {
-                MapEntry mapEntry = getMapEntry(ANY_SCHEME_HOST + entry.getKey(), -1, entry.getValue().toArray(new String[0]));
-                if (mapEntry!=null){
+                MapEntry mapEntry = getMapEntry(
+                        ANY_SCHEME_HOST + entry.getKey(), -1, entry.getValue().toArray(new String[0]));
+                if (mapEntry != null) {
                     entries.add(mapEntry);
                 }
             }
@@ -685,7 +700,8 @@ public class MapEntries implements
         }
     }
 
-    private void addMapEntry(final Map<String, MapEntry> entries, final String path, final String url, final int status) {
+    private void addMapEntry(
+            final Map<String, MapEntry> entries, final String path, final String url, final int status) {
         MapEntry entry = entries.get(path);
         if (entry == null) {
             entry = getMapEntry(path, status, url);
@@ -696,7 +712,7 @@ public class MapEntries implements
             newRedir[redir.length] = url;
             entry = getMapEntry(entry.getPattern(), entry.getStatus(), newRedir);
         }
-        if (entry!=null){
+        if (entry != null) {
             entries.put(path, entry);
         }
     }
@@ -705,8 +721,7 @@ public class MapEntries implements
         return getMapEntry(url, status, 0, redirect);
     }
 
-    private MapEntry getMapEntry(final String url, final int status, long order,
-            final String... redirect) {
+    private MapEntry getMapEntry(final String url, final int status, long order, final String... redirect) {
         try {
             return new MapEntry(url, status, false, order, redirect);
         } catch (IllegalArgumentException iae) {
@@ -716,7 +731,6 @@ public class MapEntries implements
         }
     }
 
-
     private void drainQueue() {
         final AtomicBoolean resolverRefreshed = new AtomicBoolean(false);
 
@@ -766,17 +780,21 @@ public class MapEntries implements
 
             boolean isOptimizeAliasResolutionEnabled = this.factory.isOptimizeAliasResolutionEnabled();
 
-            //optimization made in SLING-2521
+            // optimization made in SLING-2521
             if (isOptimizeAliasResolutionEnabled) {
                 try {
-                    final Map<String, Map<String, Collection<String>>> loadedMap = this.loadAliases(resolver, conflictingAliases, invalidAliases);
+                    final Map<String, Map<String, Collection<String>>> loadedMap =
+                            this.loadAliases(resolver, conflictingAliases, invalidAliases);
                     this.aliasMapsMap = loadedMap;
 
                     // warn if there are more than a few defunct aliases
                     if (conflictingAliases.size() >= MAX_REPORT_DEFUNCT_ALIASES) {
-                        log.warn("There are {} conflicting aliases; excerpt: {}",  conflictingAliases.size(), conflictingAliases);
+                        log.warn(
+                                "There are {} conflicting aliases; excerpt: {}",
+                                conflictingAliases.size(),
+                                conflictingAliases);
                     } else if (!conflictingAliases.isEmpty()) {
-                        log.warn("There are {} conflicting aliases: {}",  conflictingAliases.size(), conflictingAliases);
+                        log.warn("There are {} conflicting aliases: {}", conflictingAliases.size(), conflictingAliases);
                     }
                     if (invalidAliases.size() >= MAX_REPORT_DEFUNCT_ALIASES) {
                         log.warn("There are {} invalid aliases; excerpt: {}", invalidAliases.size(), invalidAliases);
@@ -801,7 +819,6 @@ public class MapEntries implements
         } finally {
 
             this.initializing.unlock();
-
         }
     }
 
@@ -821,16 +838,16 @@ public class MapEntries implements
         // otherwise we can discard the event
         boolean handle = true;
         final String resourcePath;
-        if ( path != null  && path.length() > contentPath.length()) {
+        if (path != null && path.length() > contentPath.length()) {
             final String subPath = path.substring(contentPath.length() + 1);
             final int firstSlash = subPath.indexOf('/');
-            if ( firstSlash == -1 ) {
-                if ( subPath.equals(JCR_CONTENT) ) {
+            if (firstSlash == -1) {
+                if (subPath.equals(JCR_CONTENT)) {
                     handle = false;
                 }
                 resourcePath = path;
-            } else if ( subPath.lastIndexOf('/') == firstSlash) {
-                if ( subPath.startsWith(JCR_CONTENT_PREFIX) || !subPath.endsWith(JCR_CONTENT_SUFFIX) ) {
+            } else if (subPath.lastIndexOf('/') == firstSlash) {
+                if (subPath.startsWith(JCR_CONTENT_PREFIX) || !subPath.endsWith(JCR_CONTENT_SUFFIX)) {
                     handle = false;
                 }
                 resourcePath = ResourceUtil.getParent(path);
@@ -838,11 +855,10 @@ public class MapEntries implements
                 handle = false;
                 resourcePath = null;
             }
-        }
-        else {
+        } else {
             resourcePath = contentPath;
         }
-        if ( !handle ) {
+        if (!handle) {
             return false;
         }
 
@@ -853,7 +869,8 @@ public class MapEntries implements
                 this.refreshResolverIfNecessary(resolverRefreshed);
 
                 String prefix = contentPath.endsWith("/") ? contentPath : contentPath + "/";
-                if (aliasMapEntry.entrySet().removeIf(e -> (prefix + e.getKey()).startsWith(resourcePath)) &&  (aliasMapEntry.isEmpty())) {
+                if (aliasMapEntry.entrySet().removeIf(e -> (prefix + e.getKey()).startsWith(resourcePath))
+                        && (aliasMapEntry.isEmpty())) {
                     this.aliasMapsMap.remove(contentPath);
                 }
 
@@ -885,11 +902,12 @@ public class MapEntries implements
         // resource containing the alias
         final Resource containingResource = getResourceToBeAliased(resource);
 
-        if ( containingResource != null ) {
+        if (containingResource != null) {
             final String containingResourceName = containingResource.getName();
             final String parentPath = ResourceUtil.getParent(containingResource.getPath());
 
-            final Map<String, Collection<String>> aliasMapEntry = parentPath == null ? null : aliasMapsMap.get(parentPath);
+            final Map<String, Collection<String>> aliasMapEntry =
+                    parentPath == null ? null : aliasMapsMap.get(parentPath);
             if (aliasMapEntry != null) {
                 aliasMapEntry.remove(containingResourceName);
                 if (aliasMapEntry.isEmpty()) {
@@ -899,11 +917,11 @@ public class MapEntries implements
 
             boolean changed = aliasMapEntry != null;
 
-            if ( containingResource.getValueMap().containsKey(ResourceResolverImpl.PROP_ALIAS) ) {
+            if (containingResource.getValueMap().containsKey(ResourceResolverImpl.PROP_ALIAS)) {
                 changed |= doAddAlias(containingResource);
             }
             final Resource child = containingResource.getChild(JCR_CONTENT);
-            if ( child != null && child.getValueMap().containsKey(ResourceResolverImpl.PROP_ALIAS) ) {
+            if (child != null && child.getValueMap().containsKey(ResourceResolverImpl.PROP_ALIAS)) {
                 changed |= doAddAlias(child);
             }
 
@@ -930,15 +948,16 @@ public class MapEntries implements
      * Load aliases - Search for all nodes (except under /jcr:system) below
      * configured alias locations having the sling:alias property
      */
-    private Map<String, Map<String, Collection<String>>> loadAliases(final ResourceResolver resolver,
-                                                                     List<String> conflictingAliases, List<String> invalidAliases) {
+    private Map<String, Map<String, Collection<String>>> loadAliases(
+            final ResourceResolver resolver, List<String> conflictingAliases, List<String> invalidAliases) {
 
         final Map<String, Map<String, Collection<String>>> map = new ConcurrentHashMap<>();
         final String baseQueryString = generateAliasQuery();
 
         Iterator<Resource> it;
         try {
-            final String queryStringWithSort = baseQueryString + " AND FIRST([sling:alias]) >= '%s' ORDER BY FIRST([sling:alias])";
+            final String queryStringWithSort =
+                    baseQueryString + " AND FIRST([sling:alias]) >= '%s' ORDER BY FIRST([sling:alias])";
             it = new PagedQueryIterator("alias", "sling:alias", resolver, queryStringWithSort, 2000);
         } catch (QuerySyntaxException ex) {
             log.debug("sort with first() not supported, falling back to base query", ex);
@@ -960,7 +979,7 @@ public class MapEntries implements
 
         String diagnostics = "";
         if (it instanceof PagedQueryIterator) {
-            PagedQueryIterator pit = (PagedQueryIterator)it;
+            PagedQueryIterator pit = (PagedQueryIterator) it;
 
             if (!pit.getWarning().isEmpty()) {
                 log.warn(pit.getWarning());
@@ -969,8 +988,12 @@ public class MapEntries implements
             diagnostics = pit.getStatistics();
         }
 
-        log.info("alias initialization - completed, processed {} resources with sling:alias properties in {}ms (~{} resource/s){}",
-                count, TimeUnit.NANOSECONDS.toMillis(processElapsed), resourcePerSecond, diagnostics);
+        log.info(
+                "alias initialization - completed, processed {} resources with sling:alias properties in {}ms (~{} resource/s){}",
+                count,
+                TimeUnit.NANOSECONDS.toMillis(processElapsed),
+                resourcePerSecond,
+                diagnostics);
 
         this.aliasResourcesOnStartup.set(count);
 
@@ -993,7 +1016,11 @@ public class MapEntries implements
             String sep = "";
             while (pathIterator.hasNext()) {
                 String prefix = pathIterator.next();
-                baseQuery.append(sep).append("isdescendantnode('").append(QueryBuildHelper.escapeString(prefix)).append("')");
+                baseQuery
+                        .append(sep)
+                        .append("isdescendantnode('")
+                        .append(QueryBuildHelper.escapeString(prefix))
+                        .append("')");
                 sep = " OR ";
             }
             baseQuery.append(")");
@@ -1006,8 +1033,11 @@ public class MapEntries implements
     /**
      * Load alias given a resource
      */
-    private boolean loadAlias(final Resource resource, Map<String, Map<String, Collection<String>>> map,
-                              List<String> conflictingAliases, List<String> invalidAliases) {
+    private boolean loadAlias(
+            final Resource resource,
+            Map<String, Map<String, Collection<String>>> map,
+            List<String> conflictingAliases,
+            List<String> invalidAliases) {
 
         // resource containing the alias
         final Resource containingResource = getResourceToBeAliased(resource);
@@ -1019,7 +1049,9 @@ public class MapEntries implements
             final Resource parent = containingResource.getParent();
 
             if (parent == null) {
-                log.warn("{} is null for alias on {}, skipping.", containingResource == resource ? "parent" : "grandparent",
+                log.warn(
+                        "{} is null for alias on {}, skipping.",
+                        containingResource == resource ? "parent" : "grandparent",
                         resource.getPath());
                 return false;
             } else {
@@ -1027,7 +1059,12 @@ public class MapEntries implements
                 if (aliasArray == null) {
                     return false;
                 } else {
-                    return loadAliasFromArray(aliasArray, map, conflictingAliases, invalidAliases, containingResource.getName(),
+                    return loadAliasFromArray(
+                            aliasArray,
+                            map,
+                            conflictingAliases,
+                            invalidAliases,
+                            containingResource.getName(),
                             parent.getPath());
                 }
             }
@@ -1037,8 +1074,13 @@ public class MapEntries implements
     /**
      * Load alias given a an alias array, return success flag.
      */
-    private boolean loadAliasFromArray(final String[] aliasArray, Map<String, Map<String, Collection<String>>> map,
-                                       List<String> conflictingAliases, List<String> invalidAliases, final String resourceName, final String parentPath) {
+    private boolean loadAliasFromArray(
+            final String[] aliasArray,
+            Map<String, Map<String, Collection<String>>> map,
+            List<String> conflictingAliases,
+            List<String> invalidAliases,
+            final String resourceName,
+            final String parentPath) {
 
         boolean hasAlias = false;
 
@@ -1048,28 +1090,39 @@ public class MapEntries implements
         for (final String alias : aliasArray) {
             if (isAliasInvalid(alias)) {
                 long invalids = detectedInvalidAliases.incrementAndGet();
-                log.warn("Encountered invalid alias '{}' under parent path '{}' (total so far: {}). Refusing to use it.",
-                        alias, parentPath, invalids);
+                log.warn(
+                        "Encountered invalid alias '{}' under parent path '{}' (total so far: {}). Refusing to use it.",
+                        alias,
+                        parentPath,
+                        invalids);
                 if (invalidAliases != null && invalids < MAX_REPORT_DEFUNCT_ALIASES) {
                     invalidAliases.add((String.format("'%s'/'%s'", parentPath, alias)));
                 }
             } else {
-                Map<String, Collection<String>> parentMap = map.computeIfAbsent(parentPath, key -> new ConcurrentHashMap<>());
+                Map<String, Collection<String>> parentMap =
+                        map.computeIfAbsent(parentPath, key -> new ConcurrentHashMap<>());
                 Optional<String> siblingResourceNameWithDuplicateAlias = parentMap.entrySet().stream()
                         .filter(entry -> !entry.getKey().equals(resourceName)) // ignore entry for the current resource
                         .filter(entry -> entry.getValue().contains(alias))
-                        .findFirst().map(Map.Entry::getKey);
+                        .findFirst()
+                        .map(Map.Entry::getKey);
                 if (siblingResourceNameWithDuplicateAlias.isPresent()) {
                     long conflicting = detectedConflictingAliases.incrementAndGet();
                     log.warn(
                             "Encountered duplicate alias '{}' under parent path '{}'. Refusing to replace current target '{}' with '{}' (total duplicated aliases so far: {}).",
-                            alias, parentPath, siblingResourceNameWithDuplicateAlias.get(), resourceName, conflicting);
+                            alias,
+                            parentPath,
+                            siblingResourceNameWithDuplicateAlias.get(),
+                            resourceName,
+                            conflicting);
                     if (conflictingAliases != null && conflicting < MAX_REPORT_DEFUNCT_ALIASES) {
-                        conflictingAliases.add((String.format("'%s': '%s'/'%s' vs '%s'/'%s'", parentPath, resourceName,
-                                alias, siblingResourceNameWithDuplicateAlias.get(), alias)));
+                        conflictingAliases.add((String.format(
+                                "'%s': '%s'/'%s' vs '%s'/'%s'",
+                                parentPath, resourceName, alias, siblingResourceNameWithDuplicateAlias.get(), alias)));
                     }
                 } else {
-                    Collection<String> existingAliases = parentMap.computeIfAbsent(resourceName, name -> new CopyOnWriteArrayList<>());
+                    Collection<String> existingAliases =
+                            parentMap.computeIfAbsent(resourceName, name -> new CopyOnWriteArrayList<>());
                     existingAliases.add(alias);
                     hasAlias = true;
                 }
@@ -1084,7 +1137,8 @@ public class MapEntries implements
      * @param resource resource to check
      * @return parent of jcr:content resource (may be null), otherwise the resource itself
      */
-    @Nullable private Resource getResourceToBeAliased(Resource resource) {
+    @Nullable
+    private Resource getResourceToBeAliased(Resource resource) {
         if (JCR_CONTENT.equals(resource.getName())) {
             return resource.getParent();
         } else {
@@ -1118,7 +1172,6 @@ public class MapEntries implements
         return it;
     }
 
-
     private final AtomicLong lastTimeLogged = new AtomicLong(-1);
 
     private final long LOGGING_ERROR_PERIOD = 1000 * 60 * 5;
@@ -1129,12 +1182,16 @@ public class MapEntries implements
     }
 
     private void logDisableAliasOptimization(final Exception e) {
-        if ( e != null ) {
-            log.error("Unexpected problem during initialization of optimize alias resolution. Therefore disabling optimize alias resolution. Please fix the problem.", e);
+        if (e != null) {
+            log.error(
+                    "Unexpected problem during initialization of optimize alias resolution. Therefore disabling optimize alias resolution. Please fix the problem.",
+                    e);
         } else {
             final long now = System.currentTimeMillis();
-            if ( now - lastTimeLogged.getAndSet(now) > LOGGING_ERROR_PERIOD) {
-                log.error("A problem occured during initialization of optimize alias resolution. Optimize alias resolution is disabled. Check the logs for the reported problem.", e);
+            if (now - lastTimeLogged.getAndSet(now) > LOGGING_ERROR_PERIOD) {
+                log.error(
+                        "A problem occured during initialization of optimize alias resolution. Optimize alias resolution is disabled. Check the logs for the reported problem.",
+                        e);
             }
         }
     }
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntriesHandler.java b/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntriesHandler.java
index 58c53e13..12bbf893 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntriesHandler.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntriesHandler.java
@@ -66,12 +66,12 @@ public interface MapEntriesHandler {
             return Collections.emptyMap();
         }
 
-		@Override
-		public boolean isOptimizeAliasResolutionEnabled() {
-			return false;
+        @Override
+        public boolean isOptimizeAliasResolutionEnabled() {
+            return false;
         }
 
-		@Override
+        @Override
         public void logDisableAliasOptimization() {
             // nothing to do
         }
@@ -97,7 +97,8 @@ public interface MapEntriesHandler {
      * @param parentPath the parent path
      * @return a map of all child alias entries, possibly empty
      */
-    @NotNull Map<String, Collection<String>> getAliasMap(@NotNull String parentPath);
+    @NotNull
+    Map<String, Collection<String>> getAliasMap(@NotNull String parentPath);
 
     /**
      * Creates an iterator over the possibly applicable mapping entries for resolving a resource
@@ -110,7 +111,8 @@ public interface MapEntriesHandler {
      * @param requestPath  the requestPath
      * @return the map entry iterator
      */
-    @NotNull Iterator<MapEntry> getResolveMapsIterator(@NotNull String requestPath);
+    @NotNull
+    Iterator<MapEntry> getResolveMapsIterator(@NotNull String requestPath);
 
     /**
      * Return a flat listing of map entries used for mapping resources to URLs
@@ -119,7 +121,8 @@ public interface MapEntriesHandler {
      *
      * @return an unmodifiable collection of map entries
      */
-    @NotNull Collection<MapEntry> getMapMaps();
+    @NotNull
+    Collection<MapEntry> getMapMaps();
 
     /**
      * Creates a flat listing of all the map entries used for resolving URLs to resources
@@ -131,7 +134,8 @@ public interface MapEntriesHandler {
      *
      * @return an unmodifiable, sorted, list of resolution map entries
      */
-    @NotNull List<MapEntry> getResolveMaps();
+    @NotNull
+    List<MapEntry> getResolveMaps();
 
     /**
      * Returns vanity paths mappings
@@ -140,5 +144,6 @@ public interface MapEntriesHandler {
      *
      * @return an unmodifiable list of vanity path mappings
      */
-    @NotNull Map<String, List<String>> getVanityPathMappings();
+    @NotNull
+    Map<String, List<String>> getVanityPathMappings();
 }
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntry.java b/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntry.java
index 8a4bbb7d..17ecb0b5 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntry.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntry.java
@@ -44,20 +44,20 @@ public class MapEntry implements Comparable<MapEntry> {
     private final Logger log = LoggerFactory.getLogger(getClass());
 
     private static final Pattern[] URL_WITH_PORT_MATCH = {
-        Pattern.compile("http/([^/]+)(\\.[^\\d/]+)(/.*)?$"),
-        Pattern.compile("https/([^/]+)(\\.[^\\d/]+)(/.*)?$") };
+        Pattern.compile("http/([^/]+)(\\.[^\\d/]+)(/.*)?$"), Pattern.compile("https/([^/]+)(\\.[^\\d/]+)(/.*)?$")
+    };
 
-    private static final String[] URL_WITH_PORT_REPLACEMENT = {
-        "http/$1$2.80$3", "https/$1$2.443$3" };
+    private static final String[] URL_WITH_PORT_REPLACEMENT = {"http/$1$2.80$3", "https/$1$2.443$3"};
 
     private static final Pattern[] PATH_TO_URL_MATCH = {
         Pattern.compile("http/([^/]+)\\.80(/.*)?$"),
         Pattern.compile("https/([^/]+)\\.443(/.*)?$"),
         Pattern.compile("([^/]+)/([^/]+)\\.(\\d+)(/.*)?$"),
-        Pattern.compile("([^/]+)/([^/]+)(/.*)?$") };
+        Pattern.compile("([^/]+)/([^/]+)(/.*)?$")
+    };
 
-    private static final String[] PATH_TO_URL_REPLACEMENT = { "http://$1$2",
-        "https://$1$2", "$1://$2:$3$4", "$1://$2$3" };
+    private static final String[] PATH_TO_URL_REPLACEMENT = {"http://$1$2", "https://$1$2", "$1://$2:$3$4", "$1://$2$3"
+    };
 
     private final Pattern urlPattern;
 
@@ -90,13 +90,11 @@ public class MapEntry implements Comparable<MapEntry> {
      *            The (absolute) path
      * @return The request path string {scheme}://{host}:{port}{path}.
      */
-    public static String getURI(final String scheme, final String host, final int port,
-                    final String path) {
+    public static String getURI(final String scheme, final String host, final int port, final String path) {
 
         final StringBuilder sb = new StringBuilder();
         sb.append(scheme).append("://").append(host);
-        if (port > 0 && !(port == 80 && "http".equals(scheme))
-                        && !(port == 443 && "https".equals(scheme))) {
+        if (port > 0 && !(port == 80 && "http".equals(scheme)) && !(port == 443 && "https".equals(scheme))) {
             sb.append(':').append(port);
         }
         sb.append(path);
@@ -108,10 +106,9 @@ public class MapEntry implements Comparable<MapEntry> {
         for (int i = 0; i < URL_WITH_PORT_MATCH.length; i++) {
             final Matcher m = URL_WITH_PORT_MATCH[i].matcher(uriPath);
             if (m.find()) {
-            	if (!isRegExp(m.replaceAll("$1$2")))
-            	{
+                if (!isRegExp(m.replaceAll("$1$2"))) {
                     return m.replaceAll(URL_WITH_PORT_REPLACEMENT[i]);
-            	}
+                }
             }
         }
 
@@ -137,25 +134,21 @@ public class MapEntry implements Comparable<MapEntry> {
         return null;
     }
 
-    public static MapEntry createResolveEntry(String url, final Resource resource,
-                    final boolean trailingSlash) {
+    public static MapEntry createResolveEntry(String url, final Resource resource, final boolean trailingSlash) {
         final ValueMap props = resource.adaptTo(ValueMap.class);
         if (props != null) {
 
             // ensure the url contains a port number (if possible)
             url = fixUriPath(url);
 
-            final String redirect = props.get(
-                            MapEntries.PROP_REDIRECT_EXTERNAL, String.class);
+            final String redirect = props.get(MapEntries.PROP_REDIRECT_EXTERNAL, String.class);
             if (redirect != null) {
-                final int status = props
-                                .get(MapEntries.PROP_REDIRECT_EXTERNAL_STATUS,
-                                                302);
+                final int status = props.get(MapEntries.PROP_REDIRECT_EXTERNAL_STATUS, 302);
                 return new MapEntry(url, status, trailingSlash, 0, redirect);
             }
 
-            final String[] internalRedirectProps = props.get(ResourceResolverImpl.PROP_REDIRECT_INTERNAL,
-                String[].class);
+            final String[] internalRedirectProps =
+                    props.get(ResourceResolverImpl.PROP_REDIRECT_INTERNAL, String[].class);
             final String[] internalRedirect = filterRegExp(internalRedirectProps);
             if (internalRedirect != null) {
                 return new MapEntry(url, -1, trailingSlash, 0, internalRedirect);
@@ -165,27 +158,27 @@ public class MapEntry implements Comparable<MapEntry> {
         return null;
     }
 
-    public static List<MapEntry> createMapEntry(String url, final Resource resource,
-                    final boolean trailingSlash) {
+    public static List<MapEntry> createMapEntry(String url, final Resource resource, final boolean trailingSlash) {
         final ValueMap props = resource.adaptTo(ValueMap.class);
         if (props != null) {
-            final String redirect = props.get(
-                            MapEntries.PROP_REDIRECT_EXTERNAL, String.class);
+            final String redirect = props.get(MapEntries.PROP_REDIRECT_EXTERNAL, String.class);
             if (redirect != null) {
                 // ignoring external redirects for mapping
-                LoggerFactory
-                .getLogger(MapEntry.class)
-                .info("createMapEntry: Configuration has external redirect to {}; not creating mapping for configuration in {}",
-                                redirect, resource.getPath());
+                LoggerFactory.getLogger(MapEntry.class)
+                        .info(
+                                "createMapEntry: Configuration has external redirect to {}; not creating mapping for configuration in {}",
+                                redirect,
+                                resource.getPath());
                 return null;
             }
 
             // ignore potential regular expression url
             if (isRegExp(url)) {
-                LoggerFactory
-                .getLogger(MapEntry.class)
-                .info("createMapEntry: URL {} contains a regular expression; not creating mapping for configuration in {}",
-                                url, resource.getPath());
+                LoggerFactory.getLogger(MapEntry.class)
+                        .info(
+                                "createMapEntry: URL {} contains a regular expression; not creating mapping for configuration in {}",
+                                url,
+                                resource.getPath());
 
                 return null;
             }
@@ -202,9 +195,7 @@ public class MapEntry implements Comparable<MapEntry> {
                 url = url.substring(MapEntries.ANY_SCHEME_HOST.length());
             }
 
-            final String[] internalRedirect = props
-                            .get(ResourceResolverImpl.PROP_REDIRECT_INTERNAL,
-                                            String[].class);
+            final String[] internalRedirect = props.get(ResourceResolverImpl.PROP_REDIRECT_INTERNAL, String[].class);
             if (internalRedirect != null) {
 
                 // check whether the url is considered external or internal
@@ -215,22 +206,20 @@ public class MapEntry implements Comparable<MapEntry> {
                     status = 302;
                 }
 
-                final List<MapEntry> prepEntries = new ArrayList<MapEntry>(
-                                internalRedirect.length);
+                final List<MapEntry> prepEntries = new ArrayList<MapEntry>(internalRedirect.length);
                 for (final String redir : internalRedirect) {
                     if (!redir.contains("$")) {
-                    	MapEntry mapEntry = null;
-                    	try{
-                    		mapEntry = new MapEntry(redir.concat(endHook), status, trailingSlash, 0, url);
-                    	}catch (IllegalArgumentException iae){
-                    		//ignore this entry
-                            LoggerFactory
-                            .getLogger(MapEntry.class)
-                    		.debug("Ignoring mapping due to exception: " + iae.getMessage(), iae);
-                    	}
-                    	if (mapEntry!=null){
-                    		prepEntries.add(mapEntry);
-                    	}
+                        MapEntry mapEntry = null;
+                        try {
+                            mapEntry = new MapEntry(redir.concat(endHook), status, trailingSlash, 0, url);
+                        } catch (IllegalArgumentException iae) {
+                            // ignore this entry
+                            LoggerFactory.getLogger(MapEntry.class)
+                                    .debug("Ignoring mapping due to exception: " + iae.getMessage(), iae);
+                        }
+                        if (mapEntry != null) {
+                            prepEntries.add(mapEntry);
+                        }
                     }
                 }
 
@@ -243,8 +232,8 @@ public class MapEntry implements Comparable<MapEntry> {
         return null;
     }
 
-    public MapEntry(String url, final int status, final boolean trailingSlash,
-                    final long order, final String... redirect) {
+    public MapEntry(
+            String url, final int status, final boolean trailingSlash, final long order, final String... redirect) {
 
         // ensure trailing slashes on redirects if the url
         // ends with a trailing slash
@@ -261,9 +250,9 @@ public class MapEntry implements Comparable<MapEntry> {
         }
 
         try {
-        	this.urlPattern = Pattern.compile(url);
-        } catch (Exception e){
-        	throw new IllegalArgumentException("Bad url pattern: " + url,e);
+            this.urlPattern = Pattern.compile(url);
+        } catch (Exception e) {
+            throw new IllegalArgumentException("Bad url pattern: " + url, e);
         }
 
         this.redirect = redirect;
@@ -273,7 +262,7 @@ public class MapEntry implements Comparable<MapEntry> {
 
     /**
      * Replaces the specified value according to the rules of this entry
-     * 
+     *
      * @param value the value to replace
      * @return a replaced value of <code>null</code> if the value does not match
      */
@@ -283,26 +272,26 @@ public class MapEntry implements Comparable<MapEntry> {
             final String[] redirects = getRedirect();
             final List<String> results = new ArrayList<>(redirects.length);
             for (int i = 0; i < redirects.length; i++) {
-            	try {
-            		String redirect = redirects[i];
-            		// SLING-7881 - if the value is a selector on the root resource then the
-            		// result will need to remove the trailing slash from the path
-            		if (redirect.length() > 1 && redirect.endsWith("/")) {
-            			if (value.length() > m.end()) {
-            				if ('.' == value.charAt(m.end())) {
-            					//the suffix starts with a dot and the redirect prefix ends with
-            					// a slash so we need to remove the trailing slash from the prefix
-            					// value to make a valid path when they are combined.
-            					// 
-            					// for example: http/localhost.8080/.2.json should become /content.2.json
-            					//   instead of /content/.2.json
-            					redirect = redirect.substring(0, redirect.length() - 1);
-            				}
-            			}
-            		}
-            		results.add(m.replaceFirst(redirect));
-            	} catch (final StringIndexOutOfBoundsException | IllegalArgumentException ex){
-            		log.debug("Exception while replacing, ignoring entry {} ", redirects[i], ex);
+                try {
+                    String redirect = redirects[i];
+                    // SLING-7881 - if the value is a selector on the root resource then the
+                    // result will need to remove the trailing slash from the path
+                    if (redirect.length() > 1 && redirect.endsWith("/")) {
+                        if (value.length() > m.end()) {
+                            if ('.' == value.charAt(m.end())) {
+                                // the suffix starts with a dot and the redirect prefix ends with
+                                // a slash so we need to remove the trailing slash from the prefix
+                                // value to make a valid path when they are combined.
+                                //
+                                // for example: http/localhost.8080/.2.json should become /content.2.json
+                                //   instead of /content/.2.json
+                                redirect = redirect.substring(0, redirect.length() - 1);
+                            }
+                        }
+                    }
+                    results.add(m.replaceFirst(redirect));
+                } catch (final StringIndexOutOfBoundsException | IllegalArgumentException ex) {
+                    log.debug("Exception while replacing, ignoring entry {} ", redirects[i], ex);
                 }
             }
             return !results.isEmpty() ? results.toArray(new String[0]) : null;
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntryIterator.java b/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntryIterator.java
index bb399824..32506f1d 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntryIterator.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntryIterator.java
@@ -18,15 +18,15 @@
  */
 package org.apache.sling.resourceresolver.impl.mapping;
 
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 import java.util.NoSuchElementException;
 import java.util.function.Function;
 
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
 /**
  * An {@link Iterator} that combines existing {@link MapEntry}s (usually from the "global" list)
  * with entries from the vanity path map.
@@ -53,9 +53,11 @@ class MapEntryIterator implements Iterator<MapEntry> {
      * @param getCurrentMapEntryIteratorForVanityPath a function that gets the current vanity path entry for a given key (the callback should take care about which phase the vanity path initialization is in)
      * @param vanityPathPrecedence when {@code true}, vanity paths (if present) will always come first, otherwise it depends on the length of the map entry's match pattern (see {@link MapEntry#getPattern()})
      */
-    public MapEntryIterator(final @Nullable String startKey, @NotNull List<MapEntry> globalList,
-                            final @NotNull Function<String, Iterator<MapEntry>> getCurrentMapEntryIteratorForVanityPath,
-                            final boolean vanityPathPrecedence) {
+    public MapEntryIterator(
+            final @Nullable String startKey,
+            @NotNull List<MapEntry> globalList,
+            final @NotNull Function<String, Iterator<MapEntry>> getCurrentMapEntryIteratorForVanityPath,
+            final boolean vanityPathPrecedence) {
         this.key = startKey;
         this.globalListIterator = globalList.iterator();
         this.vanityPathPrecedence = vanityPathPrecedence;
@@ -103,7 +105,8 @@ class MapEntryIterator implements Iterator<MapEntry> {
             // map entries for that path (or stop when root is reached)
             while (!this.specialIterator.hasNext() && this.key != null) {
                 this.key = removeSelectorsAndExtension(this.key);
-                this.specialIterator = nullIteratorToEmpty(this.getCurrentMapEntryIteratorForVanityPath.apply(this.key));
+                this.specialIterator =
+                        nullIteratorToEmpty(this.getCurrentMapEntryIteratorForVanityPath.apply(this.key));
                 this.key = getParent(key);
             }
 
@@ -135,7 +138,8 @@ class MapEntryIterator implements Iterator<MapEntry> {
             return false;
         } else {
             // decide based on pattern length
-            return this.nextGlobal.getPattern().length() >= this.nextSpecial.getPattern().length();
+            return this.nextGlobal.getPattern().length()
+                    >= this.nextSpecial.getPattern().length();
         }
     }
 
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/mapping/Mapping.java b/src/main/java/org/apache/sling/resourceresolver/impl/mapping/Mapping.java
index 4d4f0d93..df1e5949 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/mapping/Mapping.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/mapping/Mapping.java
@@ -68,8 +68,7 @@ public class Mapping {
     // 1 - external path prefix
     // 2 - direction (Outbound (>), Bidirectional (:), Inbound (>))
     // 3 - internap path prefix
-    private static final Pattern CONFIG_SPLITTER = Pattern
-            .compile("(.+)([:<>])(.+)");
+    private static final Pattern CONFIG_SPLITTER = Pattern.compile("(.+)([:<>])(.+)");
 
     /** the 'from' (inside, repository) mapping */
     private final String from;
@@ -96,14 +95,14 @@ public class Mapping {
         this.fromLength = this.from.length();
         this.toLength = this.to.length();
 
-        this.direction = ">".equals(parts[1]) ? Mapping.INBOUND : ("<"
-                .equals(parts[1]) ? Mapping.OUTBOUND : Mapping.BOTH);
+        this.direction =
+                ">".equals(parts[1]) ? Mapping.INBOUND : ("<".equals(parts[1]) ? Mapping.OUTBOUND : Mapping.BOTH);
     }
 
     @Override
     public String toString() {
-        return "Mapping (from=" + from + ", to=" + to + ", direction="
-                + direction + ", lengths=" + fromLength + "/" + toLength;
+        return "Mapping (from=" + from + ", to=" + to + ", direction=" + direction + ", lengths=" + fromLength + "/"
+                + toLength;
     }
 
     /**
@@ -112,7 +111,7 @@ public class Mapping {
      * <code>uriPath</code> does not start with the <em>to</em> prefix, or if
      * this mapping is not defined as a 'inward' mapping, <code>null</code> is
      * returned.
-     * 
+     *
      * @param uriPath
      *            The URI path for which to replace the <em>to</em> prefix by
      *            the <em>from</em> prefix.
@@ -121,8 +120,9 @@ public class Mapping {
      *         or {@link #mapsInbound()} returns <code>false</code>.
      */
     public String mapUri(String uriPath) {
-        return (this.mapsInbound() && uriPath.startsWith(this.to)) ? this.from
-                + uriPath.substring(this.toLength) : null;
+        return (this.mapsInbound() && uriPath.startsWith(this.to))
+                ? this.from + uriPath.substring(this.toLength)
+                : null;
     }
 
     /**
@@ -131,7 +131,7 @@ public class Mapping {
      * <code>uriPath</code> does not start with the <em>from</em> prefix, or if
      * this mapping is not defined as a 'outward' mapping, <code>null</code> is
      * returned.
-     * 
+     *
      * @param handle
      *            The URI path for which to replace the <em>from</em> prefix by
      *            the <em>to</em> prefix.
@@ -140,8 +140,9 @@ public class Mapping {
      *         or {@link #mapsOutbound()} returns <code>false</code>.
      */
     public String mapHandle(String handle) {
-        return (this.mapsOutbound() && handle.startsWith(this.from)) ? this.to
-                + handle.substring(this.fromLength) : null;
+        return (this.mapsOutbound() && handle.startsWith(this.from))
+                ? this.to + handle.substring(this.fromLength)
+                : null;
     }
 
     // TODO: temporary
@@ -156,7 +157,7 @@ public class Mapping {
 
     /**
      * Checks, if this mapping is defined for inbound mapping.
-     * 
+     *
      * @return <code>true</code> if this mapping is defined for inbound mapping;
      *         <code>false</code> otherwise
      */
@@ -166,7 +167,7 @@ public class Mapping {
 
     /**
      * Checks, if this mapping is defined for outbound mapping.
-     * 
+     *
      * @return <code>true</code> if this mapping is defined for outbound
      *         mapping; <code>false</code> otherwise
      */
@@ -190,19 +191,17 @@ public class Mapping {
         // standard case of mapping <path>[<:>]<path>
         Matcher mapMatch = CONFIG_SPLITTER.matcher(map);
         if (mapMatch.matches()) {
-            return new String[] { mapMatch.group(1), mapMatch.group(2),
-                    mapMatch.group(3) };
+            return new String[] {mapMatch.group(1), mapMatch.group(2), mapMatch.group(3)};
         }
 
         // backwards compatibility using "-" instead of ":"
         int dash = map.indexOf('-');
         if (dash > 0) {
-            return new String[] { map.substring(0, dash),
-                    map.substring(dash, dash + 1),
-                    map.substring(dash + 1, map.length()) };
+            return new String[] {
+                map.substring(0, dash), map.substring(dash, dash + 1), map.substring(dash + 1, map.length())
+            };
         }
 
-        return new String[] { map, "-", map };
+        return new String[] {map, "-", map};
     }
-
 }
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/mapping/PagedQueryIterator.java b/src/main/java/org/apache/sling/resourceresolver/impl/mapping/PagedQueryIterator.java
index 466d16c1..40356f06 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/mapping/PagedQueryIterator.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/mapping/PagedQueryIterator.java
@@ -18,16 +18,16 @@
  */
 package org.apache.sling.resourceresolver.impl.mapping;
 
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+import java.util.concurrent.TimeUnit;
+
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.jetbrains.annotations.NotNull;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import java.util.concurrent.TimeUnit;
-
 /**
  * Utility class for running paged queries.
  */
@@ -61,7 +61,8 @@ public class PagedQueryIterator implements Iterator<Resource> {
      * @param query query string in SQL2 syntax
      * @param pageSize page size (start a new query after page size is exceeded)
      */
-    public PagedQueryIterator(String subject, String propertyName, ResourceResolver resolver, String query, int pageSize) {
+    public PagedQueryIterator(
+            String subject, String propertyName, ResourceResolver resolver, String query, int pageSize) {
         this.subject = subject;
         this.propertyName = propertyName;
         this.resolver = resolver;
@@ -89,13 +90,15 @@ public class PagedQueryIterator implements Iterator<Resource> {
         if (values.length > 0) {
             String value = values[0];
             if (value.compareTo(lastKey) < 0) {
-                String message = String.format("unexpected query result in page %d, property name '%s', got '%s', despite querying for > '%s'",
+                String message = String.format(
+                        "unexpected query result in page %d, property name '%s', got '%s', despite querying for > '%s'",
                         (page - 1), propertyName, value, lastKey);
                 log.error(message);
                 throw new QueryImplementationException(message);
             }
             if (lastValue != null && value.compareTo(lastValue) < 0) {
-                String message = String.format("unexpected query result in page %d, property name '%s', got '%s', last value was '%s'",
+                String message = String.format(
+                        "unexpected query result in page %d, property name '%s', got '%s', last value was '%s'",
                         (page - 1), propertyName, value, lastValue);
                 log.error(message);
                 throw new QueryImplementationException(message);
@@ -152,8 +155,13 @@ public class PagedQueryIterator implements Iterator<Resource> {
 
     private void updatePageStats() {
         largestPage = Math.max(largestPage, count - 1);
-        log.debug("read {} query (page {}); {} entries, last key was: {}, largest page so far: {}", subject, page - 1,
-                count, lastKey, largestPage);
+        log.debug(
+                "read {} query (page {}); {} entries, last key was: {}, largest page so far: {}",
+                subject,
+                page - 1,
+                count,
+                lastKey,
+                largestPage);
     }
 
     public @NotNull String getStatistics() {
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/mapping/PathGenerator.java b/src/main/java/org/apache/sling/resourceresolver/impl/mapping/PathGenerator.java
index a3bcd3d7..220d5b78 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/mapping/PathGenerator.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/mapping/PathGenerator.java
@@ -30,75 +30,72 @@ import org.jetbrains.annotations.Nullable;
 
 /**
  * Utility to generate all possible paths from segments (names)
- * 
+ *
  * <p>This class expects to be supplied segments starting with the top-most ones (leaves)
  * up until, but excluding, the root.</p>
- * 
+ *
  * <p>It generates all possible path combinations using a cartesian product that accummulates
  * using a {@link StringBuilder} instead of a set, to prevent intermediate object creation.</p>
  */
 public class PathGenerator {
-    
+
     private static List<String> cartesianJoin(List<List<String>> segments, String toAppend) {
-        
+
         return cartesianJoin0(0, segments, toAppend).stream()
-                .map( StringBuilder::toString )
-                .collect( Collectors.toList() );
+                .map(StringBuilder::toString)
+                .collect(Collectors.toList());
     }
-    
+
     private static List<StringBuilder> cartesianJoin0(int index, List<List<String>> segments, String toAppend) {
         List<StringBuilder> out = new ArrayList<>();
-        if ( index == segments.size() ) {
+        if (index == segments.size()) {
             out.add(new StringBuilder("/"));
         } else {
-            for ( String segment : segments.get(index) ) {
-                for (StringBuilder sb : cartesianJoin0(index + 1, segments, toAppend) ) {
+            for (String segment : segments.get(index)) {
+                for (StringBuilder sb : cartesianJoin0(index + 1, segments, toAppend)) {
                     sb.append(segment);
-                    if ( index != 0 )
-                        sb.append('/');
-                    else if ( toAppend != null )
-                        sb.append(toAppend);
+                    if (index != 0) sb.append('/');
+                    else if (toAppend != null) sb.append(toAppend);
                     out.add(sb);
                 }
             }
         }
-        
+
         return out;
     }
 
     private List<List<String>> segments = new ArrayList<>();
     private String toAppend;
-    
+
     /**
      * Inserts a new segment as the parent of the existing ones
-     * 
+     *
      * @param alias the list of aliases
      * @param name the name
      */
     public void insertSegment(@NotNull Collection<String> alias, @NotNull String name) {
-        
-        List<String> filtered = Stream.concat(alias.stream(), Stream.of(name) )
-            .filter( e -> e != null && ! e.isEmpty() )
-            .collect(Collectors.toList());
-        
-        if ( filtered.isEmpty() )
-            filtered = Collections.singletonList("");
-        
+
+        List<String> filtered = Stream.concat(alias.stream(), Stream.of(name))
+                .filter(e -> e != null && !e.isEmpty())
+                .collect(Collectors.toList());
+
+        if (filtered.isEmpty()) filtered = Collections.singletonList("");
+
         segments.add(filtered);
     }
-    
+
     /**
      * Sets the resolution info, to be appended at the end
-     * 
+     *
      * @param resolutionInfo the resolution info to append, ignored if null or empty
      */
     public void setResolutionPathInfo(@Nullable String resolutionInfo) {
         this.toAppend = resolutionInfo;
     }
-    
+
     /**
      * Generates all possible paths
-     * 
+     *
      * @return a list of paths containing at least one entry
      */
     public List<String> generatePaths() {
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/mapping/ResourceMapperImpl.java b/src/main/java/org/apache/sling/resourceresolver/impl/mapping/ResourceMapperImpl.java
index ace5dce3..fb3cc18c 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/mapping/ResourceMapperImpl.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/mapping/ResourceMapperImpl.java
@@ -27,7 +27,6 @@ import java.util.List;
 import java.util.function.UnaryOperator;
 
 import jakarta.servlet.http.HttpServletRequest;
-
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceUtil;
 import org.apache.sling.api.resource.mapping.ResourceMapper;
@@ -50,9 +49,11 @@ public class ResourceMapperImpl implements ResourceMapper {
     private final MapEntriesHandler mapEntries;
     private final Object namespaceMangler;
 
-
-    public ResourceMapperImpl(ResourceResolverImpl resolver, ResourceDecoratorTracker resourceDecorator,
-            MapEntriesHandler mapEntries, Object namespaceMangler) {
+    public ResourceMapperImpl(
+            ResourceResolverImpl resolver,
+            ResourceDecoratorTracker resourceDecorator,
+            MapEntriesHandler mapEntries,
+            Object namespaceMangler) {
         this.resolver = resolver;
         this.resourceDecorator = resourceDecorator;
         this.mapEntries = mapEntries;
@@ -61,14 +62,13 @@ public class ResourceMapperImpl implements ResourceMapper {
 
     @Override
     public String getMapping(String resourcePath) {
-        return getMapping(resourcePath, (HttpServletRequest)null);
+        return getMapping(resourcePath, (HttpServletRequest) null);
     }
 
     @Override
     public String getMapping(String resourcePath, HttpServletRequest request) {
         Collection<String> mappings = getAllMappings(resourcePath, request);
-        if ( mappings.isEmpty() )
-            return null;
+        if (mappings.isEmpty()) return null;
 
         return mappings.iterator().next();
     }
@@ -76,15 +76,14 @@ public class ResourceMapperImpl implements ResourceMapper {
     @Override
     public String getMapping(String resourcePath, javax.servlet.http.HttpServletRequest request) {
         Collection<String> mappings = getAllMappings(resourcePath, request);
-        if ( mappings.isEmpty() )
-            return null;
+        if (mappings.isEmpty()) return null;
 
         return mappings.iterator().next();
     }
 
     @Override
     public Collection<String> getAllMappings(String resourcePath) {
-        return getAllMappings(resourcePath, (HttpServletRequest)null);
+        return getAllMappings(resourcePath, (HttpServletRequest) null);
     }
 
     @Override
@@ -121,7 +120,8 @@ public class ResourceMapperImpl implements ResourceMapper {
         //  resource path → aliases
         //  aliases → mappings
         //
-        // After all are processed we reverse the order to preserve the logic of the old ResourceResolver.map() method (last
+        // After all are processed we reverse the order to preserve the logic of the old ResourceResolver.map() method
+        // (last
         // found wins) and also make sure that no duplicates are added.
         //
         // There is some room for improvement here by using a data structure that does not need reversing ( ArrayList
@@ -144,8 +144,8 @@ public class ResourceMapperImpl implements ResourceMapper {
         if (fragmentQueryMark >= 0) {
             fragmentQuery = resourcePath.substring(fragmentQueryMark);
             mappedPath = resourcePath.substring(0, fragmentQueryMark);
-            logger.debug("map: Splitting resource path '{}' into '{}' and '{}'", resourcePath, mappedPath,
-                    fragmentQuery);
+            logger.debug(
+                    "map: Splitting resource path '{}' into '{}' and '{}'", resourcePath, mappedPath, fragmentQuery);
         } else {
             fragmentQuery = null;
             mappedPath = resourcePath;
@@ -169,8 +169,7 @@ public class ResourceMapperImpl implements ResourceMapper {
         }
 
         // 5. add the requested path itself, if not already populated
-        if ( !mappedPath.isEmpty() && !mappings.contains(mappedPath))
-            mappings.add(0, mappedPath);
+        if (!mappedPath.isEmpty() && !mappings.contains(mappedPath)) mappings.add(0, mappedPath);
 
         // 6. add vanity paths
         List<String> vanityPaths = mapEntries.getVanityPathMappings().getOrDefault(mappedPath, Collections.emptyList());
@@ -178,7 +177,7 @@ public class ResourceMapperImpl implements ResourceMapper {
         mappings.addAll(0, vanityPaths);
 
         // 7. final effort to make sure we have at least one mapped path
-        if ( mappings.isEmpty() ) {
+        if (mappings.isEmpty()) {
             mappings.add(nonDecoratedResource != null ? nonDecoratedResource.getPath() : "/");
         }
 
@@ -186,14 +185,12 @@ public class ResourceMapperImpl implements ResourceMapper {
         mappings.replaceAll(new ApplyContextPath(requestContext));
 
         // 9. set back the fragment query if needed
-        if ( fragmentQuery != null ) {
+        if (fragmentQuery != null) {
             mappings.replaceAll(path -> path.concat(fragmentQuery));
         }
 
         if (logger.isDebugEnabled()) {
-            mappings.forEach(path ->
-                logger.debug("map: Returning URL {} as mapping for path {}", path, resourcePath)
-            );
+            mappings.forEach(path -> logger.debug("map: Returning URL {} as mapping for path {}", path, resourcePath));
         }
 
         Collections.reverse(mappings);
@@ -202,7 +199,7 @@ public class ResourceMapperImpl implements ResourceMapper {
     }
 
     private List<String> loadAliasesIfApplicable(final Resource nonDecoratedResource) {
-        //Invoke the decorator for the resolved resource
+        // Invoke the decorator for the resolved resource
         Resource res = resourceDecorator.decorate(nonDecoratedResource);
 
         // keep, what we might have cut off in internal resolution
@@ -232,59 +229,57 @@ public class ResourceMapperImpl implements ResourceMapper {
         return mappedPaths;
     }
 
-	private void resolveAliases(Resource res, PathGenerator pathBuilder) {
-		Resource current = res;
+    private void resolveAliases(Resource res, PathGenerator pathBuilder) {
+        Resource current = res;
         String path = res.getPath();
         if (this.mapEntries.isOptimizeAliasResolutionEnabled()) {
-        	// this code path avoids any creation of Sling Resource objects
-        	while (path != null) {
-	            Collection<String> aliases = Collections.emptyList();
-	            // read alias only if we can read the resources and it's not a jcr:content leaf
-	            if (!path.endsWith(ResourceResolverImpl.JCR_CONTENT_LEAF)) {
-	                aliases = readAliasesOptimized(path);
-	            }
-	            // build the path from the name segments or aliases
-	            pathBuilder.insertSegment(aliases, ResourceUtil.getName(path));
-	            path = ResourceUtil.getParent(path);
-	            if ("/".equals(path)) {
-	                path = null;
-	            }
-	        }
-        }
-        else {
-        	// while here there Resources are resolved
-	        while (path != null) {
-	            List<String> aliases = Collections.emptyList();
-	            // read alias only if we can read the resources and it's not a jcr:content leaf
-	            if (current != null && !path.endsWith(ResourceResolverImpl.JCR_CONTENT_LEAF)) {
-	                aliases = readAliases(path, current);
-	            }
-	            // build the path from the name segments or aliases
-	            pathBuilder.insertSegment(aliases, ResourceUtil.getName(path));
-	            path = ResourceUtil.getParent(path);
-	            if ("/".equals(path)) {
-	                path = null;
-	            } else if (path != null) {
-	                current = resolver.resolve(path);
-	            }
-	        }
+            // this code path avoids any creation of Sling Resource objects
+            while (path != null) {
+                Collection<String> aliases = Collections.emptyList();
+                // read alias only if we can read the resources and it's not a jcr:content leaf
+                if (!path.endsWith(ResourceResolverImpl.JCR_CONTENT_LEAF)) {
+                    aliases = readAliasesOptimized(path);
+                }
+                // build the path from the name segments or aliases
+                pathBuilder.insertSegment(aliases, ResourceUtil.getName(path));
+                path = ResourceUtil.getParent(path);
+                if ("/".equals(path)) {
+                    path = null;
+                }
+            }
+        } else {
+            // while here there Resources are resolved
+            while (path != null) {
+                List<String> aliases = Collections.emptyList();
+                // read alias only if we can read the resources and it's not a jcr:content leaf
+                if (current != null && !path.endsWith(ResourceResolverImpl.JCR_CONTENT_LEAF)) {
+                    aliases = readAliases(path, current);
+                }
+                // build the path from the name segments or aliases
+                pathBuilder.insertSegment(aliases, ResourceUtil.getName(path));
+                path = ResourceUtil.getParent(path);
+                if ("/".equals(path)) {
+                    path = null;
+                } else if (path != null) {
+                    current = resolver.resolve(path);
+                }
+            }
         }
-	}
-
-	/**
-	 * Resolve the aliases for the given resource by directly reading the sling:alias property
-	 * @param path the path of the resource
-	 * @param current the resource
-	 * @return
-	 */
+    }
+
+    /**
+     * Resolve the aliases for the given resource by directly reading the sling:alias property
+     * @param path the path of the resource
+     * @param current the resource
+     * @return
+     */
     private List<String> readAliases(String path, Resource current) {
-    	logger.debug("map: Optimize Alias Resolution is Disabled");
-    	String[] aliases = ResourceResolverControl.getProperty(current, ResourceResolverImpl.PROP_ALIAS, String[].class);
-    	if ( aliases == null || aliases.length == 0 )
-    		return Collections.emptyList();
-    	if ( aliases.length == 1 )
-    		return Collections.singletonList(aliases[0]);
-    	return Arrays.asList(aliases);
+        logger.debug("map: Optimize Alias Resolution is Disabled");
+        String[] aliases =
+                ResourceResolverControl.getProperty(current, ResourceResolverImpl.PROP_ALIAS, String[].class);
+        if (aliases == null || aliases.length == 0) return Collections.emptyList();
+        if (aliases.length == 1) return Collections.singletonList(aliases[0]);
+        return Arrays.asList(aliases);
     }
 
     /**
@@ -294,20 +289,20 @@ public class ResourceMapperImpl implements ResourceMapper {
      * @return
      */
     private Collection<String> readAliasesOptimized(String path) {
-    	logger.debug("map: Optimize Alias Resolution is Enabled");
-    	String parentPath = ResourceUtil.getParent(path);
-    	if ( parentPath == null ) {
-    		return Collections.emptyList();
-    	}
-    	String name = ResourceUtil.getName(path);
-
-    	return mapEntries.getAliasMap(parentPath).getOrDefault(name, Collections.emptyList());
+        logger.debug("map: Optimize Alias Resolution is Enabled");
+        String parentPath = ResourceUtil.getParent(path);
+        if (parentPath == null) {
+            return Collections.emptyList();
+        }
+        String name = ResourceUtil.getName(path);
+
+        return mapEntries.getAliasMap(parentPath).getOrDefault(name, Collections.emptyList());
     }
 
-    private void populateMappingsFromMapEntries(List<String> mappings, List<String> mappedPathList,
-            final RequestContext requestContext) {
+    private void populateMappingsFromMapEntries(
+            List<String> mappings, List<String> mappedPathList, final RequestContext requestContext) {
         boolean mappedPathIsUrl = false;
-        for ( String mappedPath : mappedPathList ) {
+        for (String mappedPath : mappedPathList) {
             for (final MapEntry mapEntry : mapEntries.getMapMaps()) {
                 final String[] mappedPaths = mapEntry.replace(mappedPath);
                 if (mappedPaths != null) {
@@ -316,17 +311,20 @@ public class ResourceMapperImpl implements ResourceMapper {
 
                     mappedPathIsUrl = !mapEntry.isInternal();
 
-                    if (mappedPathIsUrl && requestContext.hasUri() ) {
+                    if (mappedPathIsUrl && requestContext.hasUri()) {
 
                         mappedPath = null;
 
                         for (final String candidate : mappedPaths) {
                             if (candidate.startsWith(requestContext.getUri())) {
-                                mappedPath = candidate.substring(requestContext.getUri().length() - 1);
+                                mappedPath = candidate.substring(
+                                        requestContext.getUri().length() - 1);
                                 mappedPathIsUrl = false;
-                                logger.debug("map: Found host specific mapping {} resolving to {}", candidate, mappedPath);
+                                logger.debug(
+                                        "map: Found host specific mapping {} resolving to {}", candidate, mappedPath);
                                 break;
-                            } else if (candidate.startsWith(requestContext.getSchemeWithPrefix()) && mappedPath == null) {
+                            } else if (candidate.startsWith(requestContext.getSchemeWithPrefix())
+                                    && mappedPath == null) {
                                 mappedPath = candidate;
                             }
                         }
@@ -339,7 +337,6 @@ public class ResourceMapperImpl implements ResourceMapper {
 
                         // we can only go with assumptions selecting the first entry
                         mappedPath = mappedPaths[0];
-
                     }
 
                     logger.debug("map: MapEntry {} matches, mapped path is {}", mapEntry, mappedPath);
@@ -359,11 +356,14 @@ public class ResourceMapperImpl implements ResourceMapper {
         private final String contextPath;
 
         private RequestContext(HttpServletRequest request, String resourcePath) {
-            if ( request != null ) {
+            if (request != null) {
                 this.uri = MapEntry.getURI(request.getScheme(), request.getServerName(), request.getServerPort(), "/");
                 this.schemeWithPrefix = request.getScheme().concat("://");
-                logger.debug("map: Mapping path {} for {} (at least with scheme prefix {})",  resourcePath,
-                        uri, schemeWithPrefix );
+                logger.debug(
+                        "map: Mapping path {} for {} (at least with scheme prefix {})",
+                        resourcePath,
+                        uri,
+                        schemeWithPrefix);
             } else {
                 this.uri = null;
                 this.schemeWithPrefix = null;
@@ -373,11 +373,14 @@ public class ResourceMapperImpl implements ResourceMapper {
         }
 
         private RequestContext(javax.servlet.http.HttpServletRequest request, String resourcePath) {
-            if ( request != null ) {
+            if (request != null) {
                 this.uri = MapEntry.getURI(request.getScheme(), request.getServerName(), request.getServerPort(), "/");
                 this.schemeWithPrefix = request.getScheme().concat("://");
-                logger.debug("map: Mapping path {} for {} (at least with scheme prefix {})",  resourcePath,
-                        uri, schemeWithPrefix );
+                logger.debug(
+                        "map: Mapping path {} for {} (at least with scheme prefix {})",
+                        resourcePath,
+                        uri,
+                        schemeWithPrefix);
             } else {
                 this.uri = null;
                 this.schemeWithPrefix = null;
@@ -443,7 +446,7 @@ public class ResourceMapperImpl implements ResourceMapper {
         }
 
         private String mangleNamespaces(String absPath) {
-            if ( absPath != null && namespaceMangler != null && namespaceMangler instanceof JcrNamespaceMangler ) {
+            if (absPath != null && namespaceMangler != null && namespaceMangler instanceof JcrNamespaceMangler) {
                 absPath = ((JcrNamespaceMangler) namespaceMangler).mangleNamespaces(resolver, logger, absPath);
             }
 
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/mapping/StringInterpolationProviderConfiguration.java b/src/main/java/org/apache/sling/resourceresolver/impl/mapping/StringInterpolationProviderConfiguration.java
index 56fc5986..135e06e2 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/mapping/StringInterpolationProviderConfiguration.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/mapping/StringInterpolationProviderConfiguration.java
@@ -22,16 +22,15 @@ import org.osgi.service.metatype.annotations.AttributeDefinition;
 import org.osgi.service.metatype.annotations.ObjectClassDefinition;
 
 @ObjectClassDefinition(
-    name = "Apache Sling String Interpolation Provider",
-    description = "Configures the String Interpolation Provider key/value pairs"
-)
+        name = "Apache Sling String Interpolation Provider",
+        description = "Configures the String Interpolation Provider key/value pairs")
 public @interface StringInterpolationProviderConfiguration {
 
     @AttributeDefinition(
-        name = "Placeholder Values",
-        description = "A list of key / value pairs separated by a equal (=) sign. " +
-            "The key is not permitted to contain a '=' sign as the first occurrence of '=' " +
-            "separates the key from the value. If no '=' is found the entry " +
-            "is ignored")
+            name = "Placeholder Values",
+            description = "A list of key / value pairs separated by a equal (=) sign. "
+                    + "The key is not permitted to contain a '=' sign as the first occurrence of '=' "
+                    + "separates the key from the value. If no '=' is found the entry "
+                    + "is ignored")
     String[] placeHolderKeyValuePairs() default {"phv.default.host.name=localhost"};
 }
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/mapping/StringInterpolationProviderImpl.java b/src/main/java/org/apache/sling/resourceresolver/impl/mapping/StringInterpolationProviderImpl.java
index 4994b3a7..408f272b 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/mapping/StringInterpolationProviderImpl.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/mapping/StringInterpolationProviderImpl.java
@@ -18,6 +18,9 @@
  */
 package org.apache.sling.resourceresolver.impl.mapping;
 
+import java.util.HashMap;
+import java.util.Map;
+
 import org.osgi.framework.BundleContext;
 import org.osgi.service.component.annotations.Activate;
 import org.osgi.service.component.annotations.Component;
@@ -27,14 +30,9 @@ import org.osgi.service.metatype.annotations.Designate;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.HashMap;
-import java.util.Map;
-
 @Designate(ocd = StringInterpolationProviderConfiguration.class)
 @Component
-public class StringInterpolationProviderImpl
-    implements StringInterpolationProvider
-{
+public class StringInterpolationProviderImpl implements StringInterpolationProvider {
     private static final String TYPE_ENV = "env";
 
     private static final String TYPE_PROP = "prop";
@@ -61,9 +59,9 @@ public class StringInterpolationProviderImpl
 
         String[] valueMap = config.placeHolderKeyValuePairs();
         Map<String, String> newMap = new HashMap<>();
-        for(String line: valueMap) {
+        for (String line : valueMap) {
             // Ignore no lines, empty lines and comments
-            if(line != null && !line.isEmpty() && line.charAt(0) != '#') {
+            if (line != null && !line.isEmpty() && line.charAt(0) != '#') {
                 int index = line.indexOf('=');
                 if (index <= 0) {
                     logger.warn("Placeholder Entry does not contain a key: '{}' -> ignored", line);
@@ -112,7 +110,7 @@ public class StringInterpolationProviderImpl
                 v = getVariableFromEnvironment(name);
             } else if (TYPE_PROP.equals(type)) {
                 v = getVariableFromProperty(name);
-            } else if(TYPE_CONFIG.equals(type)){
+            } else if (TYPE_CONFIG.equals(type)) {
                 v = getVariableFromBundleConfiguration(name);
             }
             if (v == null) {
@@ -129,7 +127,11 @@ public class StringInterpolationProviderImpl
         return System.getenv(name);
     }
 
-    String getVariableFromProperty(final String name) { return context == null ? null : context.getProperty(name); }
+    String getVariableFromProperty(final String name) {
+        return context == null ? null : context.getProperty(name);
+    }
 
-    String getVariableFromBundleConfiguration(final String name) { return placeholderEntries.get(name); }
+    String getVariableFromBundleConfiguration(final String name) {
+        return placeholderEntries.get(name);
+    }
 }
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/mapping/VanityPathHandler.java b/src/main/java/org/apache/sling/resourceresolver/impl/mapping/VanityPathHandler.java
index c19bc7b3..f91a57db 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/mapping/VanityPathHandler.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/mapping/VanityPathHandler.java
@@ -18,18 +18,6 @@
  */
 package org.apache.sling.resourceresolver.impl.mapping;
 
-import org.apache.commons.collections4.map.LRUMap;
-import org.apache.sling.api.resource.LoginException;
-import org.apache.sling.api.resource.QuerySyntaxException;
-import org.apache.sling.api.resource.Resource;
-import org.apache.sling.api.resource.ResourceResolver;
-import org.apache.sling.api.resource.ResourceUtil;
-import org.apache.sling.api.resource.ValueMap;
-import org.apache.sling.api.resource.path.Path;
-import org.jetbrains.annotations.Nullable;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.ArrayList;
@@ -47,6 +35,18 @@ import java.util.concurrent.atomic.AtomicLong;
 import java.util.concurrent.locks.ReentrantLock;
 import java.util.stream.Stream;
 
+import org.apache.commons.collections4.map.LRUMap;
+import org.apache.sling.api.resource.LoginException;
+import org.apache.sling.api.resource.QuerySyntaxException;
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.api.resource.ResourceUtil;
+import org.apache.sling.api.resource.ValueMap;
+import org.apache.sling.api.resource.path.Path;
+import org.jetbrains.annotations.Nullable;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 /**
  * All things related to the handling of vanity paths.
  */
@@ -95,8 +95,11 @@ public class VanityPathHandler {
 
     private final Runnable drain;
 
-    public VanityPathHandler(MapConfigurationProvider factory, Map<String, List<MapEntry>> resolveMapsMap,
-                             ReentrantLock initializing, Runnable drain) {
+    public VanityPathHandler(
+            MapConfigurationProvider factory,
+            Map<String, List<MapEntry>> resolveMapsMap,
+            ReentrantLock initializing,
+            Runnable drain) {
         this.factory = factory;
         this.resolveMapsMap = resolveMapsMap;
         this.initializing = initializing;
@@ -165,8 +168,8 @@ public class VanityPathHandler {
         }
 
         private void execute() {
-            try (ResourceResolver resolver = factory
-                    .getServiceResourceResolver(factory.getServiceUserAuthenticationInfo("mapping"))) {
+            try (ResourceResolver resolver =
+                    factory.getServiceResourceResolver(factory.getServiceUserAuthenticationInfo("mapping"))) {
 
                 long initStart = System.nanoTime();
                 log.debug("vanity path initialization - start");
@@ -182,16 +185,24 @@ public class VanityPathHandler {
                 VanityPathHandler.this.drain.run();
 
                 long initElapsed = System.nanoTime() - initStart;
-                long resourcesPerSecond = (vanityResourcesOnStartup.get() * TimeUnit.SECONDS.toNanos(1) / (initElapsed == 0 ? 1 : initElapsed));
+                long resourcesPerSecond = (vanityResourcesOnStartup.get()
+                        * TimeUnit.SECONDS.toNanos(1)
+                        / (initElapsed == 0 ? 1 : initElapsed));
 
                 log.info(
                         "vanity path initialization - completed, processed {} resources with sling:vanityPath properties in {}ms (~{} resource/s)",
-                        vanityResourcesOnStartup.get(), TimeUnit.NANOSECONDS.toMillis(initElapsed), resourcesPerSecond);
+                        vanityResourcesOnStartup.get(),
+                        TimeUnit.NANOSECONDS.toMillis(initElapsed),
+                        resourcesPerSecond);
             } catch (LoginException ex) {
                 log.error("Vanity path init failed", ex);
             } finally {
-                log.debug("dropping temporary resolver map - {}/{} entries, {} hits, {} misses", temporaryResolveMapsMap.size(),
-                        TEMPORARY_CACHE_SIZE_LIMIT, temporaryResolveMapsMapHits.get(), temporaryResolveMapsMapMisses.get());
+                log.debug(
+                        "dropping temporary resolver map - {}/{} entries, {} hits, {} misses",
+                        temporaryResolveMapsMap.size(),
+                        TEMPORARY_CACHE_SIZE_LIMIT,
+                        temporaryResolveMapsMapHits.get(),
+                        temporaryResolveMapsMapMisses.get());
                 temporaryResolveMapsMap = null;
             }
         }
@@ -200,7 +211,8 @@ public class VanityPathHandler {
     boolean doAddVanity(final Resource resource) {
         log.debug("doAddVanity getting {}", resource.getPath());
 
-        boolean updateTheCache = isAllVanityPathEntriesCached() || vanityCounter.longValue() < this.factory.getMaxCachedVanityPathEntries();
+        boolean updateTheCache = isAllVanityPathEntriesCached()
+                || vanityCounter.longValue() < this.factory.getMaxCachedVanityPathEntries();
         return null != loadVanityPath(resource, resolveMapsMap, vanityTargets, updateTheCache, true);
     }
 
@@ -239,13 +251,12 @@ public class VanityPathHandler {
     }
 
     private int removeEntriesFromResolvesMap(String target, String path) {
-        List<MapEntry> entries = Objects.requireNonNullElse(this.resolveMapsMap.get(target),
-                Collections.emptyList());
+        List<MapEntry> entries = Objects.requireNonNullElse(this.resolveMapsMap.get(target), Collections.emptyList());
 
         int count = 0;
 
         // remove all entries for the given path
-        for (Iterator<MapEntry> iterator = entries.iterator(); iterator.hasNext();) {
+        for (Iterator<MapEntry> iterator = entries.iterator(); iterator.hasNext(); ) {
             MapEntry entry = iterator.next();
             String redirect = getMapEntryRedirect(entry);
             if (path.equals(redirect)) {
@@ -338,7 +349,8 @@ public class VanityPathHandler {
     }
 
     private byte[] createVanityBloomFilter() {
-        return BloomFilterUtils.createFilter(VANITY_BLOOM_FILTER_MAX_ENTRIES, this.factory.getVanityBloomFilterMaxBytes());
+        return BloomFilterUtils.createFilter(
+                VANITY_BLOOM_FILTER_MAX_ENTRIES, this.factory.getVanityBloomFilterMaxBytes());
     }
 
     private boolean isAllVanityPathEntriesCached() {
@@ -360,7 +372,8 @@ public class VanityPathHandler {
                 QueryBuildHelper.escapeString(vanityPath),
                 QueryBuildHelper.escapeString(vanityPath.substring(1)));
 
-        try (ResourceResolver queryResolver = factory.getServiceResourceResolver(factory.getServiceUserAuthenticationInfo("mapping"))) {
+        try (ResourceResolver queryResolver =
+                factory.getServiceResourceResolver(factory.getServiceUserAuthenticationInfo("mapping"))) {
             long totalCount = 0;
             long totalValid = 0;
             log.debug("start vanityPath query: {}", queryString);
@@ -370,7 +383,7 @@ public class VanityPathHandler {
                 totalCount += 1;
                 final Resource resource = i.next();
                 boolean isValid = false;
-                for(final Path sPath : this.factory.getObservationPaths()) {
+                for (final Path sPath : this.factory.getObservationPaths()) {
                     if (sPath.matches(resource.getPath())) {
                         isValid = true;
                         break;
@@ -380,12 +393,12 @@ public class VanityPathHandler {
                     totalValid += 1;
                     if (this.vanityPathsProcessed.get()
                             && (this.factory.isMaxCachedVanityPathEntriesStartup()
-                            || this.isAllVanityPathEntriesCached()
-                            || vanityCounter.longValue() < this.factory.getMaxCachedVanityPathEntries())) {
+                                    || this.isAllVanityPathEntriesCached()
+                                    || vanityCounter.longValue() < this.factory.getMaxCachedVanityPathEntries())) {
                         loadVanityPath(resource, resolveMapsMap, vanityTargets, true, true);
                         entryMap = resolveMapsMap;
                     } else {
-                        final Map <String, List<String>> targetPaths = new HashMap<>();
+                        final Map<String, List<String>> targetPaths = new HashMap<>();
                         loadVanityPath(resource, entryMap, targetPaths, true, false);
                     }
                 }
@@ -439,12 +452,14 @@ public class VanityPathHandler {
      */
     private Map<String, List<String>> loadVanityPaths(ResourceResolver resolver) {
         final Map<String, List<String>> targetPaths = new ConcurrentHashMap<>();
-        final String baseQueryString = "SELECT [sling:vanityPath], [sling:redirect], [sling:redirectStatus]" + " FROM [nt:base]"
-                + " WHERE " + QueryBuildHelper.excludeSystemPath() + " AND [sling:vanityPath] IS NOT NULL";
+        final String baseQueryString =
+                "SELECT [sling:vanityPath], [sling:redirect], [sling:redirectStatus]" + " FROM [nt:base]" + " WHERE "
+                        + QueryBuildHelper.excludeSystemPath() + " AND [sling:vanityPath] IS NOT NULL";
 
         Iterator<Resource> it;
         try {
-            final String queryStringWithSort = baseQueryString + " AND FIRST([sling:vanityPath]) >= '%s' ORDER BY FIRST([sling:vanityPath])";
+            final String queryStringWithSort =
+                    baseQueryString + " AND FIRST([sling:vanityPath]) >= '%s' ORDER BY FIRST([sling:vanityPath])";
             it = new PagedQueryIterator("vanity path", PROP_VANITY_PATH, resolver, queryStringWithSort, 2000);
         } catch (QuerySyntaxException ex) {
             log.debug("sort with first() not supported, falling back to base query", ex);
@@ -470,12 +485,21 @@ public class VanityPathHandler {
             }
         }
         long processElapsed = System.nanoTime() - processStart;
-        log.debug("processed {} resources with sling:vanityPath properties (of which {} in scope) in {}ms", count, countInScope, TimeUnit.NANOSECONDS.toMillis(processElapsed));
+        log.debug(
+                "processed {} resources with sling:vanityPath properties (of which {} in scope) in {}ms",
+                count,
+                countInScope,
+                TimeUnit.NANOSECONDS.toMillis(processElapsed));
         if (!isAllVanityPathEntriesCached()) {
             if (countInScope > this.factory.getMaxCachedVanityPathEntries()) {
-                log.warn("Number of resources with sling:vanityPath property ({}) exceeds configured cache size ({}); handling of uncached vanity paths will be much slower. Consider increasing the cache size or decreasing the number of vanity paths.", countInScope, this.factory.getMaxCachedVanityPathEntries());
+                log.warn(
+                        "Number of resources with sling:vanityPath property ({}) exceeds configured cache size ({}); handling of uncached vanity paths will be much slower. Consider increasing the cache size or decreasing the number of vanity paths.",
+                        countInScope,
+                        this.factory.getMaxCachedVanityPathEntries());
             } else if (countInScope > (this.factory.getMaxCachedVanityPathEntries() / 10) * 9) {
-                log.info("Number of resources with sling:vanityPath property in scope ({}) within 10% of configured cache size ({})", countInScope, this.factory.getMaxCachedVanityPathEntries());
+                log.info(
+                        "Number of resources with sling:vanityPath property in scope ({}) within 10% of configured cache size ({})",
+                        countInScope, this.factory.getMaxCachedVanityPathEntries());
             }
         }
 
@@ -496,7 +520,12 @@ public class VanityPathHandler {
      *
      * @return first vanity path or {@code null}
      */
-    private String loadVanityPath(final Resource resource, final Map<String, List<MapEntry>> entryMap, final Map <String, List<String>> targetPaths, boolean addToCache, boolean updateCounter) {
+    private String loadVanityPath(
+            final Resource resource,
+            final Map<String, List<MapEntry>> entryMap,
+            final Map<String, List<String>> targetPaths,
+            boolean addToCache,
+            boolean updateCounter) {
 
         if (!isValidVanityPath(resource.getPath())) {
             return null;
@@ -540,8 +569,9 @@ public class VanityPathHandler {
                 // whether the target is attained by an external redirect or
                 // by an internal redirect is defined by the sling:redirect
                 // property
-                final int httpStatus = props.get(PROP_REDIRECT_EXTERNAL, false) ? props.get(
-                        PROP_REDIRECT_EXTERNAL_REDIRECT_STATUS, factory.getDefaultVanityPathRedirectStatus())
+                final int httpStatus = props.get(PROP_REDIRECT_EXTERNAL, false)
+                        ? props.get(
+                                PROP_REDIRECT_EXTERNAL_REDIRECT_STATUS, factory.getDefaultVanityPathRedirectStatus())
                         : -1;
 
                 final String checkPath = result[1];
@@ -569,7 +599,6 @@ public class VanityPathHandler {
                         // 2. entry with match supporting selectors and extension
                         // ("(\\..*)" matches a single dot followed by any characters)
                         entry2 = createMapEntry(url + "(\\..*)", httpStatus, vanityOrder, redirect + "$1");
-
                     }
 
                     int count = 0;
@@ -650,7 +679,7 @@ public class VanityPathHandler {
             log.warn("Removing extension from vanity path '{}' on {}", info, sourcePath);
         }
 
-        return new String[] { prefix, path };
+        return new String[] {prefix, path};
     }
 
     // return vanity path entry iterator from cache when complete and ready, otherwise from
@@ -704,8 +733,8 @@ public class VanityPathHandler {
         }
     }
 
-    private MapEntry createMapEntry(final String urlPattern, final int httpStatus, long order,
-                                    final String... redirects) {
+    private MapEntry createMapEntry(
+            final String urlPattern, final int httpStatus, long order, final String... redirects) {
         try {
             return new MapEntry(urlPattern, httpStatus, false, order, redirects);
         } catch (IllegalArgumentException iae) {
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/observation/BasicObservationReporter.java b/src/main/java/org/apache/sling/resourceresolver/impl/observation/BasicObservationReporter.java
index 54b2e8c8..196447fa 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/observation/BasicObservationReporter.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/observation/BasicObservationReporter.java
@@ -54,25 +54,23 @@ public class BasicObservationReporter implements ObservationReporter {
      * @param searchPath The search path
      * @param infos The listeners map
      */
-    public BasicObservationReporter(
-            final List<String> searchPath,
-            final Collection<ResourceChangeListenerInfo> infos) {
+    public BasicObservationReporter(final List<String> searchPath, final Collection<ResourceChangeListenerInfo> infos) {
         this.searchPath = searchPath;
         final Set<String> paths = new HashSet<>();
         final List<ResourceChangeListenerInfo> result = new ArrayList<>();
-        for(final ResourceChangeListenerInfo info : infos) {
-            if ( !info.getProviderChangeTypes().isEmpty() ) {
-                for(final Path p : info.getPaths()) {
+        for (final ResourceChangeListenerInfo info : infos) {
+            if (!info.getProviderChangeTypes().isEmpty()) {
+                for (final Path p : info.getPaths()) {
                     paths.add(p.getPath());
                 }
                 result.add(info);
             }
         }
         final BasicObserverConfiguration cfg = new BasicObserverConfiguration(PathSet.fromStringCollection(paths));
-        for(final ResourceChangeListenerInfo i : infos) {
+        for (final ResourceChangeListenerInfo i : infos) {
             cfg.addListener(i);
         }
-        this.configs = Collections.singletonList((ObserverConfiguration)cfg);
+        this.configs = Collections.singletonList((ObserverConfiguration) cfg);
     }
 
     /**
@@ -91,17 +89,18 @@ public class BasicObservationReporter implements ObservationReporter {
         this.searchPath = searchPath;
 
         final List<ObserverConfiguration> observerConfigs = new ArrayList<>();
-        for(final ResourceChangeListenerInfo info : infos) {
-            if ( !info.getResourceChangeTypes().isEmpty() ) {
+        for (final ResourceChangeListenerInfo info : infos) {
+            if (!info.getResourceChangeTypes().isEmpty()) {
                 // find the set of paths that match the provider
                 final Set<Path> paths = new HashSet<>();
-                for(final Path p : info.getPaths()) {
+                for (final Path p : info.getPaths()) {
                     // add when there is an intersection between provider path and resource change listener path
-                    boolean add = providerPath.matches(p.getPath()) || (!p.isPattern() && p.matches(providerPath.getPath()));
-                    if ( add ) {
-                        if ( p.isPattern() ) {
-                            for(final Path exclude : excludePaths) {
-                                if ( p.getPath().startsWith(Path.GLOB_PREFIX + exclude.getPath() + "/")) {
+                    boolean add =
+                            providerPath.matches(p.getPath()) || (!p.isPattern() && p.matches(providerPath.getPath()));
+                    if (add) {
+                        if (p.isPattern()) {
+                            for (final Path exclude : excludePaths) {
+                                if (p.getPath().startsWith(Path.GLOB_PREFIX + exclude.getPath() + "/")) {
                                     logger.debug("ResourceChangeListener {} is shadowed by {}", info, exclude);
                                     add = false;
                                     break;
@@ -109,51 +108,53 @@ public class BasicObservationReporter implements ObservationReporter {
                             }
                         } else {
                             final Path exclude = excludePaths.matches(p.getPath());
-                            if ( exclude != null ) {
+                            if (exclude != null) {
                                 logger.debug("ResourceChangeListener {} is shadowed by {}", info, exclude);
                                 add = false;
                             }
                         }
                     }
-                    if ( add ) {
+                    if (add) {
                         paths.add(p);
                     }
                 }
-                if ( !paths.isEmpty() ) {
+                if (!paths.isEmpty()) {
                     final PathSet pathSet = PathSet.fromPathCollection(paths);
                     // search for an existing configuration with the same paths and hints
                     BasicObserverConfiguration found = null;
-                    for(final ObserverConfiguration c : observerConfigs) {
-                        if ( c.getPaths().equals(pathSet)
-                            && (( c.getPropertyNamesHint() == null && info.getPropertyNamesHint() == null)
-                               || c.getPropertyNamesHint() != null && c.getPropertyNamesHint().equals(info.getPropertyNamesHint()))) {
-                            found = (BasicObserverConfiguration)c;
+                    for (final ObserverConfiguration c : observerConfigs) {
+                        if (c.getPaths().equals(pathSet)
+                                && ((c.getPropertyNamesHint() == null && info.getPropertyNamesHint() == null)
+                                        || c.getPropertyNamesHint() != null
+                                                && c.getPropertyNamesHint().equals(info.getPropertyNamesHint()))) {
+                            found = (BasicObserverConfiguration) c;
                             break;
                         }
                     }
                     final BasicObserverConfiguration config;
-                    if ( found != null ) {
+                    if (found != null) {
                         // check external and types
                         boolean createNew = false;
-                        if ( !found.includeExternal() && info.isExternal() ) {
+                        if (!found.includeExternal() && info.isExternal()) {
                             createNew = true;
                         }
-                        if ( !found.getChangeTypes().equals(info.getResourceChangeTypes()) ) {
+                        if (!found.getChangeTypes().equals(info.getResourceChangeTypes())) {
                             createNew = true;
                         }
-                        if ( createNew ) {
+                        if (createNew) {
                             // create new/updated config
                             observerConfigs.remove(found);
                             final Set<ResourceChange.ChangeType> types = new HashSet<>();
                             types.addAll(found.getChangeTypes());
                             types.addAll(info.getResourceChangeTypes());
-                            config = new BasicObserverConfiguration(pathSet,
-                                types,
-                                info.isExternal() || found.includeExternal(),
-                                found.getExcludedPaths(),
-                                found.getPropertyNamesHint());
+                            config = new BasicObserverConfiguration(
+                                    pathSet,
+                                    types,
+                                    info.isExternal() || found.includeExternal(),
+                                    found.getExcludedPaths(),
+                                    found.getPropertyNamesHint());
                             observerConfigs.add(config);
-                            for(final ResourceChangeListenerInfo i : found.getListeners()) {
+                            for (final ResourceChangeListenerInfo i : found.getListeners()) {
                                 config.addListener(i);
                             }
 
@@ -162,11 +163,12 @@ public class BasicObservationReporter implements ObservationReporter {
                         }
                     } else {
                         // create new config
-                        config = new BasicObserverConfiguration(pathSet,
-                            info.getResourceChangeTypes(),
-                            info.isExternal(),
-                            excludePaths.getSubset(pathSet),
-                            info.getPropertyNamesHint());
+                        config = new BasicObserverConfiguration(
+                                pathSet,
+                                info.getResourceChangeTypes(),
+                                info.isExternal(),
+                                excludePaths.getSubset(pathSet),
+                                info.getPropertyNamesHint());
                         observerConfigs.add(config);
                     }
                     config.addListener(info);
@@ -183,38 +185,38 @@ public class BasicObservationReporter implements ObservationReporter {
 
     @Override
     public void reportChanges(final Iterable<ResourceChange> changes, final boolean distribute) {
-        for(final ObserverConfiguration cfg : this.configs) {
+        for (final ObserverConfiguration cfg : this.configs) {
             final List<ResourceChange> filteredChanges = filterChanges(changes, cfg);
-            if (!filteredChanges.isEmpty() ) {
+            if (!filteredChanges.isEmpty()) {
                 this.reportChanges(cfg, filteredChanges, distribute);
             }
         }
     }
 
     @Override
-    public void reportChanges(final ObserverConfiguration config,
-            final Iterable<ResourceChange> changes,
-            final boolean distribute) {
-        if ( config != null && config instanceof BasicObserverConfiguration ) {
-            final BasicObserverConfiguration observerConfig = (BasicObserverConfiguration)config;
+    public void reportChanges(
+            final ObserverConfiguration config, final Iterable<ResourceChange> changes, final boolean distribute) {
+        if (config != null && config instanceof BasicObserverConfiguration) {
+            final BasicObserverConfiguration observerConfig = (BasicObserverConfiguration) config;
 
             ResourceChangeListenerInfo previousInfo = null;
             List<ResourceChange> filteredChanges = null;
-            for(final ResourceChangeListenerInfo info : observerConfig.getListeners()) {
-                if ( previousInfo == null || !equals(previousInfo, info) ) {
+            for (final ResourceChangeListenerInfo info : observerConfig.getListeners()) {
+                if (previousInfo == null || !equals(previousInfo, info)) {
                     filteredChanges = filterChanges(changes, info);
                     previousInfo = info;
                 }
-                if ( !filteredChanges.isEmpty() ) {
+                if (!filteredChanges.isEmpty()) {
                     final ResourceChangeListener listener = info.getListener();
-                    if ( listener != null ) {
+                    if (listener != null) {
                         listener.onChange(filteredChanges);
                     }
                 }
             }
             // TODO implement distribute
-            if ( distribute ) {
-                logger.error("Distrubte flag is send for observation events, however distribute is currently not implemented!");
+            if (distribute) {
+                logger.error(
+                        "Distrubte flag is send for observation events, however distribute is currently not implemented!");
             }
         }
     }
@@ -226,14 +228,14 @@ public class BasicObservationReporter implements ObservationReporter {
      * @return {@code true} if external and change types are equally configured
      */
     private boolean equals(final ResourceChangeListenerInfo infoA, final ResourceChangeListenerInfo infoB) {
-        if ( infoA.isExternal() && !infoB.isExternal() ) {
+        if (infoA.isExternal() && !infoB.isExternal()) {
             return false;
         }
-        if ( !infoA.isExternal() && infoB.isExternal() ) {
+        if (!infoA.isExternal() && infoB.isExternal()) {
             return false;
         }
         return infoA.getResourceChangeTypes().equals(infoB.getResourceChangeTypes())
-            && infoA.getProviderChangeTypes().equals(infoB.getProviderChangeTypes());
+                && infoA.getProviderChangeTypes().equals(infoB.getProviderChangeTypes());
     }
 
     /**
@@ -242,7 +244,8 @@ public class BasicObservationReporter implements ObservationReporter {
      * @param config The configuration
      * @return The filtered list.
      */
-    private List<ResourceChange> filterChanges(final Iterable<ResourceChange> changes, final ObserverConfiguration config) {
+    private List<ResourceChange> filterChanges(
+            final Iterable<ResourceChange> changes, final ObserverConfiguration config) {
         final ResourceChangeListImpl filtered = new ResourceChangeListImpl(this.searchPath);
         for (final ResourceChange c : changes) {
             if (matches(c, config)) {
@@ -259,7 +262,8 @@ public class BasicObservationReporter implements ObservationReporter {
      * @param config The resource change listener info
      * @return The filtered list.
      */
-    private List<ResourceChange> filterChanges(final Iterable<ResourceChange> changes, final ResourceChangeListenerInfo config) {
+    private List<ResourceChange> filterChanges(
+            final Iterable<ResourceChange> changes, final ResourceChangeListenerInfo config) {
         final ResourceChangeListImpl filtered = new ResourceChangeListImpl(this.searchPath);
         for (final ResourceChange c : changes) {
             if (matches(c, config)) {
@@ -283,10 +287,10 @@ public class BasicObservationReporter implements ObservationReporter {
         if (!config.includeExternal() && change.isExternal()) {
             return false;
         }
-        if (config.getPaths().matches(change.getPath()) == null ) {
+        if (config.getPaths().matches(change.getPath()) == null) {
             return false;
         }
-        if ( config.getExcludedPaths().matches(change.getPath()) != null ) {
+        if (config.getExcludedPaths().matches(change.getPath()) != null) {
             return false;
         }
         return true;
@@ -299,7 +303,8 @@ public class BasicObservationReporter implements ObservationReporter {
      * @return {@code true} whether it matches
      */
     private boolean matches(final ResourceChange change, final ResourceChangeListenerInfo config) {
-        if (!config.getResourceChangeTypes().contains(change.getType()) && !config.getProviderChangeTypes().contains(change.getType())) {
+        if (!config.getResourceChangeTypes().contains(change.getType())
+                && !config.getProviderChangeTypes().contains(change.getType())) {
             return false;
         }
         if (!config.isExternal() && change.isExternal()) {
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/observation/BasicObserverConfiguration.java b/src/main/java/org/apache/sling/resourceresolver/impl/observation/BasicObserverConfiguration.java
index 9d16327e..3a3dac16 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/observation/BasicObserverConfiguration.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/observation/BasicObserverConfiguration.java
@@ -45,7 +45,8 @@ public class BasicObserverConfiguration implements ObserverConfiguration {
 
     private final List<ResourceChangeListenerInfo> listeners = new ArrayList<>();
 
-    public BasicObserverConfiguration(final PathSet paths,
+    public BasicObserverConfiguration(
+            final PathSet paths,
             final Set<ChangeType> types,
             final boolean isExternal,
             final PathSet excludePaths,
@@ -107,7 +108,7 @@ public class BasicObserverConfiguration implements ObserverConfiguration {
 
     @Override
     public boolean matches(final String path) {
-        if ( this.paths.matches(path) != null && this.excludedPaths.matches(path) == null ) {
+        if (this.paths.matches(path) != null && this.excludedPaths.matches(path) == null) {
             return true;
         }
         return false;
@@ -132,35 +133,23 @@ public class BasicObserverConfiguration implements ObserverConfiguration {
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
+        if (this == obj) return true;
+        if (obj == null) return false;
+        if (getClass() != obj.getClass()) return false;
         BasicObserverConfiguration other = (BasicObserverConfiguration) obj;
         if (changeTypes == null) {
-            if (other.changeTypes != null)
-                return false;
-        } else if (!changeTypes.equals(other.changeTypes))
-            return false;
+            if (other.changeTypes != null) return false;
+        } else if (!changeTypes.equals(other.changeTypes)) return false;
         if (excludedPaths == null) {
-            if (other.excludedPaths != null)
-                return false;
-        } else if (!excludedPaths.equals(other.excludedPaths))
-            return false;
-        if (includeExternal != other.includeExternal)
-            return false;
+            if (other.excludedPaths != null) return false;
+        } else if (!excludedPaths.equals(other.excludedPaths)) return false;
+        if (includeExternal != other.includeExternal) return false;
         if (paths == null) {
-            if (other.paths != null)
-                return false;
-        } else if (!paths.equals(other.paths))
-            return false;
+            if (other.paths != null) return false;
+        } else if (!paths.equals(other.paths)) return false;
         if (propertyNamesHint == null) {
-            if (other.propertyNamesHint != null)
-                return false;
-        } else if (!propertyNamesHint.equals(other.propertyNamesHint))
-            return false;
+            if (other.propertyNamesHint != null) return false;
+        } else if (!propertyNamesHint.equals(other.propertyNamesHint)) return false;
         return true;
     }
 
@@ -168,10 +157,12 @@ public class BasicObserverConfiguration implements ObserverConfiguration {
     public String toString() {
         String excludedPathsToString = String.valueOf(excludedPaths);
         if (excludedPathsToString.length() > 100) {
-            excludedPathsToString = excludedPathsToString.substring(0, 99) + "... (" + (excludedPathsToString.length() - 99) + " chars cut)";
+            excludedPathsToString = excludedPathsToString.substring(0, 99) + "... ("
+                    + (excludedPathsToString.length() - 99) + " chars cut)";
         }
         return "BasicObserverConfiguration [includeExternal=" + includeExternal + ", paths=" + paths
-                + ", excludedPaths=" + excludedPathsToString + ", propertyNamesHint=" + propertyNamesHint + ", changeTypes="
+                + ", excludedPaths=" + excludedPathsToString + ", propertyNamesHint=" + propertyNamesHint
+                + ", changeTypes="
                 + changeTypes + ", listeners=" + listeners + "]";
     }
 }
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/observation/OsgiObservationBridge.java b/src/main/java/org/apache/sling/resourceresolver/impl/observation/OsgiObservationBridge.java
index b3f91dce..b9fd28ff 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/observation/OsgiObservationBridge.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/observation/OsgiObservationBridge.java
@@ -48,15 +48,16 @@ import org.osgi.service.event.EventHandler;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-@Component(service = ResourceChangeListener.class,
-configurationPolicy = ConfigurationPolicy.IGNORE,
-property = {
-        Constants.SERVICE_VENDOR + "=The Apache Software Foundation",
-        ResourceChangeListener.PATHS + "=/",
-        ResourceChangeListener.CHANGES + "=ADDED",
-        ResourceChangeListener.CHANGES + "=CHANGED",
-        ResourceChangeListener.CHANGES + "=REMOVED"
-})
+@Component(
+        service = ResourceChangeListener.class,
+        configurationPolicy = ConfigurationPolicy.IGNORE,
+        property = {
+            Constants.SERVICE_VENDOR + "=The Apache Software Foundation",
+            ResourceChangeListener.PATHS + "=/",
+            ResourceChangeListener.CHANGES + "=ADDED",
+            ResourceChangeListener.CHANGES + "=CHANGED",
+            ResourceChangeListener.CHANGES + "=REMOVED"
+        })
 public class OsgiObservationBridge implements ResourceChangeListener, ExternalResourceChangeListener {
 
     private final Logger logger = LoggerFactory.getLogger(OsgiObservationBridge.class);
@@ -74,17 +75,20 @@ public class OsgiObservationBridge implements ResourceChangeListener, ExternalRe
     private EventSendingJob job;
 
     protected void activate() throws LoginException {
-        resolver = resolverFactory.getServiceResourceResolver(Collections.<String, Object>singletonMap(ResourceResolverFactory.SUBSERVICE, "observation"));
+        resolver = resolverFactory.getServiceResourceResolver(
+                Collections.<String, Object>singletonMap(ResourceResolverFactory.SUBSERVICE, "observation"));
         changesQueue = new LinkedBlockingQueue<ResourceChange>();
         job = new EventSendingJob(changesQueue);
         Executors.newSingleThreadExecutor().submit(job);
     }
 
-    @Reference(name = "handlers",
-            cardinality=ReferenceCardinality.AT_LEAST_ONE,
-            policy=ReferencePolicy.DYNAMIC,
-            service=EventHandler.class,
-            target="(|(event.topics=org/apache/sling/api/resource/Resource/*)(event.topics=org/apache/sling/api/resource/ResourceProvider/*))")
+    @Reference(
+            name = "handlers",
+            cardinality = ReferenceCardinality.AT_LEAST_ONE,
+            policy = ReferencePolicy.DYNAMIC,
+            service = EventHandler.class,
+            target =
+                    "(|(event.topics=org/apache/sling/api/resource/Resource/*)(event.topics=org/apache/sling/api/resource/ResourceProvider/*))")
     private void bindEventHandler(final EventHandler handler) {
         logger.warn("Found OSGi Event Handler for deprecated resource bridge: {}", handler);
     }
@@ -110,34 +114,43 @@ public class OsgiObservationBridge implements ResourceChangeListener, ExternalRe
         Dictionary<String, Object> props = new Hashtable<String, Object>();
         String topic;
         switch (change.getType()) {
-        case ADDED:
-            topic = SlingConstants.TOPIC_RESOURCE_ADDED;
-            break;
+            case ADDED:
+                topic = SlingConstants.TOPIC_RESOURCE_ADDED;
+                break;
 
-        case CHANGED:
-            topic = SlingConstants.TOPIC_RESOURCE_CHANGED;
-            break;
+            case CHANGED:
+                topic = SlingConstants.TOPIC_RESOURCE_CHANGED;
+                break;
 
-        case REMOVED:
-            topic = SlingConstants.TOPIC_RESOURCE_REMOVED;
-            break;
+            case REMOVED:
+                topic = SlingConstants.TOPIC_RESOURCE_REMOVED;
+                break;
 
-        default:
-            return;
+            default:
+                return;
         }
 
         props.put(SlingConstants.PROPERTY_PATH, change.getPath());
         if (change.getUserId() != null) {
             props.put(SlingConstants.PROPERTY_USERID, change.getUserId());
         }
-        if (change.getAddedPropertyNames() != null ) {
-            props.put(SlingConstants.PROPERTY_ADDED_ATTRIBUTES, change.getAddedPropertyNames().toArray(new String[change.getAddedPropertyNames().size()]));
+        if (change.getAddedPropertyNames() != null) {
+            props.put(
+                    SlingConstants.PROPERTY_ADDED_ATTRIBUTES,
+                    change.getAddedPropertyNames()
+                            .toArray(new String[change.getAddedPropertyNames().size()]));
         }
         if (change.getChangedPropertyNames() != null) {
-            props.put(SlingConstants.PROPERTY_CHANGED_ATTRIBUTES, change.getChangedPropertyNames().toArray(new String[change.getChangedPropertyNames().size()]));
+            props.put(
+                    SlingConstants.PROPERTY_CHANGED_ATTRIBUTES,
+                    change.getChangedPropertyNames()
+                            .toArray(new String[change.getChangedPropertyNames().size()]));
         }
-        if ( change.getRemovedPropertyNames() != null ) {
-            props.put(SlingConstants.PROPERTY_REMOVED_ATTRIBUTES, change.getRemovedPropertyNames().toArray(new String[change.getRemovedPropertyNames().size()]));
+        if (change.getRemovedPropertyNames() != null) {
+            props.put(
+                    SlingConstants.PROPERTY_REMOVED_ATTRIBUTES,
+                    change.getRemovedPropertyNames()
+                            .toArray(new String[change.getRemovedPropertyNames().size()]));
         }
         if (change.getType() != ChangeType.REMOVED) {
             Resource resource = resolver.getResource(change.getPath());
@@ -196,5 +209,4 @@ public class OsgiObservationBridge implements ResourceChangeListener, ExternalRe
             stop = true;
         }
     }
-
 }
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/observation/ResourceChangeListImpl.java b/src/main/java/org/apache/sling/resourceresolver/impl/observation/ResourceChangeListImpl.java
index 92d2780b..e853ddc9 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/observation/ResourceChangeListImpl.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/observation/ResourceChangeListImpl.java
@@ -75,7 +75,7 @@ public class ResourceChangeListImpl implements ResourceChangeList {
 
     @Override
     public boolean add(final ResourceChange e) {
-        if ( this.locked ) {
+        if (this.locked) {
             throw new UnsupportedOperationException();
         }
         return list.add(e);
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/observation/ResourceChangeListenerInfo.java b/src/main/java/org/apache/sling/resourceresolver/impl/observation/ResourceChangeListenerInfo.java
index a1c4b689..44ef215f 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/observation/ResourceChangeListenerInfo.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/observation/ResourceChangeListenerInfo.java
@@ -18,9 +18,6 @@
  */
 package org.apache.sling.resourceresolver.impl.observation;
 
-import static org.apache.sling.api.resource.observation.ResourceChangeListener.CHANGES;
-import static org.apache.sling.api.resource.observation.ResourceChangeListener.PATHS;
-
 import java.util.Collections;
 import java.util.EnumSet;
 import java.util.HashSet;
@@ -38,14 +35,19 @@ import org.apache.sling.api.resource.path.PathSet;
 import org.osgi.framework.ServiceReference;
 import org.osgi.util.converter.Converters;
 
+import static org.apache.sling.api.resource.observation.ResourceChangeListener.CHANGES;
+import static org.apache.sling.api.resource.observation.ResourceChangeListener.PATHS;
+
 /**
  * Information about a resource change listener.
  */
 public class ResourceChangeListenerInfo implements Comparable<ResourceChangeListenerInfo> {
 
-    private static final Set<ChangeType> DEFAULT_CHANGE_RESOURCE_TYPES = EnumSet.of(ChangeType.ADDED, ChangeType.REMOVED, ChangeType.CHANGED);
+    private static final Set<ChangeType> DEFAULT_CHANGE_RESOURCE_TYPES =
+            EnumSet.of(ChangeType.ADDED, ChangeType.REMOVED, ChangeType.CHANGED);
 
-    private static final Set<ChangeType> DEFAULT_CHANGE_PROVIDER_TYPES = EnumSet.of(ChangeType.PROVIDER_ADDED, ChangeType.PROVIDER_REMOVED);
+    private static final Set<ChangeType> DEFAULT_CHANGE_PROVIDER_TYPES =
+            EnumSet.of(ChangeType.PROVIDER_ADDED, ChangeType.PROVIDER_REMOVED);
 
     private final PathSet paths;
 
@@ -61,26 +63,28 @@ public class ResourceChangeListenerInfo implements Comparable<ResourceChangeList
 
     private volatile ResourceChangeListener listener;
 
-    public ResourceChangeListenerInfo(final ServiceReference<ResourceChangeListener> ref, final List<String> searchPaths) {
+    public ResourceChangeListenerInfo(
+            final ServiceReference<ResourceChangeListener> ref, final List<String> searchPaths) {
         boolean configValid = true;
         final Set<String> pathsSet = new HashSet<>();
-        final String paths[] = Converters.standardConverter().convert(ref.getProperty(PATHS)).to(String[].class);
-        for(final String p : paths) {
+        final String paths[] =
+                Converters.standardConverter().convert(ref.getProperty(PATHS)).to(String[].class);
+        for (final String p : paths) {
             boolean isGlobPattern = false;
             String normalisedPath = ResourceUtil.normalize(p);
             if (p.startsWith(Path.GLOB_PREFIX)) {
                 isGlobPattern = true;
-                normalisedPath =  ResourceUtil.normalize(p.substring(Path.GLOB_PREFIX.length()));
+                normalisedPath = ResourceUtil.normalize(p.substring(Path.GLOB_PREFIX.length()));
             }
             if (!".".equals(p) && normalisedPath.isEmpty()) {
                 configValid = false;
-            } else if ( normalisedPath.startsWith("/") && !isGlobPattern ) {
+            } else if (normalisedPath.startsWith("/") && !isGlobPattern) {
                 pathsSet.add(normalisedPath);
             } else if (normalisedPath.startsWith("/") && isGlobPattern) {
                 pathsSet.add(Path.GLOB_PREFIX + normalisedPath);
             } else {
-                for(final String sp : searchPaths) {
-                    if ( p.equals(".") ) {
+                for (final String sp : searchPaths) {
+                    if (p.equals(".")) {
                         pathsSet.add(sp);
                     } else {
                         if (isGlobPattern) {
@@ -92,31 +96,33 @@ public class ResourceChangeListenerInfo implements Comparable<ResourceChangeList
                 }
             }
         }
-        if ( pathsSet.isEmpty() ) {
+        if (pathsSet.isEmpty()) {
             configValid = false;
         } else {
             // check for sub paths
             final Iterator<String> iter = pathsSet.iterator();
-            while ( iter.hasNext() ) {
+            while (iter.hasNext()) {
                 final String path = iter.next();
                 boolean remove = false;
-                for(final String p : pathsSet) {
-                    if ( p.length() > path.length() && path.startsWith(p + "/") ) {
+                for (final String p : pathsSet) {
+                    if (p.length() > path.length() && path.startsWith(p + "/")) {
                         remove = true;
                         break;
                     }
                 }
-                if ( remove ) {
+                if (remove) {
                     iter.remove();
                 }
             }
         }
         this.paths = PathSet.fromStringCollection(pathsSet);
-        if (ref.getProperty(CHANGES) != null ) {
+        if (ref.getProperty(CHANGES) != null) {
             final Set<ChangeType> rts = new HashSet<>();
             final Set<ChangeType> pts = new HashSet<>();
             try {
-                for (final String changeName : Converters.standardConverter().convert(ref.getProperty(CHANGES)).to(String[].class)) {
+                for (final String changeName : Converters.standardConverter()
+                        .convert(ref.getProperty(CHANGES))
+                        .to(String[].class)) {
                     final ChangeType ct = ChangeType.valueOf(changeName);
                     if (ct.ordinal() < ChangeType.PROVIDER_ADDED.ordinal()) {
                         rts.add(ct);
@@ -127,16 +133,16 @@ public class ResourceChangeListenerInfo implements Comparable<ResourceChangeList
             } catch (final Exception e) {
                 configValid = false;
             }
-            if ( rts.isEmpty() ) {
+            if (rts.isEmpty()) {
                 this.resourceChangeTypes = Collections.emptySet();
-            } else if ( rts.size() == 3 ) {
+            } else if (rts.size() == 3) {
                 this.resourceChangeTypes = DEFAULT_CHANGE_RESOURCE_TYPES;
             } else {
                 this.resourceChangeTypes = Collections.unmodifiableSet(rts);
             }
-            if ( pts.isEmpty() ) {
+            if (pts.isEmpty()) {
                 this.providerChangeTypes = Collections.emptySet();
-            } else if ( pts.size() == 2 ) {
+            } else if (pts.size() == 2) {
                 this.providerChangeTypes = DEFAULT_CHANGE_PROVIDER_TYPES;
             } else {
                 this.providerChangeTypes = Collections.unmodifiableSet(pts);
@@ -148,9 +154,11 @@ public class ResourceChangeListenerInfo implements Comparable<ResourceChangeList
             this.providerChangeTypes = DEFAULT_CHANGE_PROVIDER_TYPES;
         }
 
-        if ( ref.getProperty(ResourceChangeListener.PROPERTY_NAMES_HINT) != null ) {
+        if (ref.getProperty(ResourceChangeListener.PROPERTY_NAMES_HINT) != null) {
             this.propertyNamesHint = new HashSet<>();
-            for(final String val : Converters.standardConverter().convert(ref.getProperty(ResourceChangeListener.PROPERTY_NAMES_HINT)).to(String[].class) ) {
+            for (final String val : Converters.standardConverter()
+                    .convert(ref.getProperty(ResourceChangeListener.PROPERTY_NAMES_HINT))
+                    .to(String[].class)) {
                 this.propertyNamesHint.add(val);
             }
         } else {
@@ -197,23 +205,23 @@ public class ResourceChangeListenerInfo implements Comparable<ResourceChangeList
     }
 
     private int compareSet(final Set<String> t, final Set<String> o) {
-        if ( t == null && o == null ) {
+        if (t == null && o == null) {
             return 0;
         }
-        if ( t == null ) {
+        if (t == null) {
             return -1;
         }
-        if ( o == null ) {
+        if (o == null) {
             return 1;
         }
         final Set<String> tPaths = new TreeSet<>(t);
         final Set<String> oPaths = new TreeSet<>(o);
 
         int result = tPaths.size() - oPaths.size();
-        if ( result == 0 ) {
+        if (result == 0) {
             final Iterator<String> tPathsIter = tPaths.iterator();
             final Iterator<String> oPathsIter = oPaths.iterator();
-            while ( result == 0 && tPathsIter.hasNext() ) {
+            while (result == 0 && tPathsIter.hasNext()) {
                 result = tPathsIter.next().compareTo(oPathsIter.next());
             }
         }
@@ -222,10 +230,10 @@ public class ResourceChangeListenerInfo implements Comparable<ResourceChangeList
 
     private int compareChangeTypes(final Set<ChangeType> t, final Set<ChangeType> o) {
         int result = t.size() - o.size();
-        if ( result == 0 ) {
+        if (result == 0) {
             final Iterator<ChangeType> tIter = t.iterator();
             final Iterator<ChangeType> oIter = o.iterator();
-            while ( result == 0 && tIter.hasNext() ) {
+            while (result == 0 && tIter.hasNext()) {
                 result = tIter.next().compareTo(oIter.next());
             }
         }
@@ -236,15 +244,15 @@ public class ResourceChangeListenerInfo implements Comparable<ResourceChangeList
     public int compareTo(final ResourceChangeListenerInfo o) {
         // paths first
         int result = compareSet(this.paths.toStringSet(), o.paths.toStringSet());
-        if ( result == 0 ) {
+        if (result == 0) {
             // hints
             result = compareSet(this.propertyNamesHint, o.propertyNamesHint);
-            if ( result == 0 ) {
+            if (result == 0) {
                 // external next
                 result = Boolean.valueOf(this.external).compareTo(o.external);
-                if ( result == 0 ) {
+                if (result == 0) {
                     result = compareChangeTypes(this.resourceChangeTypes, o.resourceChangeTypes);
-                    if ( result == 0 ) {
+                    if (result == 0) {
                         result = compareChangeTypes(this.providerChangeTypes, o.providerChangeTypes);
                     }
                 }
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/observation/ResourceChangeListenerWhiteboard.java b/src/main/java/org/apache/sling/resourceresolver/impl/observation/ResourceChangeListenerWhiteboard.java
index cb947aaa..541f8915 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/observation/ResourceChangeListenerWhiteboard.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/observation/ResourceChangeListenerWhiteboard.java
@@ -45,7 +45,8 @@ public class ResourceChangeListenerWhiteboard implements ResourceProviderTracker
 
     private final Logger logger = LoggerFactory.getLogger(this.getClass());
 
-    private final Map<ServiceReference<ResourceChangeListener>, ResourceChangeListenerInfo> listeners = new ConcurrentHashMap<>();
+    private final Map<ServiceReference<ResourceChangeListener>, ResourceChangeListenerInfo> listeners =
+            new ConcurrentHashMap<>();
 
     private volatile ResourceProviderTracker resourceProviderTracker;
 
@@ -53,51 +54,58 @@ public class ResourceChangeListenerWhiteboard implements ResourceProviderTracker
 
     private volatile List<String> searchPath;
 
-    public void activate(final BundleContext bundleContext,
+    public void activate(
+            final BundleContext bundleContext,
             final ResourceProviderTracker resourceProviderTracker,
             final List<String> searchPath) {
         this.searchPath = searchPath;
         this.resourceProviderTracker = resourceProviderTracker;
         this.resourceProviderTracker.setObservationReporterGenerator(this);
-        this.tracker = new ServiceTracker<>(bundleContext,
+        this.tracker = new ServiceTracker<>(
+                bundleContext,
                 ResourceChangeListener.class,
                 new ServiceTrackerCustomizer<ResourceChangeListener, ServiceReference<ResourceChangeListener>>() {
 
-            @Override
-            public void removedService(final ServiceReference<ResourceChangeListener> reference, final ServiceReference<ResourceChangeListener> service) {
-                final ResourceChangeListenerInfo info = listeners.remove(reference);
-                if ( info != null ) {
-                    updateProviderTracker();
-                }
-            }
-
-            @Override
-            public void modifiedService(final ServiceReference<ResourceChangeListener> reference, final ServiceReference<ResourceChangeListener> service) {
-                removedService(reference, service);
-                addingService(reference);
-            }
-
-            @Override
-            public ServiceReference<ResourceChangeListener> addingService(final ServiceReference<ResourceChangeListener> reference) {
-                final ResourceChangeListenerInfo info = new ResourceChangeListenerInfo(reference, searchPath);
-                if ( info.isValid() ) {
-                    final ResourceChangeListener listener = bundleContext.getService(reference);
-                    if ( listener != null ) {
-                        info.setListener(listener);
-                        listeners.put(reference, info);
-                        updateProviderTracker();
+                    @Override
+                    public void removedService(
+                            final ServiceReference<ResourceChangeListener> reference,
+                            final ServiceReference<ResourceChangeListener> service) {
+                        final ResourceChangeListenerInfo info = listeners.remove(reference);
+                        if (info != null) {
+                            updateProviderTracker();
+                        }
                     }
-                } else {
-                    logger.warn("Ignoring invalid resource change listener {}", reference);
-                }
-                return reference;
-            }
-        });
+
+                    @Override
+                    public void modifiedService(
+                            final ServiceReference<ResourceChangeListener> reference,
+                            final ServiceReference<ResourceChangeListener> service) {
+                        removedService(reference, service);
+                        addingService(reference);
+                    }
+
+                    @Override
+                    public ServiceReference<ResourceChangeListener> addingService(
+                            final ServiceReference<ResourceChangeListener> reference) {
+                        final ResourceChangeListenerInfo info = new ResourceChangeListenerInfo(reference, searchPath);
+                        if (info.isValid()) {
+                            final ResourceChangeListener listener = bundleContext.getService(reference);
+                            if (listener != null) {
+                                info.setListener(listener);
+                                listeners.put(reference, info);
+                                updateProviderTracker();
+                            }
+                        } else {
+                            logger.warn("Ignoring invalid resource change listener {}", reference);
+                        }
+                        return reference;
+                    }
+                });
         this.tracker.open();
     }
 
     public void deactivate() {
-        if ( this.tracker != null ) {
+        if (this.tracker != null) {
             this.tracker.close();
             this.tracker = null;
         }
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/params/ParametersParser.java b/src/main/java/org/apache/sling/resourceresolver/impl/params/ParametersParser.java
index 3acbd273..965ccedc 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/params/ParametersParser.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/params/ParametersParser.java
@@ -16,7 +16,6 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-
 package org.apache.sling.resourceresolver.impl.params;
 
 import java.util.LinkedHashMap;
@@ -25,7 +24,12 @@ import java.util.Map;
 class ParametersParser {
 
     private enum ParamsState {
-        INIT, NAME, EQUALS, VALUE, QUOTED_VALUE, QUOTE_END
+        INIT,
+        NAME,
+        EQUALS,
+        VALUE,
+        QUOTED_VALUE,
+        QUOTE_END
     }
 
     private StringBuilder name;
@@ -39,7 +43,7 @@ class ParametersParser {
     /**
      * Parses parameters string, eg.: {@code ;x=123;a='1.0'}. The result of the method is available in
      * {@link #parameters} and {@link #invalid}.
-     * 
+     *
      * @param chars Array containing path with parameters.
      * @param from Index of the first character of the parameters substring (it must be a semicolon).
      * @param dotAllowed If true, the dot in parameter value won't stop parsing.
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/params/ParsedParameters.java b/src/main/java/org/apache/sling/resourceresolver/impl/params/ParsedParameters.java
index bd31cdfa..105083ec 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/params/ParsedParameters.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/params/ParsedParameters.java
@@ -1,21 +1,21 @@
 /*
  * 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.resourceresolver.impl.params;
 
 import java.util.Map;
@@ -23,7 +23,7 @@ import java.util.Map;
 /**
  * Parses path looking for semicolon-separated parameters. Parameters are extracted and exposed as an
  * immutable map. The path without parameters is available as raw path.
- * 
+ *
  * Parameters should be added immediately before or after selectors and extension:
  * {@code /content/test;v='1.0'.html} or {@code /content/test.html;v=1.0}. Quotes can be used to escape the
  * parameter value (it is necessary if the value contains dot and parameter is added before extension).
@@ -38,7 +38,7 @@ public class ParsedParameters {
 
     /**
      * Parse path and create parameters object.
-     * 
+     *
      * @param fullPath Path to parse.
      */
     public ParsedParameters(final String fullPath) {
@@ -56,7 +56,7 @@ public class ParsedParameters {
     public String getRawPath() {
         return path;
     }
-    
+
     /**
      * @return Path's substring containing parameters
      */
@@ -70,5 +70,4 @@ public class ParsedParameters {
     public Map<String, String> getParameters() {
         return parameters;
     }
-
 }
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/params/PathParser.java b/src/main/java/org/apache/sling/resourceresolver/impl/params/PathParser.java
index a2074ecc..6a837a72 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/params/PathParser.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/params/PathParser.java
@@ -16,7 +16,6 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-
 package org.apache.sling.resourceresolver.impl.params;
 
 import java.util.Collections;
@@ -30,7 +29,13 @@ class PathParser {
      * selectors and extension: {@code /content/test;v='1.0'.sel.html}
      */
     private enum ParserState {
-        INIT, V1_EXTENSION, V1_PARAMS, V2_PARAMS, V2_EXTENSION, SUFFIX, INVALID
+        INIT,
+        V1_EXTENSION,
+        V1_PARAMS,
+        V2_PARAMS,
+        V2_EXTENSION,
+        SUFFIX,
+        INVALID
     }
 
     private String rawPath;
@@ -62,7 +67,7 @@ class PathParser {
 
     /**
      * Parses path containing parameters. Results will be available in {@link #rawPath} and {@link parameters}.
-     * 
+     *
      * @param path
      */
     public void parse(String path) {
@@ -166,6 +171,4 @@ class PathParser {
             parametersString = path.substring(from, to);
         }
     }
-
-
 }
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/providers/ResourceProviderHandler.java b/src/main/java/org/apache/sling/resourceresolver/impl/providers/ResourceProviderHandler.java
index 9b7a10a3..d7cf2fc8 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/providers/ResourceProviderHandler.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/providers/ResourceProviderHandler.java
@@ -104,13 +104,13 @@ public class ResourceProviderHandler implements Comparable<ResourceProviderHandl
     public int compareTo(final ResourceProviderHandler o) {
         final ResourceProviderInfo localInfo = this.info;
         final ResourceProviderInfo otherInfo = o.info;
-        if ( localInfo == null ) {
-            if ( otherInfo == null ) {
+        if (localInfo == null) {
+            if (otherInfo == null) {
                 return 0;
             }
             return 1;
         }
-        if ( otherInfo == null ) {
+        if (otherInfo == null) {
             return -1;
         }
         return localInfo.compareTo(otherInfo);
@@ -142,6 +142,6 @@ public class ResourceProviderHandler implements Comparable<ResourceProviderHandl
 
     @Override
     public String toString() {
-        return "[" + getClass().getSimpleName() +"# provider: " + provider + " ]";
+        return "[" + getClass().getSimpleName() + "# provider: " + provider + " ]";
     }
 }
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/providers/ResourceProviderInfo.java b/src/main/java/org/apache/sling/resourceresolver/impl/providers/ResourceProviderInfo.java
index e075b5e8..7d07a462 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/providers/ResourceProviderInfo.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/providers/ResourceProviderInfo.java
@@ -63,46 +63,58 @@ public class ResourceProviderInfo implements Comparable<ResourceProviderInfo> {
     public ResourceProviderInfo(final ServiceReference<ResourceProvider> ref) {
         final Converter c = Converters.standardConverter();
         this.ref = ref;
-        this.path = c.convert(ref.getProperty(ResourceProvider.PROPERTY_ROOT)).defaultValue("").to(String.class);
+        this.path = c.convert(ref.getProperty(ResourceProvider.PROPERTY_ROOT))
+                .defaultValue("")
+                .to(String.class);
         this.name = c.convert(ref.getProperty(ResourceProvider.PROPERTY_NAME)).to(String.class);
-        this.useResourceAccessSecurity = c.convert(ref.getProperty(ResourceProvider.PROPERTY_USE_RESOURCE_ACCESS_SECURITY)).to(boolean.class);
-        final String authType = c.convert(ref.getProperty(ResourceProvider.PROPERTY_AUTHENTICATE)).defaultValue(AuthType.no.name()).to(String.class);
+        this.useResourceAccessSecurity = c.convert(
+                        ref.getProperty(ResourceProvider.PROPERTY_USE_RESOURCE_ACCESS_SECURITY))
+                .to(boolean.class);
+        final String authType = c.convert(ref.getProperty(ResourceProvider.PROPERTY_AUTHENTICATE))
+                .defaultValue(AuthType.no.name())
+                .to(String.class);
         AuthType aType = null;
         try {
             aType = AuthType.valueOf(authType);
-        } catch ( final IllegalArgumentException iae) {
+        } catch (final IllegalArgumentException iae) {
             logger.error("Illegal auth type {} for resource provider {} ({})", authType, name, ref);
         }
         this.authType = aType;
-        this.modifiable = c.convert(ref.getProperty(ResourceProvider.PROPERTY_MODIFIABLE)).to(boolean.class);
-        this.adaptable = c.convert(ref.getProperty(ResourceProvider.PROPERTY_ADAPTABLE)).to(boolean.class);
-        this.refreshable = c.convert(ref.getProperty(ResourceProvider.PROPERTY_REFRESHABLE)).to(boolean.class);
-        this.attributable = c.convert(ref.getProperty(ResourceProvider.PROPERTY_ATTRIBUTABLE)).to(boolean.class);
+        this.modifiable =
+                c.convert(ref.getProperty(ResourceProvider.PROPERTY_MODIFIABLE)).to(boolean.class);
+        this.adaptable =
+                c.convert(ref.getProperty(ResourceProvider.PROPERTY_ADAPTABLE)).to(boolean.class);
+        this.refreshable = c.convert(ref.getProperty(ResourceProvider.PROPERTY_REFRESHABLE))
+                .to(boolean.class);
+        this.attributable = c.convert(ref.getProperty(ResourceProvider.PROPERTY_ATTRIBUTABLE))
+                .to(boolean.class);
         final String modeValue = c.convert(ref.getProperty(ResourceProvider.PROPERTY_MODE))
-            .defaultValue(ResourceProvider.MODE_OVERLAY).to(String.class).toUpperCase();
+                .defaultValue(ResourceProvider.MODE_OVERLAY)
+                .to(String.class)
+                .toUpperCase();
         Mode mode = null;
         try {
             mode = Mode.valueOf(modeValue);
-        } catch ( final IllegalArgumentException iae) {
+        } catch (final IllegalArgumentException iae) {
             logger.error("Illegal mode {} for resource provider {} ({})", modeValue, name, ref);
         }
         this.mode = mode;
-        if ( !path.startsWith("/") ) {
+        if (!path.startsWith("/")) {
             logger.error("Path {} does not start with / for resource provider {} ({})", path, name, ref);
         }
     }
 
     public boolean isValid() {
         // TODO - do real path check
-        if ( !path.startsWith("/") ) {
+        if (!path.startsWith("/")) {
             logger.debug("ResourceProvider path does not start with /, invalid: {}", path);
             return false;
         }
-        if ( this.authType == null ) {
+        if (this.authType == null) {
             logger.debug("ResourceProvider has null authType, invalid");
             return false;
         }
-        if ( this.mode == null ) {
+        if (this.mode == null) {
             logger.debug("ResourceProvider has null mode, invalid");
             return false;
         }
@@ -125,7 +137,7 @@ public class ResourceProviderInfo implements Comparable<ResourceProviderInfo> {
     @Override
     public int compareTo(final ResourceProviderInfo o) {
         int result = path.compareTo(o.path);
-        if ( result == 0 ) {
+        if (result == 0) {
             result = o.ref.compareTo(ref);
         }
         return result;
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/providers/ResourceProviderStorage.java b/src/main/java/org/apache/sling/resourceresolver/impl/providers/ResourceProviderStorage.java
index 0ec0c9ba..813304ee 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/providers/ResourceProviderStorage.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/providers/ResourceProviderStorage.java
@@ -75,10 +75,10 @@ public class ResourceProviderStorage {
             public int compare(final ResourceProviderHandler o1, final ResourceProviderHandler o2) {
                 final ResourceProviderInfo i1 = o1.getInfo();
                 final ResourceProviderInfo i2 = o2.getInfo();
-                if ( i1 == null ) {
+                if (i1 == null) {
                     return i2 == null ? 0 : -1;
                 }
-                if ( i2 == null ) {
+                if (i2 == null) {
                     return 1;
                 }
                 return i2.getServiceReference().compareTo(i1.getServiceReference());
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/providers/ResourceProviderStorageProvider.java b/src/main/java/org/apache/sling/resourceresolver/impl/providers/ResourceProviderStorageProvider.java
index 887af12f..747a61b3 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/providers/ResourceProviderStorageProvider.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/providers/ResourceProviderStorageProvider.java
@@ -20,9 +20,8 @@ package org.apache.sling.resourceresolver.impl.providers;
 
 /**
  * Interface which allows access to a ResourceProviderStorage object.
- */ 
+ */
 public interface ResourceProviderStorageProvider {
 
     ResourceProviderStorage getResourceProviderStorage();
-
 }
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/providers/ResourceProviderTracker.java b/src/main/java/org/apache/sling/resourceresolver/impl/providers/ResourceProviderTracker.java
index d396a980..736f438e 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/providers/ResourceProviderTracker.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/providers/ResourceProviderTracker.java
@@ -85,7 +85,8 @@ public class ResourceProviderTracker implements ResourceProviderStorageProvider
     private final Map<ResourceProviderInfo, FailureReason> invalidProviders = new ConcurrentHashMap<>();
 
     @SuppressWarnings("rawtypes")
-    private final Map<ServiceReference<ResourceProvider>, ResourceProviderInfo> providerInfos = new ConcurrentHashMap<>();
+    private final Map<ServiceReference<ResourceProvider>, ResourceProviderInfo> providerInfos =
+            new ConcurrentHashMap<>();
 
     private volatile EventAdmin eventAdmin;
 
@@ -98,27 +99,31 @@ public class ResourceProviderTracker implements ResourceProviderStorageProvider
     private volatile ChangeListener listener;
 
     @SuppressWarnings("rawtypes")
-    public void activate(final BundleContext bundleContext, final EventAdmin eventAdmin, final ChangeListener listener) {
+    public void activate(
+            final BundleContext bundleContext, final EventAdmin eventAdmin, final ChangeListener listener) {
         this.bundleContext = bundleContext;
         this.eventAdmin = eventAdmin;
         this.listener = listener;
-        this.tracker = new ServiceTracker<>(bundleContext,
-                ResourceProvider.class,
-                new ServiceTrackerCustomizer<>() {
+        this.tracker = new ServiceTracker<>(bundleContext, ResourceProvider.class, new ServiceTrackerCustomizer<>() {
 
             @Override
-            public void removedService(final ServiceReference<ResourceProvider> reference, final ServiceReference<ResourceProvider> tracked) {
+            public void removedService(
+                    final ServiceReference<ResourceProvider> reference,
+                    final ServiceReference<ResourceProvider> tracked) {
                 unregister(reference);
             }
 
             @Override
-            public void modifiedService(final ServiceReference<ResourceProvider> reference, final ServiceReference<ResourceProvider> tracked) {
+            public void modifiedService(
+                    final ServiceReference<ResourceProvider> reference,
+                    final ServiceReference<ResourceProvider> tracked) {
                 removedService(reference, tracked);
                 addingService(reference);
             }
 
             @Override
-            public ServiceReference<ResourceProvider> addingService(final ServiceReference<ResourceProvider> reference) {
+            public ServiceReference<ResourceProvider> addingService(
+                    final ServiceReference<ResourceProvider> reference) {
                 register(reference);
                 return reference;
             }
@@ -130,7 +135,7 @@ public class ResourceProviderTracker implements ResourceProviderStorageProvider
         this.listener = null;
         this.eventAdmin = null;
         this.providerReporter = null;
-        if ( this.tracker != null ) {
+        if (this.tracker != null) {
             this.tracker.close();
             this.tracker = null;
         }
@@ -140,10 +145,10 @@ public class ResourceProviderTracker implements ResourceProviderStorageProvider
 
     public void setObservationReporterGenerator(final ObservationReporterGenerator generator) {
         this.providerReporter = generator.createProviderReporter();
-        synchronized ( this.handlers ) {
+        synchronized (this.handlers) {
             this.reporterGenerator = generator;
             for (List<ResourceProviderHandler> list : handlers.values()) {
-                if ( !list.isEmpty() ) {
+                if (!list.isEmpty()) {
                     final ResourceProviderHandler h = list.get(0);
                     if (h != null) {
                         updateProviderContext(h);
@@ -165,7 +170,7 @@ public class ResourceProviderTracker implements ResourceProviderStorageProvider
         this.providerInfos.put(ref, info);
 
         // check validity
-        if ( !info.isValid() ) {
+        if (!info.isValid()) {
             logger.warn("Ignoring invalid resource provider {}", info);
             this.invalidProviders.put(info, FailureReason.invalid);
         } else {
@@ -176,7 +181,7 @@ public class ResourceProviderTracker implements ResourceProviderStorageProvider
             } catch (final IllegalStateException ise) {
                 // ignore
             }
-            if ( provider == null ) {
+            if (provider == null) {
                 logger.warn("Ignoring resource provider as the service is not gettable {}", info);
                 this.invalidProviders.put(info, FailureReason.service_not_gettable);
             } else {
@@ -197,12 +202,12 @@ public class ResourceProviderTracker implements ResourceProviderStorageProvider
             return; // this should never happen
         }
         final boolean isInvalid = this.invalidProviders.remove(info) != null;
-        if ( !isInvalid ) {
+        if (!isInvalid) {
             logger.debug("Unregistering resource provider {}", info);
             this.remove(info);
             try {
                 this.bundleContext.ungetService(ref);
-            } catch ( final IllegalStateException ise) {
+            } catch (final IllegalStateException ise) {
                 // ignore
             }
         }
@@ -218,17 +223,18 @@ public class ResourceProviderTracker implements ResourceProviderStorageProvider
         ResourceProviderHandler deactivateHandler = null;
 
         // update list of active handlers
-        synchronized ( this.handlers ) {
-            final List<ResourceProviderHandler> matchingHandlers = this.handlers.computeIfAbsent(handler.getInfo().getPath(), key -> new ArrayList<>());
+        synchronized (this.handlers) {
+            final List<ResourceProviderHandler> matchingHandlers =
+                    this.handlers.computeIfAbsent(handler.getInfo().getPath(), key -> new ArrayList<>());
             matchingHandlers.add(handler);
             Collections.sort(matchingHandlers);
 
-            if ( matchingHandlers.get(0) == handler ) {
+            if (matchingHandlers.get(0) == handler) {
                 this.storage = null;
                 providerAdded = true;
                 events.add(new ProviderEvent(true, handler.getInfo()));
                 this.activate(handler);
-                if (  matchingHandlers.size() > 1  ) {
+                if (matchingHandlers.size() > 1) {
                     deactivateHandler = matchingHandlers.get(1);
                     this.deactivate(deactivateHandler);
                     events.add(new ProviderEvent(false, deactivateHandler.getInfo()));
@@ -238,10 +244,11 @@ public class ResourceProviderTracker implements ResourceProviderStorageProvider
 
         // update change listener (only once)
         final ChangeListener cl = this.listener;
-        if ( cl != null ) {
-            if ( deactivateHandler != null ) {
-                cl.providerRemoved(deactivateHandler.getInfo().getAuthType() != AuthType.no, deactivateHandler.isUsed());
-            } else if ( providerAdded ) {
+        if (cl != null) {
+            if (deactivateHandler != null) {
+                cl.providerRemoved(
+                        deactivateHandler.getInfo().getAuthType() != AuthType.no, deactivateHandler.isUsed());
+            } else if (providerAdded) {
                 cl.providerAdded();
             }
         }
@@ -262,14 +269,14 @@ public class ResourceProviderTracker implements ResourceProviderStorageProvider
         ResourceProviderHandler deactivateHandler = null;
         synchronized (this.handlers) {
             final List<ResourceProviderHandler> matchingHandlers = this.handlers.get(info.getPath());
-            if ( matchingHandlers != null ) {
+            if (matchingHandlers != null) {
                 final Iterator<ResourceProviderHandler> it = matchingHandlers.iterator();
                 boolean first = true;
                 while (it.hasNext()) {
                     final ResourceProviderHandler h = it.next();
                     if (h.getInfo() == info) {
                         it.remove();
-                        if ( first ) {
+                        if (first) {
                             this.storage = null;
                             deactivateHandler = h;
                         }
@@ -282,22 +289,22 @@ public class ResourceProviderTracker implements ResourceProviderStorageProvider
                     first = false;
                 }
             }
-            if ( deactivateHandler != null ) {
+            if (deactivateHandler != null) {
                 this.deactivate(deactivateHandler);
                 events.add(new ProviderEvent(false, info));
 
                 // check if we can activate another handler
-                if ( !matchingHandlers.isEmpty() ) {
+                if (!matchingHandlers.isEmpty()) {
                     final ResourceProviderHandler addingProvider = matchingHandlers.get(0);
                     this.activate(addingProvider);
                     events.add(new ProviderEvent(true, addingProvider.getInfo()));
-                }    
+                }
             }
         }
 
         // update change listener (only once)
         final ChangeListener cl = this.listener;
-        if ( cl != null ) {
+        if (cl != null) {
             cl.providerRemoved(info.getAuthType() != AuthType.no, deactivateHandler.isUsed());
         }
 
@@ -330,13 +337,16 @@ public class ResourceProviderTracker implements ResourceProviderStorageProvider
      */
     private void postOSGiEvent(final ProviderEvent event) {
         final EventAdmin ea = this.eventAdmin;
-        if ( ea != null ) {
+        if (ea != null) {
             final Dictionary<String, Object> eventProps = new Hashtable<>();
             eventProps.put(SlingConstants.PROPERTY_PATH, event.path);
             if (event.pid != null) {
                 eventProps.put(Constants.SERVICE_PID, event.pid);
             }
-            ea.postEvent(new Event(event.isAdd ? SlingConstants.TOPIC_RESOURCE_PROVIDER_ADDED : SlingConstants.TOPIC_RESOURCE_PROVIDER_REMOVED,
+            ea.postEvent(new Event(
+                    event.isAdd
+                            ? SlingConstants.TOPIC_RESOURCE_PROVIDER_ADDED
+                            : SlingConstants.TOPIC_RESOURCE_PROVIDER_REMOVED,
                     eventProps));
         }
     }
@@ -348,9 +358,9 @@ public class ResourceProviderTracker implements ResourceProviderStorageProvider
      */
     private void postResourceProviderChange(final ProviderEvent event) {
         final ObservationReporter or = this.providerReporter;
-        if ( or != null ) {
-            final ResourceChange change = new ResourceChange(event.isAdd ? ChangeType.PROVIDER_ADDED : ChangeType.PROVIDER_REMOVED,
-                    event.path, false);
+        if (or != null) {
+            final ResourceChange change = new ResourceChange(
+                    event.isAdd ? ChangeType.PROVIDER_ADDED : ChangeType.PROVIDER_REMOVED, event.path, false);
             or.reportChanges(Collections.singletonList(change), false);
         }
     }
@@ -359,25 +369,25 @@ public class ResourceProviderTracker implements ResourceProviderStorageProvider
         final List<ResourceProviderDTO> dtos = new ArrayList<>();
         final List<ResourceProviderFailureDTO> failures = new ArrayList<>();
 
-        synchronized ( this.handlers ) {
-            for(final List<ResourceProviderHandler> handlers : this.handlers.values()) {
+        synchronized (this.handlers) {
+            for (final List<ResourceProviderHandler> handlers : this.handlers.values()) {
                 boolean isFirst = true;
-                for(final ResourceProviderHandler h : handlers) {
+                for (final ResourceProviderHandler h : handlers) {
                     final ResourceProviderDTO d;
-                    if ( isFirst ) {
+                    if (isFirst) {
                         d = new ResourceProviderDTO();
                         dtos.add(d);
                         isFirst = false;
                     } else {
                         d = new ResourceProviderFailureDTO();
-                        ((ResourceProviderFailureDTO)d).reason = FailureReason.shadowed;
-                        failures.add((ResourceProviderFailureDTO)d);
+                        ((ResourceProviderFailureDTO) d).reason = FailureReason.shadowed;
+                        failures.add((ResourceProviderFailureDTO) d);
                     }
                     fill(d, h);
                 }
             }
         }
-        for(final Map.Entry<ResourceProviderInfo, FailureReason> entry : this.invalidProviders.entrySet()) {
+        for (final Map.Entry<ResourceProviderInfo, FailureReason> entry : this.invalidProviders.entrySet()) {
             final ResourceProviderFailureDTO d = new ResourceProviderFailureDTO();
             fill(d, entry.getKey());
             d.reason = entry.getValue();
@@ -395,9 +405,9 @@ public class ResourceProviderTracker implements ResourceProviderStorageProvider
                 if (storage == null) {
                     final List<ResourceProviderHandler> handlerList = new ArrayList<>();
                     for (List<ResourceProviderHandler> list : handlers.values()) {
-                        if ( !list.isEmpty() ) {
+                        if (!list.isEmpty()) {
                             final ResourceProviderHandler h = list.get(0);
-                            if (h != null && h.getResourceProvider() != null ) {
+                            if (h != null && h.getResourceProvider() != null) {
                                 handlerList.add(h);
                             }
                         }
@@ -418,7 +428,7 @@ public class ResourceProviderTracker implements ResourceProviderStorageProvider
         d.name = info.getName();
         d.path = info.getPath();
         d.refreshable = info.isRefreshable();
-        d.serviceId = (Long)info.getServiceReference().getProperty(Constants.SERVICE_ID);
+        d.serviceId = (Long) info.getServiceReference().getProperty(Constants.SERVICE_ID);
         d.supportsQueryLanguage = false;
         d.useResourceAccessSecurity = info.getUseResourceAccessSecurity();
     }
@@ -426,7 +436,7 @@ public class ResourceProviderTracker implements ResourceProviderStorageProvider
     private void fill(final ResourceProviderDTO d, final ResourceProviderHandler handler) {
         fill(d, handler.getInfo());
         final ResourceProvider<?> provider = handler.getResourceProvider();
-        if ( provider != null ) {
+        if (provider != null) {
             d.supportsQueryLanguage = provider.getQueryLanguageProvider() != null;
         }
     }
@@ -435,33 +445,31 @@ public class ResourceProviderTracker implements ResourceProviderStorageProvider
         final Set<String> excludedPaths = new HashSet<>();
         final Path handlerPath = new Path(handler.getPath());
 
-        for(final Map.Entry<String, List<ResourceProviderHandler>> entry : handlers.entrySet()) {
-            if ( entry.getValue().get(0).getInfo().getMode() == Mode.PASSTHROUGH ) {
+        for (final Map.Entry<String, List<ResourceProviderHandler>> entry : handlers.entrySet()) {
+            if (entry.getValue().get(0).getInfo().getMode() == Mode.PASSTHROUGH) {
                 continue;
             }
-            if ( !handler.getPath().equals(entry.getKey()) && handlerPath.matches(entry.getKey()) ) {
+            if (!handler.getPath().equals(entry.getKey()) && handlerPath.matches(entry.getKey())) {
                 excludedPaths.add(entry.getKey());
             }
         }
 
         final PathSet excludedPathSet = PathSet.fromStringCollection(excludedPaths);
-        handler.getProviderContext().update(
-                reporterGenerator.create(handlerPath, excludedPathSet),
-                excludedPathSet);
+        handler.getProviderContext().update(reporterGenerator.create(handlerPath, excludedPathSet), excludedPathSet);
     }
 
     private void postEvents(final List<ProviderEvent> events) {
-        if ( events.isEmpty() ) {
+        if (events.isEmpty()) {
             return;
         }
-        if ( this.listener == null && this.providerReporter == null ) {
+        if (this.listener == null && this.providerReporter == null) {
             return;
         }
         final Thread t = new Thread(new Runnable() {
 
             @Override
             public void run() {
-                for(final ProviderEvent e : events) {
+                for (final ProviderEvent e : events) {
                     postOSGiEvent(e);
                     postResourceProviderChange(e);
                 }
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/providers/stateful/AuthenticatedResourceProvider.java b/src/main/java/org/apache/sling/resourceresolver/impl/providers/stateful/AuthenticatedResourceProvider.java
index bc4895bc..2dcc3d4c 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/providers/stateful/AuthenticatedResourceProvider.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/providers/stateful/AuthenticatedResourceProvider.java
@@ -23,9 +23,6 @@ import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
 
-import org.jetbrains.annotations.Nullable;
-import org.jetbrains.annotations.NotNull;
-
 import org.apache.sling.api.resource.PersistenceException;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceResolver;
@@ -39,6 +36,8 @@ import org.apache.sling.spi.resource.provider.QueryLanguageProvider;
 import org.apache.sling.spi.resource.provider.ResolveContext;
 import org.apache.sling.spi.resource.provider.ResourceContext;
 import org.apache.sling.spi.resource.provider.ResourceProvider;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -69,7 +68,8 @@ public class AuthenticatedResourceProvider {
      * @param resolveContext resolveContext
      * @param tracker tracker
      */
-    public AuthenticatedResourceProvider(@NotNull final ResourceProviderHandler providerHandler,
+    public AuthenticatedResourceProvider(
+            @NotNull final ResourceProviderHandler providerHandler,
             final boolean useRAS,
             @NotNull final ResolveContext<Object> resolveContext,
             @NotNull final ResourceAccessSecurityTracker tracker) {
@@ -99,7 +99,7 @@ public class AuthenticatedResourceProvider {
      */
     public void refresh() {
         final ResourceProvider<Object> rp = this.providerHandler.getResourceProvider();
-        if ( rp != null ) {
+        if (rp != null) {
             rp.refresh(this.resolveContext);
         }
     }
@@ -111,7 +111,7 @@ public class AuthenticatedResourceProvider {
      */
     public boolean isLive() {
         final ResourceProvider<Object> rp = this.providerHandler.getResourceProvider();
-        if ( rp != null ) {
+        if (rp != null) {
             return rp.isLive(this.resolveContext);
         }
         return false;
@@ -125,7 +125,7 @@ public class AuthenticatedResourceProvider {
      */
     public Resource getParent(final Resource child) {
         final ResourceProvider<Object> rp = this.providerHandler.getResourceProvider();
-        if ( rp != null ) {
+        if (rp != null) {
             return wrapResource(rp.getParent(this.resolveContext, child));
         }
         return null;
@@ -140,11 +140,11 @@ public class AuthenticatedResourceProvider {
      */
     public Resource getResource(final String path, final Resource parent, final Map<String, String> parameters) {
         final ResourceProvider<Object> rp = this.providerHandler.getResourceProvider();
-        if ( rp == null ) {
+        if (rp == null) {
             return null;
         }
         final ResourceContext resourceContext;
-        if ( parameters != null ) {
+        if (parameters != null) {
             resourceContext = new ResourceContext() {
 
                 @Override
@@ -165,7 +165,7 @@ public class AuthenticatedResourceProvider {
      */
     public Iterator<Resource> listChildren(final Resource parent) {
         final ResourceProvider<Object> rp = this.providerHandler.getResourceProvider();
-        if ( rp != null ) {
+        if (rp != null) {
             return wrapIterator(rp.listChildren(this.resolveContext, parent));
         }
         return null;
@@ -177,7 +177,7 @@ public class AuthenticatedResourceProvider {
      */
     public void getAttributeNames(final Set<String> attributeNames) {
         final ResourceProvider<Object> rp = this.providerHandler.getResourceProvider();
-        if ( rp != null ) {
+        if (rp != null) {
             Collection<String> rpAttributeNames = rp.getAttributeNames(this.resolveContext);
             if (rpAttributeNames != null) {
                 attributeNames.addAll(rpAttributeNames);
@@ -192,7 +192,7 @@ public class AuthenticatedResourceProvider {
      */
     public Object getAttribute(final String name) {
         final ResourceProvider<Object> rp = this.providerHandler.getResourceProvider();
-        if ( rp != null ) {
+        if (rp != null) {
             return rp.getAttribute(this.resolveContext, name);
         }
         return null;
@@ -206,12 +206,10 @@ public class AuthenticatedResourceProvider {
      * @return the resource
      * @throws PersistenceException in case of problems
      */
-    public Resource create(final ResourceResolver resolver,
-            final String path,
-            final Map<String, Object> properties)
-    throws PersistenceException {
+    public Resource create(final ResourceResolver resolver, final String path, final Map<String, Object> properties)
+            throws PersistenceException {
         final ResourceProvider<Object> rp = this.providerHandler.getResourceProvider();
-        if ( rp != null && this.canCreate(resolver, path) ) {
+        if (rp != null && this.canCreate(resolver, path)) {
             return rp.create(this.resolveContext, path, properties);
         }
         return null;
@@ -225,8 +223,9 @@ public class AuthenticatedResourceProvider {
      * @return true if the order was changed, false if the order was correct already before
      * @throws PersistenceException in case of problems
      */
-    public boolean orderBefore(final @NotNull Resource parent, final @NotNull String name, final @Nullable String followingSiblingName) 
-        throws PersistenceException {
+    public boolean orderBefore(
+            final @NotNull Resource parent, final @NotNull String name, final @Nullable String followingSiblingName)
+            throws PersistenceException {
         final ResourceProvider<Object> rp = this.providerHandler.getResourceProvider();
         if (rp != null && this.canOrderChildren(parent)) {
             return rp.orderBefore(this.resolveContext, parent, name, followingSiblingName);
@@ -234,7 +233,7 @@ public class AuthenticatedResourceProvider {
             throw new PersistenceException("Unable to order child resources of " + parent.getPath());
         }
     }
-    
+
     /**
      * @see ResourceProvider#delete(ResolveContext, Resource)
      * @param resource resource
@@ -242,7 +241,7 @@ public class AuthenticatedResourceProvider {
      */
     public void delete(final Resource resource) throws PersistenceException {
         final ResourceProvider<Object> rp = this.providerHandler.getResourceProvider();
-        if ( rp != null && this.canDelete(resource) ) {
+        if (rp != null && this.canDelete(resource)) {
             rp.delete(this.resolveContext, resource);
         } else {
             throw new PersistenceException("Unable to delete resource " + resource.getPath());
@@ -254,7 +253,7 @@ public class AuthenticatedResourceProvider {
      */
     public void revert() {
         final ResourceProvider<Object> rp = this.providerHandler.getResourceProvider();
-        if ( rp != null ) {
+        if (rp != null) {
             rp.revert(this.resolveContext);
         }
     }
@@ -265,7 +264,7 @@ public class AuthenticatedResourceProvider {
      */
     public void commit() throws PersistenceException {
         final ResourceProvider<Object> rp = this.providerHandler.getResourceProvider();
-        if ( rp != null ) {
+        if (rp != null) {
             rp.commit(this.resolveContext);
         }
     }
@@ -276,7 +275,7 @@ public class AuthenticatedResourceProvider {
      */
     public boolean hasChanges() {
         final ResourceProvider<Object> rp = this.providerHandler.getResourceProvider();
-        if ( rp != null ) {
+        if (rp != null) {
             return rp.hasChanges(this.resolveContext);
         }
         return false;
@@ -288,7 +287,7 @@ public class AuthenticatedResourceProvider {
      */
     private QueryLanguageProvider<Object> getQueryLanguageProvider() {
         final ResourceProvider<Object> rp = this.providerHandler.getResourceProvider();
-        if ( rp != null ) {
+        if (rp != null) {
             return rp.getQueryLanguageProvider();
         }
         return null;
@@ -317,7 +316,8 @@ public class AuthenticatedResourceProvider {
         if (jcrQueryProvider == null) {
             return null;
         }
-        return wrapIterator(jcrQueryProvider.findResources(this.resolveContext, transformQuery(query, language), language));
+        return wrapIterator(
+                jcrQueryProvider.findResources(this.resolveContext, transformQuery(query, language), language));
     }
 
     /**
@@ -326,13 +326,14 @@ public class AuthenticatedResourceProvider {
      * @param language the language of the query
      * @return a map with the result
      */
-    @SuppressWarnings({ "unchecked", "rawtypes" })
+    @SuppressWarnings({"unchecked", "rawtypes"})
     public Iterator<Map<String, Object>> queryResources(final String query, final String language) {
         final QueryLanguageProvider<Object> jcrQueryProvider = getQueryLanguageProvider();
         if (jcrQueryProvider == null) {
             return null;
         }
-        return (Iterator) jcrQueryProvider.queryResources(this.resolveContext, transformQuery(query, language), language);
+        return (Iterator)
+                jcrQueryProvider.queryResources(this.resolveContext, transformQuery(query, language), language);
     }
 
     /**
@@ -343,7 +344,7 @@ public class AuthenticatedResourceProvider {
      */
     public <AdapterType> AdapterType adaptTo(final Class<AdapterType> type) {
         final ResourceProvider<Object> rp = this.providerHandler.getResourceProvider();
-        if ( rp != null ) {
+        if (rp != null) {
             return rp.adaptTo(this.resolveContext, type);
         }
         return null;
@@ -358,7 +359,7 @@ public class AuthenticatedResourceProvider {
      */
     public boolean copy(final String srcAbsPath, final String destAbsPath) throws PersistenceException {
         final ResourceProvider<Object> rp = this.providerHandler.getResourceProvider();
-        if ( rp != null ) {
+        if (rp != null) {
             return rp.copy(this.resolveContext, srcAbsPath, destAbsPath);
         }
         return false;
@@ -373,7 +374,7 @@ public class AuthenticatedResourceProvider {
      */
     public boolean move(final String srcAbsPath, final String destAbsPath) throws PersistenceException {
         final ResourceProvider<Object> rp = this.providerHandler.getResourceProvider();
-        if ( rp != null ) {
+        if (rp != null) {
             return rp.move(this.resolveContext, srcAbsPath, destAbsPath);
         }
         return false;
@@ -381,16 +382,16 @@ public class AuthenticatedResourceProvider {
 
     private boolean canCreate(final ResourceResolver resolver, final String path) {
         boolean allowed = true;
-        if ( this.useRAS ) {
+        if (this.useRAS) {
             final ResourceAccessSecurity security = tracker.getProviderResourceAccessSecurity();
-            if ( security != null ) {
+            if (security != null) {
                 allowed = security.canCreate(path, resolver);
             } else {
                 allowed = false;
             }
         }
 
-        if ( allowed ) {
+        if (allowed) {
             final ResourceAccessSecurity security = tracker.getApplicationResourceAccessSecurity();
             if (security != null) {
                 allowed = security.canCreate(path, resolver);
@@ -401,16 +402,16 @@ public class AuthenticatedResourceProvider {
 
     private boolean canOrderChildren(final Resource resource) {
         boolean allowed = true;
-        if ( this.useRAS ) {
+        if (this.useRAS) {
             final ResourceAccessSecurity security = tracker.getProviderResourceAccessSecurity();
-            if ( security != null ) {
+            if (security != null) {
                 allowed = security.canOrderChildren(resource);
             } else {
                 allowed = false;
             }
         }
 
-        if ( allowed ) {
+        if (allowed) {
             final ResourceAccessSecurity security = tracker.getApplicationResourceAccessSecurity();
             if (security != null) {
                 allowed = security.canOrderChildren(resource);
@@ -421,16 +422,16 @@ public class AuthenticatedResourceProvider {
 
     private boolean canDelete(final Resource resource) {
         boolean allowed = true;
-        if ( this.useRAS ) {
+        if (this.useRAS) {
             final ResourceAccessSecurity security = tracker.getProviderResourceAccessSecurity();
-            if ( security != null ) {
+            if (security != null) {
                 allowed = security.canDelete(resource);
             } else {
                 allowed = false;
             }
         }
 
-        if ( allowed ) {
+        if (allowed) {
             final ResourceAccessSecurity security = tracker.getApplicationResourceAccessSecurity();
             if (security != null) {
                 allowed = security.canDelete(resource);
@@ -442,12 +443,11 @@ public class AuthenticatedResourceProvider {
     /**
      * applies resource access security if configured
      */
-    private String transformQuery ( final String query, final String language ) {
+    private String transformQuery(final String query, final String language) {
         String returnValue = query;
 
         if (this.useRAS) {
-            final ResourceAccessSecurity resourceAccessSecurity = tracker
-                    .getProviderResourceAccessSecurity();
+            final ResourceAccessSecurity resourceAccessSecurity = tracker.getProviderResourceAccessSecurity();
             if (resourceAccessSecurity != null) {
                 try {
                     returnValue = resourceAccessSecurity.transformQuery(
@@ -455,13 +455,13 @@ public class AuthenticatedResourceProvider {
                 } catch (AccessSecurityException e) {
                     logger.error(
                             "AccessSecurityException occurred while trying to transform the query {} (language {}).",
-                            new Object[] { query, language }, e);
+                            new Object[] {query, language},
+                            e);
                 }
             }
         }
 
-        final ResourceAccessSecurity resourceAccessSecurity = tracker
-                .getApplicationResourceAccessSecurity();
+        final ResourceAccessSecurity resourceAccessSecurity = tracker.getApplicationResourceAccessSecurity();
         if (resourceAccessSecurity != null) {
             try {
                 returnValue = resourceAccessSecurity.transformQuery(
@@ -469,7 +469,8 @@ public class AuthenticatedResourceProvider {
             } catch (AccessSecurityException e) {
                 logger.error(
                         "AccessSecurityException occurred while trying to transform the query {} (language {}).",
-                        new Object[] { query, language }, e);
+                        new Object[] {query, language},
+                        e);
             }
         }
 
@@ -493,7 +494,7 @@ public class AuthenticatedResourceProvider {
             returnValue = rsrc;
         }
 
-        if ( returnValue != null ) {
+        if (returnValue != null) {
             final ResourceAccessSecurity resourceAccessSecurity = tracker.getApplicationResourceAccessSecurity();
             if (resourceAccessSecurity != null) {
                 returnValue = resourceAccessSecurity.getReadableResource(returnValue);
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/providers/stateful/BasicResolveContext.java b/src/main/java/org/apache/sling/resourceresolver/impl/providers/stateful/BasicResolveContext.java
index 03a7d8e6..0d42ac36 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/providers/stateful/BasicResolveContext.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/providers/stateful/BasicResolveContext.java
@@ -18,9 +18,6 @@
  */
 package org.apache.sling.resourceresolver.impl.providers.stateful;
 
-import org.jetbrains.annotations.Nullable;
-import org.jetbrains.annotations.NotNull;
-
 import org.apache.sling.api.resource.LoginException;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.api.resource.ResourceUtil;
@@ -29,6 +26,8 @@ import org.apache.sling.resourceresolver.impl.providers.ResourceProviderHandler;
 import org.apache.sling.resourceresolver.impl.providers.tree.Node;
 import org.apache.sling.spi.resource.provider.ResolveContext;
 import org.apache.sling.spi.resource.provider.ResourceProvider;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 
 /**
  * Resolve context implementation for a resource provider.
@@ -47,7 +46,8 @@ public class BasicResolveContext<T> implements ResolveContext<T> {
 
     private final String parentPath;
 
-    public BasicResolveContext(@NotNull final ResourceResolver resolver,
+    public BasicResolveContext(
+            @NotNull final ResourceResolver resolver,
             @NotNull final ProviderManager resolveContextManager,
             @NotNull final ResourceResolverControl control,
             @Nullable final T providerState,
@@ -84,21 +84,23 @@ public class BasicResolveContext<T> implements ResolveContext<T> {
     private Object[] getParentProviderAndContext() {
         ResourceProvider<?> parentProvider = null;
         ResolveContext<?> parentResolveContext = null;
-        if ( this.parentPath != null ) {
+        if (this.parentPath != null) {
             String path = this.parentPath;
-            while ( path != null && parentProvider == null ) {
-                final Node<ResourceProviderHandler> node = this.control.getResourceProviderStorage().getTree().getBestMatchingNode(path);
-                if ( node != null ) {
+            while (path != null && parentProvider == null) {
+                final Node<ResourceProviderHandler> node =
+                        this.control.getResourceProviderStorage().getTree().getBestMatchingNode(path);
+                if (node != null) {
                     final ResourceProviderHandler handler = node.getValue();
                     try {
-                       parentResolveContext = this.resolveContextManager.getOrCreateResolveContext(handler, this.control);
-                       if ( parentResolveContext != null ) {
-                           parentProvider = handler.getResourceProvider();
+                        parentResolveContext =
+                                this.resolveContextManager.getOrCreateResolveContext(handler, this.control);
+                        if (parentResolveContext != null) {
+                            parentProvider = handler.getResourceProvider();
                         }
-                    } catch ( final LoginException se) {
+                    } catch (final LoginException se) {
                         // skip this, try next
                     }
-                    if ( parentProvider == null ) {
+                    if (parentProvider == null) {
                         parentResolveContext = null;
                         path = ResourceUtil.getParent(path);
                     }
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/providers/stateful/ProviderManager.java b/src/main/java/org/apache/sling/resourceresolver/impl/providers/stateful/ProviderManager.java
index 0f30fc88..591de256 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/providers/stateful/ProviderManager.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/providers/stateful/ProviderManager.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.resourceresolver.impl.providers.stateful;
 
@@ -24,9 +25,6 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
-import org.jetbrains.annotations.Nullable;
-import org.jetbrains.annotations.NotNull;
-
 import org.apache.sling.api.resource.LoginException;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.api.resource.ResourceUtil;
@@ -37,6 +35,8 @@ import org.apache.sling.resourceresolver.impl.helper.ResourceResolverControl;
 import org.apache.sling.resourceresolver.impl.providers.ResourceProviderHandler;
 import org.apache.sling.spi.resource.provider.ResolveContext;
 import org.apache.sling.spi.resource.provider.ResourceProvider;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -65,7 +65,8 @@ public class ProviderManager {
 
     private final ResourceAccessSecurityTracker tracker;
 
-    public ProviderManager(@NotNull final ResourceResolver resolver, @NotNull final ResourceAccessSecurityTracker tracker) {
+    public ProviderManager(
+            @NotNull final ResourceResolver resolver, @NotNull final ResourceAccessSecurityTracker tracker) {
         this.contextMap = new IdentityHashMap<ResourceProviderHandler, AuthenticatedResourceProvider>();
         this.resolver = resolver;
         this.tracker = tracker;
@@ -78,21 +79,25 @@ public class ProviderManager {
      * @return The resource context or {@code null} if authentication failed previously.
      * @throws LoginException If login fails
      */
-    public @Nullable AuthenticatedResourceProvider getOrCreateProvider(@NotNull final ResourceProviderHandler handler,
-            @NotNull final ResourceResolverControl control)
-    throws LoginException {
+    public @Nullable AuthenticatedResourceProvider getOrCreateProvider(
+            @NotNull final ResourceProviderHandler handler, @NotNull final ResourceResolverControl control)
+            throws LoginException {
         AuthenticatedResourceProvider provider = this.contextMap.get(handler);
         if (provider == null) {
             final ResourceProvider<Object> resourceProvider = handler.useResourceProvider();
-            if ( resourceProvider != null ) {
+            if (resourceProvider != null) {
                 try {
                     provider = authenticate(handler, resourceProvider, control);
                     this.contextMap.put(handler, provider);
-                    if ( handler.getInfo().getAuthType() == AuthType.lazy || handler.getInfo().getAuthType() == AuthType.required ) {
-                        control.registerAuthenticatedProvider(handler, provider.getResolveContext().getProviderState());
+                    if (handler.getInfo().getAuthType() == AuthType.lazy
+                            || handler.getInfo().getAuthType() == AuthType.required) {
+                        control.registerAuthenticatedProvider(
+                                handler, provider.getResolveContext().getProviderState());
                     }
-                } catch ( final LoginException le) {
-                    logger.debug("Authentication to resource provider " + resourceProvider + " failed: " + le.getMessage(), le);
+                } catch (final LoginException le) {
+                    logger.debug(
+                            "Authentication to resource provider " + resourceProvider + " failed: " + le.getMessage(),
+                            le);
                     this.contextMap.put(handler, AuthenticatedResourceProvider.UNAUTHENTICATED_PROVIDER);
 
                     throw le;
@@ -112,9 +117,9 @@ public class ProviderManager {
      * @return The resource context or {@code null}.
      * @throws LoginException If authentication fails to one provider
      */
-    public @Nullable ResolveContext<Object> getOrCreateResolveContext(@NotNull final ResourceProviderHandler handler,
-            @NotNull final ResourceResolverControl control)
-    throws LoginException {
+    public @Nullable ResolveContext<Object> getOrCreateResolveContext(
+            @NotNull final ResourceProviderHandler handler, @NotNull final ResourceResolverControl control)
+            throws LoginException {
         AuthenticatedResourceProvider provider = this.getOrCreateProvider(handler, control);
         return provider == null ? null : provider.getResolveContext();
     }
@@ -125,18 +130,19 @@ public class ProviderManager {
      * @param control the resource resolver control
      * @throws LoginException If authentication fails to one provider
      */
-    public void authenticateAll(@NotNull final List<ResourceProviderHandler> handlers,
-            @NotNull final ResourceResolverControl control)
-    throws LoginException {
+    public void authenticateAll(
+            @NotNull final List<ResourceProviderHandler> handlers, @NotNull final ResourceResolverControl control)
+            throws LoginException {
         for (final ResourceProviderHandler h : handlers) {
             try {
                 this.getOrCreateProvider(h, control);
-            } catch ( final LoginException le ) {
+            } catch (final LoginException le) {
                 // authentication failed, logout from all successful handlers
-                for(final Map.Entry<ResourceProviderHandler, AuthenticatedResourceProvider> entry : this.contextMap.entrySet()) {
-                    if ( entry.getValue() != AuthenticatedResourceProvider.UNAUTHENTICATED_PROVIDER ) {
+                for (final Map.Entry<ResourceProviderHandler, AuthenticatedResourceProvider> entry :
+                        this.contextMap.entrySet()) {
+                    if (entry.getValue() != AuthenticatedResourceProvider.UNAUTHENTICATED_PROVIDER) {
                         final ResourceProvider<Object> provider = entry.getKey().getResourceProvider();
-                        if ( provider != null ) {
+                        if (provider != null) {
                             provider.logout(entry.getValue().getResolveContext().getProviderState());
                         }
                     }
@@ -156,37 +162,39 @@ public class ProviderManager {
      * @return The resolve context
      * @throws LoginException If authentication fails
      */
-    private @NotNull AuthenticatedResourceProvider authenticate(@NotNull final ResourceProviderHandler handler,
+    private @NotNull AuthenticatedResourceProvider authenticate(
+            @NotNull final ResourceProviderHandler handler,
             @NotNull final ResourceProvider<Object> provider,
-            @NotNull final ResourceResolverControl control) throws LoginException {
+            @NotNull final ResourceResolverControl control)
+            throws LoginException {
         boolean isAuthenticated = false;
         Object contextData = null;
-        if ( (handler.getInfo().getAuthType() == AuthType.required || handler.getInfo().getAuthType() == AuthType.lazy) ) {
+        if ((handler.getInfo().getAuthType() == AuthType.required
+                || handler.getInfo().getAuthType() == AuthType.lazy)) {
             try {
                 contextData = provider.authenticate(control.getAuthenticationInfo());
                 isAuthenticated = true;
-            } catch ( final LoginException le ) {
+            } catch (final LoginException le) {
                 logger.debug("Unable to login into resource provider " + provider, le);
                 throw le;
             }
         }
 
-        final ResolveContext<Object> context = new BasicResolveContext<Object>(this.resolver,
+        final ResolveContext<Object> context = new BasicResolveContext<Object>(
+                this.resolver,
                 this,
                 control,
                 contextData,
                 ResourceUtil.getParent(handler.getInfo().getPath()));
-        final AuthenticatedResourceProvider rp = new AuthenticatedResourceProvider(handler,
-                handler.getInfo().getUseResourceAccessSecurity(),
-                context,
-                this.tracker);
-        if ( isAuthenticated ) {
+        final AuthenticatedResourceProvider rp = new AuthenticatedResourceProvider(
+                handler, handler.getInfo().getUseResourceAccessSecurity(), context, this.tracker);
+        if (isAuthenticated) {
             this.authenticated.add(rp);
         }
-        if ( handler.getInfo().isModifiable() ) {
+        if (handler.getInfo().isModifiable()) {
             this.modifiable.add(rp);
         }
-        if ( handler.getInfo().isRefreshable() ) {
+        if (handler.getInfo().isRefreshable()) {
             this.refreshable.add(rp);
         }
 
@@ -205,8 +213,8 @@ public class ProviderManager {
         return new ArrayList<AuthenticatedResourceProvider>(refreshable);
     }
 
-    public Iterable<AuthenticatedResourceProvider> getAllBestEffort(@NotNull final List<ResourceProviderHandler> handlers,
-            @NotNull final ResourceResolverControl control) {
+    public Iterable<AuthenticatedResourceProvider> getAllBestEffort(
+            @NotNull final List<ResourceProviderHandler> handlers, @NotNull final ResourceResolverControl control) {
         final Iterator<ResourceProviderHandler> handlerIter = handlers.iterator();
         return new Iterable<AuthenticatedResourceProvider>() {
 
@@ -217,11 +225,11 @@ public class ProviderManager {
                     @Override
                     protected AuthenticatedResourceProvider seek() {
                         AuthenticatedResourceProvider result = null;
-                        while ( result == null && handlerIter.hasNext() ) {
+                        while (result == null && handlerIter.hasNext()) {
                             final ResourceProviderHandler h = handlerIter.next();
                             try {
                                 result = getOrCreateProvider(h, control);
-                            } catch ( final LoginException le) {
+                            } catch (final LoginException le) {
                                 // ignore
                             }
                         }
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/providers/tree/Node.java b/src/main/java/org/apache/sling/resourceresolver/impl/providers/tree/Node.java
index d5a834a5..d23340b3 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/providers/tree/Node.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/providers/tree/Node.java
@@ -64,9 +64,9 @@ public class Node<T> {
             return children;
         }
     }
-    
+
     @Override
     public String toString() {
-        return "[" + getClass().getSimpleName() + "# value: " + value +" ]";
+        return "[" + getClass().getSimpleName() + "# value: " + value + " ]";
     }
-}
\ No newline at end of file
+}
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/providers/tree/PathTree.java b/src/main/java/org/apache/sling/resourceresolver/impl/providers/tree/PathTree.java
index 8f81271d..cc3c3d11 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/providers/tree/PathTree.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/providers/tree/PathTree.java
@@ -18,11 +18,11 @@
  */
 package org.apache.sling.resourceresolver.impl.providers.tree;
 
-import static org.apache.commons.lang3.StringUtils.split;
-
 import java.util.Iterator;
 import java.util.List;
 
+import static org.apache.commons.lang3.StringUtils.split;
+
 public class PathTree<T extends Pathable> {
 
     private Node<T> root;
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/providers/tree/Pathable.java b/src/main/java/org/apache/sling/resourceresolver/impl/providers/tree/Pathable.java
index 8c7a90df..f5fc889e 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/providers/tree/Pathable.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/providers/tree/Pathable.java
@@ -21,5 +21,4 @@ package org.apache.sling.resourceresolver.impl.providers.tree;
 public interface Pathable {
 
     String getPath();
-
 }
diff --git a/src/test/java/org/apache/sling/resourceresolver/impl/EtcMappingResourceResolverTest.java b/src/test/java/org/apache/sling/resourceresolver/impl/EtcMappingResourceResolverTest.java
index 5873414a..a2c0cf4e 100644
--- a/src/test/java/org/apache/sling/resourceresolver/impl/EtcMappingResourceResolverTest.java
+++ b/src/test/java/org/apache/sling/resourceresolver/impl/EtcMappingResourceResolverTest.java
@@ -1,21 +1,29 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information 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
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * 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
  *
- * 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.
+ * 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.
  */
 package org.apache.sling.resourceresolver.impl;
 
+import javax.servlet.http.HttpServletRequest;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.api.resource.ResourceResolverFactory;
@@ -23,8 +31,8 @@ import org.apache.sling.api.resource.observation.ResourceChange;
 import org.apache.sling.api.resource.path.Path;
 import org.apache.sling.resourceresolver.impl.mapping.MapConfigurationProvider;
 import org.apache.sling.resourceresolver.impl.mapping.MapEntries;
-import org.apache.sling.resourceresolver.impl.mapping.StringInterpolationProviderConfiguration;
 import org.apache.sling.resourceresolver.impl.mapping.StringInterpolationProvider;
+import org.apache.sling.resourceresolver.impl.mapping.StringInterpolationProviderConfiguration;
 import org.apache.sling.resourceresolver.impl.mapping.StringInterpolationProviderImpl;
 import org.apache.sling.resourceresolver.impl.providers.ResourceProviderHandler;
 import org.apache.sling.resourceresolver.impl.providers.ResourceProviderStorage;
@@ -40,11 +48,6 @@ import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.service.event.EventAdmin;
 
-import javax.servlet.http.HttpServletRequest;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
 import static java.util.Arrays.asList;
 import static org.apache.sling.resourceresolver.impl.MockedResourceResolverImplTest.createRPHandler;
 import static org.apache.sling.resourceresolver.impl.ResourceResolverImpl.PROP_REDIRECT_INTERNAL;
@@ -133,7 +136,8 @@ public class EtcMappingResourceResolverTest {
         setInaccessibleField("serviceUserMapper", activator, serviceUserMapper);
         commonFactory = spy(new CommonResourceResolverFactoryImpl(activator));
         when(bundleContext.getBundle()).thenReturn(bundle);
-        when(serviceUserMapper.getServiceUserID(nullable(Bundle.class),nullable(String.class))).thenReturn("mapping");
+        when(serviceUserMapper.getServiceUserID(nullable(Bundle.class), nullable(String.class)))
+                .thenReturn("mapping");
         // Activate method is package private so we use reflection to to call it
         callInaccessibleMethod("activate", null, commonFactory, BundleContext.class, bundleContext);
         final Bundle usingBundle = mock(Bundle.class);
@@ -164,22 +168,29 @@ public class EtcMappingResourceResolverTest {
      * @param isExternal External flag of the ResourceChange event
      */
     void refreshMapEntries(String path, boolean isExternal) {
-        ((MapEntries) commonFactory.getMapEntries()).onChange(
-            asList(
-                new ResourceChange(ResourceChange.ChangeType.ADDED, path, isExternal)
-            )
-        );
+        ((MapEntries) commonFactory.getMapEntries())
+                .onChange(asList(new ResourceChange(ResourceChange.ChangeType.ADDED, path, isExternal)));
     }
 
     @Test
     public void root_node_to_content_mapping() throws Exception {
-        buildResource(http.getPath() + "/localhost.8080", http, resourceResolver, resourceProvider, PROP_REDIRECT_EXTERNAL, "/content/simple-node");
+        buildResource(
+                http.getPath() + "/localhost.8080",
+                http,
+                resourceResolver,
+                resourceProvider,
+                PROP_REDIRECT_EXTERNAL,
+                "/content/simple-node");
         // This updates the map entries so that the newly added resources are added.
-        // ATTENTION: only call this after all etc-mapping resources are defined as this lock their Resource Meta Data and prevents a re-update
+        // ATTENTION: only call this after all etc-mapping resources are defined as this lock their Resource Meta Data
+        // and prevents a re-update
         refreshMapEntries("/etc/map", true);
 
-        ExpectedEtcMapping expectedEtcMapping = new ExpectedEtcMapping("^http/localhost.8080/", "/content/simple-node/");
-        expectedEtcMapping.assertEtcMap("Etc Mapping for root node to content", commonFactory.getMapEntries().getResolveMaps());
+        ExpectedEtcMapping expectedEtcMapping =
+                new ExpectedEtcMapping("^http/localhost.8080/", "/content/simple-node/");
+        expectedEtcMapping.assertEtcMap(
+                "Etc Mapping for root node to content",
+                commonFactory.getMapEntries().getResolveMaps());
 
         HttpServletRequest request = createRequestFromUrl("http://localhost:8080/");
         Resource resolvedResource = resourceResolver.resolve(request, "/");
@@ -188,29 +199,47 @@ public class EtcMappingResourceResolverTest {
 
     @Test
     public void match_to_content_mapping() throws Exception {
-        buildResource("test-node", http, resourceResolver, resourceProvider,
-            PROP_REG_EXP, "localhost.8080/",
-            PROP_REDIRECT_EXTERNAL, "/content/simple-match/"
-        );
+        buildResource(
+                "test-node",
+                http,
+                resourceResolver,
+                resourceProvider,
+                PROP_REG_EXP,
+                "localhost.8080/",
+                PROP_REDIRECT_EXTERNAL,
+                "/content/simple-match/");
         refreshMapEntries("/etc/map", true);
 
-        ExpectedEtcMapping expectedEtcMapping = new ExpectedEtcMapping("^http/localhost.8080/", "/content/simple-match/");
-        expectedEtcMapping.assertEtcMap("Etc Mapping for match to content", commonFactory.getMapEntries().getResolveMaps());
+        ExpectedEtcMapping expectedEtcMapping =
+                new ExpectedEtcMapping("^http/localhost.8080/", "/content/simple-match/");
+        expectedEtcMapping.assertEtcMap(
+                "Etc Mapping for match to content",
+                commonFactory.getMapEntries().getResolveMaps());
 
         HttpServletRequest request = createRequestFromUrl("http://localhost:8080/");
         Resource resolvedResource = resourceResolver.resolve(request, "/");
         checkRedirectResource(resolvedResource, "/content/simple-match/", 302);
     }
 
-    // The following tests are based on the example from the https://sling.apache.org/documentation/the-sling-engine/mappings-for-resource-resolution.html page
+    // The following tests are based on the example from the
+    // https://sling.apache.org/documentation/the-sling-engine/mappings-for-resource-resolution.html page
 
     @Test
     public void internal_to_external_node_mapping() throws Exception {
-        buildResource("example.com.80", http, resourceResolver, resourceProvider, PROP_REDIRECT_EXTERNAL, "http://www.example.com/");
+        buildResource(
+                "example.com.80",
+                http,
+                resourceResolver,
+                resourceProvider,
+                PROP_REDIRECT_EXTERNAL,
+                "http://www.example.com/");
         refreshMapEntries("/etc/map", true);
 
-        ExpectedEtcMapping expectedEtcMapping = new ExpectedEtcMapping("^http/example.com.80/", "http://www.example.com/");
-        expectedEtcMapping.assertEtcMap("Etc Mapping for internal to external based on node", commonFactory.getMapEntries().getResolveMaps());
+        ExpectedEtcMapping expectedEtcMapping =
+                new ExpectedEtcMapping("^http/example.com.80/", "http://www.example.com/");
+        expectedEtcMapping.assertEtcMap(
+                "Etc Mapping for internal to external based on node",
+                commonFactory.getMapEntries().getResolveMaps());
 
         HttpServletRequest request = createRequestFromUrl("http://example.com/");
         Resource resolvedResource = resourceResolver.resolve(request, "/");
@@ -221,11 +250,15 @@ public class EtcMappingResourceResolverTest {
     public void internal_root_to_content_node_mapping() throws Exception {
         buildResource("/example", null, resourceResolver, resourceProvider);
 
-        buildResource("www.example.com.80", http, resourceResolver, resourceProvider, PROP_REDIRECT_INTERNAL, "/example");
+        buildResource(
+                "www.example.com.80", http, resourceResolver, resourceProvider, PROP_REDIRECT_INTERNAL, "/example");
         refreshMapEntries("/etc/map", true);
 
-        ExpectedEtcMapping expectedEtcMapping = new ExpectedEtcMapping().addEtcMapEntry("^http/www.example.com.80/", true, "/example/");
-        expectedEtcMapping.assertEtcMap("Etc Mapping for internal root to content", commonFactory.getMapEntries().getResolveMaps());
+        ExpectedEtcMapping expectedEtcMapping =
+                new ExpectedEtcMapping().addEtcMapEntry("^http/www.example.com.80/", true, "/example/");
+        expectedEtcMapping.assertEtcMap(
+                "Etc Mapping for internal root to content",
+                commonFactory.getMapEntries().getResolveMaps());
 
         HttpServletRequest request = createRequestFromUrl("http://www.example.com:80/");
         Resource resolvedResource = resourceResolver.resolve(request, "/");
@@ -234,14 +267,22 @@ public class EtcMappingResourceResolverTest {
 
     @Test
     public void host_redirect_match_mapping() throws Exception {
-        buildResource("any_example.com.80", http, resourceResolver, resourceProvider,
-            PROP_REG_EXP, ".+\\.example\\.com\\.80",
-            PROP_REDIRECT_EXTERNAL, "http://www.example.com/"
-        );
+        buildResource(
+                "any_example.com.80",
+                http,
+                resourceResolver,
+                resourceProvider,
+                PROP_REG_EXP,
+                ".+\\.example\\.com\\.80",
+                PROP_REDIRECT_EXTERNAL,
+                "http://www.example.com/");
         refreshMapEntries("/etc/map", true);
 
-        ExpectedEtcMapping expectedEtcMapping = new ExpectedEtcMapping().addEtcMapEntry("^http/.+\\.example\\.com\\.80", false, "http://www.example.com/");
-        expectedEtcMapping.assertEtcMap("Etc Mapping for host redirect match mapping", commonFactory.getMapEntries().getResolveMaps());
+        ExpectedEtcMapping expectedEtcMapping = new ExpectedEtcMapping()
+                .addEtcMapEntry("^http/.+\\.example\\.com\\.80", false, "http://www.example.com/");
+        expectedEtcMapping.assertEtcMap(
+                "Etc Mapping for host redirect match mapping",
+                commonFactory.getMapEntries().getResolveMaps());
 
         HttpServletRequest request = createRequestFromUrl("http://www.example.com");
         Resource resolvedResource = resourceResolver.resolve(request, "/");
@@ -250,22 +291,31 @@ public class EtcMappingResourceResolverTest {
 
     @Test
     public void nested_internal_mixed_mapping() throws Exception {
-        Resource localhost = buildResource("localhost_any", http, resourceResolver, resourceProvider,
-            PROP_REG_EXP, "localhost\\.\\d*",
-            PROP_REDIRECT_INTERNAL, "/content"
-        );
-        buildResource("cgi-bin", localhost, resourceResolver, resourceProvider,PROP_REDIRECT_INTERNAL, "/scripts");
-        buildResource("gateway", localhost, resourceResolver, resourceProvider,PROP_REDIRECT_INTERNAL, "http://gbiv.com");
-        buildResource("(stories)", localhost, resourceResolver, resourceProvider,PROP_REDIRECT_INTERNAL, "/anecdotes/$1");
+        Resource localhost = buildResource(
+                "localhost_any",
+                http,
+                resourceResolver,
+                resourceProvider,
+                PROP_REG_EXP,
+                "localhost\\.\\d*",
+                PROP_REDIRECT_INTERNAL,
+                "/content");
+        buildResource("cgi-bin", localhost, resourceResolver, resourceProvider, PROP_REDIRECT_INTERNAL, "/scripts");
+        buildResource(
+                "gateway", localhost, resourceResolver, resourceProvider, PROP_REDIRECT_INTERNAL, "http://gbiv.com");
+        buildResource(
+                "(stories)", localhost, resourceResolver, resourceProvider, PROP_REDIRECT_INTERNAL, "/anecdotes/$1");
 
         refreshMapEntries("/etc/map", true);
 
         ExpectedEtcMapping expectedEtcMapping = new ExpectedEtcMapping()
-            .addEtcMapEntry("^http/localhost\\.\\d*", true, "/content")
-            .addEtcMapEntry("^http/localhost\\.\\d*/cgi-bin/", true, "/scripts/")
-            .addEtcMapEntry("^http/localhost\\.\\d*/gateway/", true, "http://gbiv.com/")
-            .addEtcMapEntry("^http/localhost\\.\\d*/(stories)/", true, "/anecdotes/$1/");
-        expectedEtcMapping.assertEtcMap("Etc Mapping for nested internal mixed mapping", commonFactory.getMapEntries().getResolveMaps());
+                .addEtcMapEntry("^http/localhost\\.\\d*", true, "/content")
+                .addEtcMapEntry("^http/localhost\\.\\d*/cgi-bin/", true, "/scripts/")
+                .addEtcMapEntry("^http/localhost\\.\\d*/gateway/", true, "http://gbiv.com/")
+                .addEtcMapEntry("^http/localhost\\.\\d*/(stories)/", true, "/anecdotes/$1/");
+        expectedEtcMapping.assertEtcMap(
+                "Etc Mapping for nested internal mixed mapping",
+                commonFactory.getMapEntries().getResolveMaps());
 
         buildResource("/content", null, resourceResolver, resourceProvider);
         Resource scripts = buildResource("/scripts", null, resourceResolver, resourceProvider);
@@ -281,22 +331,34 @@ public class EtcMappingResourceResolverTest {
         checkInternalResource(resolvedResource, "/scripts");
         resolvedResource = resourceResolver.resolve(request, "/cgi-bin/child/");
         checkInternalResource(resolvedResource, "/scripts/child");
-//AS TODO: Does not redirect -> investigate later
-//        resolvedResource = resourceResolver.resolve(request, "/gateway/");
-//        checkRedirectResource(resolvedResource, "http://gbiv.com/", 302);
+        // AS TODO: Does not redirect -> investigate later
+        //        resolvedResource = resourceResolver.resolve(request, "/gateway/");
+        //        checkRedirectResource(resolvedResource, "http://gbiv.com/", 302);
         resolvedResource = resourceResolver.resolve(request, "/stories/");
         checkInternalResource(resolvedResource, "/anecdotes/stories");
     }
 
     @Test
     public void simple_node_string_interpolation() throws Exception {
-        buildResource("$[config:siv.one]", http, resourceResolver, resourceProvider,PROP_REDIRECT_EXTERNAL, "/content/simple-node");
-        setupStringInterpolationProvider(stringInterpolationProvider, stringInterpolationProviderConfiguration, new String[] {"siv.one=test-simple-node.80"});
+        buildResource(
+                "$[config:siv.one]",
+                http,
+                resourceResolver,
+                resourceProvider,
+                PROP_REDIRECT_EXTERNAL,
+                "/content/simple-node");
+        setupStringInterpolationProvider(
+                stringInterpolationProvider,
+                stringInterpolationProviderConfiguration,
+                new String[] {"siv.one=test-simple-node.80"});
 
         refreshMapEntries("/etc/map", true);
 
-        ExpectedEtcMapping expectedEtcMapping = new ExpectedEtcMapping("^http/test-simple-node.80/", "/content/simple-node/");
-        expectedEtcMapping.assertEtcMap("String Interpolation for simple match", commonFactory.getMapEntries().getResolveMaps());
+        ExpectedEtcMapping expectedEtcMapping =
+                new ExpectedEtcMapping("^http/test-simple-node.80/", "/content/simple-node/");
+        expectedEtcMapping.assertEtcMap(
+                "String Interpolation for simple match",
+                commonFactory.getMapEntries().getResolveMaps());
 
         Resource content = buildResource("/content", null, resourceResolver, resourceProvider);
         Resource simpleNode = buildResource("/content/simple-node", content, resourceResolver, resourceProvider);
@@ -308,16 +370,27 @@ public class EtcMappingResourceResolverTest {
 
     @Test
     public void simple_match_string_interpolation() throws Exception {
-        buildResource("test-node", http, resourceResolver, resourceProvider,
-            PROP_REG_EXP, "$[config:siv.one]/",
-            PROP_REDIRECT_EXTERNAL, "/content/simple-match/"
-        );
-        setupStringInterpolationProvider(stringInterpolationProvider, stringInterpolationProviderConfiguration, new String[] {"siv.one=test-simple-match.80"});
+        buildResource(
+                "test-node",
+                http,
+                resourceResolver,
+                resourceProvider,
+                PROP_REG_EXP,
+                "$[config:siv.one]/",
+                PROP_REDIRECT_EXTERNAL,
+                "/content/simple-match/");
+        setupStringInterpolationProvider(
+                stringInterpolationProvider,
+                stringInterpolationProviderConfiguration,
+                new String[] {"siv.one=test-simple-match.80"});
 
         refreshMapEntries("/etc/map", true);
 
-        ExpectedEtcMapping expectedEtcMapping = new ExpectedEtcMapping("^http/test-simple-match.80/", "/content/simple-match/");
-        expectedEtcMapping.assertEtcMap("String Interpolation for simple match", commonFactory.getMapEntries().getResolveMaps());
+        ExpectedEtcMapping expectedEtcMapping =
+                new ExpectedEtcMapping("^http/test-simple-match.80/", "/content/simple-match/");
+        expectedEtcMapping.assertEtcMap(
+                "String Interpolation for simple match",
+                commonFactory.getMapEntries().getResolveMaps());
 
         HttpServletRequest request = createRequestFromUrl("http://test-simple-match:80/");
         Resource resolvedResource = resourceResolver.resolve(request, "/");
@@ -337,11 +410,19 @@ public class EtcMappingResourceResolverTest {
      */
     @Test
     public void endless_circular_mapping() throws Exception {
-        buildResource(http.getPath() + "/localhost.8080", http, resourceResolver, resourceProvider, PROP_REDIRECT_EXTERNAL, "/content");
+        buildResource(
+                http.getPath() + "/localhost.8080",
+                http,
+                resourceResolver,
+                resourceProvider,
+                PROP_REDIRECT_EXTERNAL,
+                "/content");
         refreshMapEntries("/etc/map", true);
 
         ExpectedEtcMapping expectedEtcMapping = new ExpectedEtcMapping("^http/localhost.8080/", "/content/");
-        expectedEtcMapping.assertEtcMap("Etc Mapping for root node to content", commonFactory.getMapEntries().getResolveMaps());
+        expectedEtcMapping.assertEtcMap(
+                "Etc Mapping for root node to content",
+                commonFactory.getMapEntries().getResolveMaps());
 
         buildResource("/content/test", null, resourceResolver, resourceProvider);
         buildResource("/content/content/test", null, resourceResolver, resourceProvider);
diff --git a/src/test/java/org/apache/sling/resourceresolver/impl/FactoryPreconditionsTest.java b/src/test/java/org/apache/sling/resourceresolver/impl/FactoryPreconditionsTest.java
index 03710cc9..74f08b3d 100644
--- a/src/test/java/org/apache/sling/resourceresolver/impl/FactoryPreconditionsTest.java
+++ b/src/test/java/org/apache/sling/resourceresolver/impl/FactoryPreconditionsTest.java
@@ -18,9 +18,6 @@
  */
 package org.apache.sling.resourceresolver.impl;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
@@ -36,9 +33,13 @@ import org.mockito.Mockito;
 import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceReference;
 
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
 public class FactoryPreconditionsTest {
 
-    @Test public void testNoRequiredProviders() {
+    @Test
+    public void testNoRequiredProviders() {
         final ResourceProviderTracker tracker = Mockito.mock(ResourceProviderTracker.class);
         final ResourceProviderStorage storage = Mockito.mock(ResourceProviderStorage.class);
         Mockito.when(tracker.getResourceProviderStorage()).thenReturn(storage);
@@ -47,7 +48,7 @@ public class FactoryPreconditionsTest {
 
         assertTrue(conditions.checkPreconditions());
 
-        conditions = new FactoryPreconditions(tracker, Collections.<String> emptySet(), Collections.<String> emptySet());
+        conditions = new FactoryPreconditions(tracker, Collections.<String>emptySet(), Collections.<String>emptySet());
 
         assertTrue(conditions.checkPreconditions());
     }
@@ -55,7 +56,7 @@ public class FactoryPreconditionsTest {
     private List<ResourceProviderHandler> getResourceProviderHandlers(String[] pids) {
         final List<ResourceProviderHandler> result = new ArrayList<ResourceProviderHandler>();
 
-        for(final String p : pids) {
+        for (final String p : pids) {
             final ResourceProviderHandler handler = Mockito.mock(ResourceProviderHandler.class);
             final ResourceProviderInfo info = Mockito.mock(ResourceProviderInfo.class);
             final ServiceReference ref = Mockito.mock(ServiceReference.class);
@@ -72,7 +73,7 @@ public class FactoryPreconditionsTest {
     private List<ResourceProviderHandler> getResourceProviderHandlersWithNames(String[] names) {
         final List<ResourceProviderHandler> result = new ArrayList<ResourceProviderHandler>();
 
-        for(final String n : names) {
+        for (final String n : names) {
             final ResourceProviderHandler handler = Mockito.mock(ResourceProviderHandler.class);
             final ResourceProviderInfo info = Mockito.mock(ResourceProviderInfo.class);
             Mockito.when(info.getName()).thenReturn(n);
@@ -86,18 +87,21 @@ public class FactoryPreconditionsTest {
         return result;
     }
 
-    @Test public void testPIDs() {
+    @Test
+    public void testPIDs() {
         final ResourceProviderTracker tracker = Mockito.mock(ResourceProviderTracker.class);
         final ResourceProviderStorage storage = Mockito.mock(ResourceProviderStorage.class);
         Mockito.when(tracker.getResourceProviderStorage()).thenReturn(storage);
 
-        FactoryPreconditions conditions = new FactoryPreconditions(tracker, null, new HashSet<>(Arrays.asList("pid1", "pid3")));
+        FactoryPreconditions conditions =
+                new FactoryPreconditions(tracker, null, new HashSet<>(Arrays.asList("pid1", "pid3")));
 
         final List<ResourceProviderHandler> handlers1 = getResourceProviderHandlers(new String[] {"pid2"});
         Mockito.when(storage.getAllHandlers()).thenReturn(handlers1);
         assertFalse(conditions.checkPreconditions());
 
-        final List<ResourceProviderHandler> handlers2 = getResourceProviderHandlers(new String[] {"pid1", "pid2", "pid3"});
+        final List<ResourceProviderHandler> handlers2 =
+                getResourceProviderHandlers(new String[] {"pid1", "pid2", "pid3"});
         Mockito.when(storage.getAllHandlers()).thenReturn(handlers2);
         assertTrue(conditions.checkPreconditions());
 
@@ -106,18 +110,21 @@ public class FactoryPreconditionsTest {
         assertFalse(conditions.checkPreconditions());
     }
 
-    @Test public void testNames() {
+    @Test
+    public void testNames() {
         final ResourceProviderTracker tracker = Mockito.mock(ResourceProviderTracker.class);
         final ResourceProviderStorage storage = Mockito.mock(ResourceProviderStorage.class);
         Mockito.when(tracker.getResourceProviderStorage()).thenReturn(storage);
 
-        FactoryPreconditions conditions = new FactoryPreconditions(tracker, new HashSet<>(Arrays.asList("n1", "n2")), null);
+        FactoryPreconditions conditions =
+                new FactoryPreconditions(tracker, new HashSet<>(Arrays.asList("n1", "n2")), null);
 
         final List<ResourceProviderHandler> handlers1 = getResourceProviderHandlersWithNames(new String[] {"n2"});
         Mockito.when(storage.getAllHandlers()).thenReturn(handlers1);
         assertFalse(conditions.checkPreconditions());
 
-        final List<ResourceProviderHandler> handlers2 = getResourceProviderHandlersWithNames(new String[] {"n1", "n2", "n3"});
+        final List<ResourceProviderHandler> handlers2 =
+                getResourceProviderHandlersWithNames(new String[] {"n1", "n2", "n3"});
         Mockito.when(storage.getAllHandlers()).thenReturn(handlers2);
         assertTrue(conditions.checkPreconditions());
 
diff --git a/src/test/java/org/apache/sling/resourceresolver/impl/FactoryRegistrationHandlerTest.java b/src/test/java/org/apache/sling/resourceresolver/impl/FactoryRegistrationHandlerTest.java
index 1ee8f74e..4c47861c 100644
--- a/src/test/java/org/apache/sling/resourceresolver/impl/FactoryRegistrationHandlerTest.java
+++ b/src/test/java/org/apache/sling/resourceresolver/impl/FactoryRegistrationHandlerTest.java
@@ -52,21 +52,16 @@ class FactoryRegistrationHandlerTest {
 
     private static final int DEFAULT_TEST_ITERATIONS = 20;
 
-    private static final @NotNull Matcher<Iterable<? extends ServiceEventDTO>> RRF_REGISTRATION = allOf(
-            hasSize(4),
-            hasItem(registration(ResourceResolverFactory.class))
-    );
+    private static final @NotNull Matcher<Iterable<? extends ServiceEventDTO>> RRF_REGISTRATION =
+            allOf(hasSize(4), hasItem(registration(ResourceResolverFactory.class)));
 
-    private static final @NotNull Matcher<Iterable<? extends ServiceEventDTO>> RRF_UNREGISTRATION = allOf(
-            hasSize(4),
-            hasItem(unregistration(ResourceResolverFactory.class))
-    );
+    private static final @NotNull Matcher<Iterable<? extends ServiceEventDTO>> RRF_UNREGISTRATION =
+            allOf(hasSize(4), hasItem(unregistration(ResourceResolverFactory.class)));
 
     private static final @NotNull Matcher<Iterable<? extends ServiceEventDTO>> RRF_REREGISTRATION = allOf(
             hasSize(8),
             hasItem(unregistration(ResourceResolverFactory.class)),
-            hasItem(registration(ResourceResolverFactory.class))
-    );
+            hasItem(registration(ResourceResolverFactory.class)));
 
     OsgiContext osgi = new OsgiContext();
 
@@ -75,7 +70,9 @@ class FactoryRegistrationHandlerTest {
     @BeforeEach
     void setUp() {
         final ResourceProviderTracker resourceProviderTracker = mock(ResourceProviderTracker.class);
-        doReturn(mock(ResourceProviderStorage.class)).when(resourceProviderTracker).getResourceProviderStorage();
+        doReturn(mock(ResourceProviderStorage.class))
+                .when(resourceProviderTracker)
+                .getResourceProviderStorage();
 
         final VanityPathConfigurer vanityPathConfigurer = mock(VanityPathConfigurer.class);
         doReturn(false).when(vanityPathConfigurer).isVanityPathEnabled();
@@ -139,7 +136,6 @@ class FactoryRegistrationHandlerTest {
         }
     }
 
-
     @RepeatedTest(DEFAULT_TEST_ITERATIONS)
     void testReconfigurationLeadingToUnregsitration() throws InterruptedException {
         final BundleContext ctx = osgi.bundleContext();
@@ -160,6 +156,7 @@ class FactoryRegistrationHandlerTest {
             }
         }
     }
+
     @RepeatedTest(DEFAULT_TEST_ITERATIONS)
     void testReconfigurationWithNoChanges() throws InterruptedException {
         final BundleContext ctx = osgi.bundleContext();
@@ -217,8 +214,10 @@ class FactoryRegistrationHandlerTest {
             factoryRegistrationHandler.close();
             listener.assertRecorded(allOf(RRF_UNREGISTRATION));
 
-            assertThrows(IllegalStateException.class, () -> factoryRegistrationHandler.configure(activator, preconditions),
+            assertThrows(
+                    IllegalStateException.class,
+                    () -> factoryRegistrationHandler.configure(activator, preconditions),
                     "Reconfiguration is no longer possible after a FactoryRegistrationHandler is closed.");
         }
     }
-}
\ No newline at end of file
+}
diff --git a/src/test/java/org/apache/sling/resourceresolver/impl/Fixture.java b/src/test/java/org/apache/sling/resourceresolver/impl/Fixture.java
index f959df0e..82c0ace8 100644
--- a/src/test/java/org/apache/sling/resourceresolver/impl/Fixture.java
+++ b/src/test/java/org/apache/sling/resourceresolver/impl/Fixture.java
@@ -35,56 +35,64 @@ import org.osgi.framework.ServiceRegistration;
 /**
  * The <tt>Fixture</tt> holds reusable, shared, test setup code
  */
-public class Fixture { 
+public class Fixture {
 
     private final BundleContext bc;
-    private final Map<ResourceProviderInfo, ServiceRegistration> providerRegistrations = new HashMap<ResourceProviderInfo, ServiceRegistration>();
-    
+    private final Map<ResourceProviderInfo, ServiceRegistration> providerRegistrations =
+            new HashMap<ResourceProviderInfo, ServiceRegistration>();
+
     public Fixture(BundleContext bc) {
         this.bc = bc;
     }
 
-    public ResourceProviderInfo registerResourceProvider(ResourceProvider<?> rp, String root, 
-            AuthType authType) throws InvalidSyntaxException {
-        return registerResourceProvider(rp,  root, authType, 0);
+    public ResourceProviderInfo registerResourceProvider(ResourceProvider<?> rp, String root, AuthType authType)
+            throws InvalidSyntaxException {
+        return registerResourceProvider(rp, root, authType, 0);
     }
 
-    public ResourceProviderInfo registerResourceProvider(ResourceProvider<?> rp, String root, 
-            AuthType authType, int serviceRanking) throws InvalidSyntaxException {
+    public ResourceProviderInfo registerResourceProvider(
+            ResourceProvider<?> rp, String root, AuthType authType, int serviceRanking) throws InvalidSyntaxException {
         return registerResourceProvider(rp, root, authType, serviceRanking, true, null);
     }
 
-    public ResourceProviderInfo registerResourceProvider(ResourceProvider<?> rp, String root, 
-    AuthType authType, int serviceRanking, boolean modifiable, ResourceProviderInfo.Mode mode) throws InvalidSyntaxException {
-            Dictionary<String, Object> props = new Hashtable<>();
+    public ResourceProviderInfo registerResourceProvider(
+            ResourceProvider<?> rp,
+            String root,
+            AuthType authType,
+            int serviceRanking,
+            boolean modifiable,
+            ResourceProviderInfo.Mode mode)
+            throws InvalidSyntaxException {
+        Dictionary<String, Object> props = new Hashtable<>();
         props.put(ResourceProvider.PROPERTY_ROOT, root);
         props.put(ResourceProvider.PROPERTY_AUTHENTICATE, authType.name());
         props.put(ResourceProvider.PROPERTY_MODIFIABLE, modifiable);
         if (serviceRanking != 0) {
             props.put(Constants.SERVICE_RANKING, serviceRanking);
         }
-        if ( mode != null ) {
+        if (mode != null) {
             props.put(ResourceProvider.PROPERTY_MODE, mode.name());
         }
-        
+
         ServiceRegistration registration = bc.registerService(ResourceProvider.class.getName(), rp, props);
-        
+
         ServiceReference sr = registration.getReference();
-        
+
         ResourceProviderInfo providerInfo = new ResourceProviderInfo(sr);
 
         providerRegistrations.put(providerInfo, registration);
-        
+
         return providerInfo;
     }
-    
+
     public void unregisterResourceProvider(ResourceProviderInfo info) {
-        
+
         ServiceRegistration registration = providerRegistrations.remove(info);
-        if ( registration == null ) {
-            throw new IllegalArgumentException("No " + ServiceRegistration.class.getSimpleName() + " found for " + info);
+        if (registration == null) {
+            throw new IllegalArgumentException(
+                    "No " + ServiceRegistration.class.getSimpleName() + " found for " + info);
         }
-        
+
         registration.unregister();
     }
-}
\ No newline at end of file
+}
diff --git a/src/test/java/org/apache/sling/resourceresolver/impl/MockedResourceResolverImplTest.java b/src/test/java/org/apache/sling/resourceresolver/impl/MockedResourceResolverImplTest.java
index 4768bc2c..0f9dfc6f 100644
--- a/src/test/java/org/apache/sling/resourceresolver/impl/MockedResourceResolverImplTest.java
+++ b/src/test/java/org/apache/sling/resourceresolver/impl/MockedResourceResolverImplTest.java
@@ -1,39 +1,27 @@
 /*
  * 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.resourceresolver.impl;
 
-import static org.apache.sling.resourceresolver.util.MockTestUtil.getInaccessibleField;
-import static org.apache.sling.resourceresolver.util.MockTestUtil.getResourceName;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertThrows;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.anyString;
-import static org.mockito.ArgumentMatchers.same;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
+import javax.servlet.http.HttpServletRequest;
 
 import java.lang.annotation.Annotation;
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.Collections;
 import java.util.Dictionary;
 import java.util.HashMap;
@@ -46,8 +34,6 @@ import java.util.Set;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
-import javax.servlet.http.HttpServletRequest;
-
 import org.apache.commons.lang3.StringUtils;
 import org.apache.sling.api.resource.LoginException;
 import org.apache.sling.api.resource.Resource;
@@ -76,7 +62,6 @@ import org.mockito.ArgumentCaptor;
 import org.mockito.Mock;
 import org.mockito.Mockito;
 import org.mockito.MockitoAnnotations;
-import org.mockito.invocation.Invocation;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
@@ -84,7 +69,20 @@ import org.osgi.framework.ServiceFactory;
 import org.osgi.framework.ServiceReference;
 import org.osgi.framework.ServiceRegistration;
 
+import static org.apache.sling.resourceresolver.util.MockTestUtil.getInaccessibleField;
+import static org.apache.sling.resourceresolver.util.MockTestUtil.getResourceName;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThrows;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.ArgumentMatchers.nullable;
+import static org.mockito.ArgumentMatchers.same;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
 
 /**
  * This tests the ResourceResolver using mocks. The Unit test is in addition to
@@ -147,7 +145,6 @@ public class MockedResourceResolverImplTest {
     @Mock
     private ResourceProvider<?> queriableResourceProviderA;
 
-
     public MockedResourceResolverImplTest() {
         MockitoAnnotations.initMocks(this);
     }
@@ -162,7 +159,8 @@ public class MockedResourceResolverImplTest {
         Mockito.when(systemBundle.getState()).thenReturn(Bundle.ACTIVE);
         Mockito.when(bundleContext.getBundle(Constants.SYSTEM_BUNDLE_LOCATION)).thenReturn(systemBundle);
         CountDownLatch factoryRegistrationDone = new CountDownLatch(1);
-        Mockito.when(bundleContext.registerService(same(ResourceResolverFactory.class), any(ServiceFactory.class), any(Dictionary.class)))
+        Mockito.when(bundleContext.registerService(
+                        same(ResourceResolverFactory.class), any(ServiceFactory.class), any(Dictionary.class)))
                 .thenAnswer(invocation -> {
                     factoryRegistrationDone.countDown();
                     return mock(ServiceRegistration.class);
@@ -171,152 +169,165 @@ public class MockedResourceResolverImplTest {
         activator.resourceAccessSecurityTracker = new ResourceAccessSecurityTracker();
         activator.resourceProviderTracker = resourceProviderTracker;
         activator.changeListenerWhiteboard = resourceChangeListenerWhiteboard;
-        handlers.add(createRPHandler(resourceProvider, "org.apache.sling.resourceresolver.impl.DummyTestProvider", 10L, "/"));
+        handlers.add(createRPHandler(
+                resourceProvider, "org.apache.sling.resourceresolver.impl.DummyTestProvider", 10L, "/"));
 
         // setup mapping resources at /etc/map to exercise vanity etc.
         // hmm, can't provide the resolver since its not up and ready.
         // mapping almost certainly work properly until this can be setup correctly.
         buildMappingResource("/etc/map", mappingResourceProvider, null);
 
-        handlers.add(createRPHandler(mappingResourceProvider, "org.apache.sling.resourceresolver.impl.MapProvider", 11L, "/etc"));
-        handlers.add(createRPHandler(appsResourceProvider, "org.apache.sling.resourceresolver.impl.AppsProvider", 12L, "/libs"));
-        handlers.add(createRPHandler(appsResourceProvider, "org.apache.sling.resourceresolver.impl.AppsProvider", 13L, "/apps"));
... 9732 lines suppressed ...


(sling-org-apache-sling-resourceresolver) 01/02: SLING-12716 Switch to Parent 62

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

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

commit 5ea74c75a8987da83fc6becf5824c8b491255262
Author: Stefan Seifert <st...@users.noreply.github.com>
AuthorDate: Thu Mar 27 09:32:37 2025 +0100

    SLING-12716 Switch to Parent 62
---
 .sling-module.json | 5 +++++
 pom.xml            | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/.sling-module.json b/.sling-module.json
new file mode 100644
index 00000000..cfad4d23
--- /dev/null
+++ b/.sling-module.json
@@ -0,0 +1,5 @@
+{
+  "jenkins": {
+    "jdks": [17, 21]
+  }
+}
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index d7240bfb..f3212728 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling-bundle-parent</artifactId>
-        <version>52</version>
+        <version>62</version>
         <relativePath />
     </parent>