This is an automated email from the ASF dual-hosted git repository. joerghoh pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-resourceresolver.git
The following commit(s) were added to refs/heads/master by this push: new 3ba9b8c SLING-12054 display WARNing when optimized alias resolution is not used (#106) 3ba9b8c is described below commit 3ba9b8ceef71020dad8f57e3ffc6e2585346dce0 Author: Jörg Hoh <joerg...@users.noreply.github.com> AuthorDate: Fri Sep 29 13:39:35 2023 +0200 SLING-12054 display WARNing when optimized alias resolution is not used (#106) * SLING-12054 display WARNing when optimized alias resolution is not used --- .../sling/resourceresolver/impl/ResourceResolverFactoryActivator.java | 4 ++++ .../sling/resourceresolver/impl/ResourceResolverFactoryConfig.java | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) 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 39bc17c..0a3cd2f 100644 --- a/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverFactoryActivator.java +++ b/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverFactoryActivator.java @@ -295,6 +295,10 @@ public class ResourceResolverFactoryActivator { 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"); + } // for testing: if we run unit test, both trackers are set from the outside final boolean hasPreRegisteredResourceProviderTracker = this.resourceProviderTracker != null; 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 1c16e96..73b0711 100644 --- a/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverFactoryConfig.java +++ b/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverFactoryConfig.java @@ -149,8 +149,8 @@ public @interface ResourceResolverFactoryConfig { @AttributeDefinition(name = "Optimize alias resolution", description ="This flag controls whether to optimize" + - " the alias resolution by creating an internal cache of aliases. This might have an impact on the startup time"+ - " and on the alias update time if the number of aliases is huge (over 10000).") + " 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",