Do not disable optimized Sling Alias resolution by default #29
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since release 4.1.4 we've set to
resource.resolver.optimize.alias.resolution=false
for the Resource Resolver Factory by default in unit tests, although this is not the Sling default. Having it enabled did/does not work with actual alias resolution in unit test context.Starting with Sling Resource Resolver 1.11.2 a WARN is logged that this "unoptimized code path" is flawed and will be removed in a future version. So we should not disable it by default.
So, since release 5.4.4 we've enabled by default for Resource Resolver:
resource.resolver.optimize.alias.resolution=true
resource.resolver.enable.vanitypath=true
With this setting, sling:alias resolution is fully supported using
JCR_OAK
resource resolver type. You have to keep in mind the sling:alias is processed asynchronously, see example test.As a downside, sling:alias is no longer supported with
JCR_MOCK
resource resolver type, because that does not support JCR Observation events. You can still switch to the old behavior by settingresource.resolver.optimize.alias.resolution=false
explicitly, see example test - but this relies on deprecated functionality.