You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "royteeuwen (via GitHub)" <gi...@apache.org> on 2026/07/29 05:43:48 UTC
[PR] SLING-13275: cache the result of the getParentResourceType call (backport to 1.x) [sling-org-apache-sling-resourceresolver]
royteeuwen opened a new pull request, #219:
URL: https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/219
Backport of [SLING-12244](https://issues.apache.org/jira/browse/SLING-12244) to the 1.x maintenance branch, tracked as [SLING-13275](https://issues.apache.org/jira/browse/SLING-13275).
Caches the result of `ResourceResolver.getParentResourceType(Resource)` in a per-resolver map keyed by resource path, avoiding repeated repository access for the same resource. The cache is cleared on `refresh()` alongside the existing `resourceTypeLookupCache`.
Cherry-picked from master commit `3abb019`, released in Resource Resolver 2.0.0. It was never backported, so the 1.x line still resolves the parent resource type on every call.
### Note for reviewers
This changes lookup semantics, not just performance: a `sling:resourceSuperType` change is no longer observed by an already-open resolver until `refresh()` is called. That is the same behaviour 2.x has shipped with since 2.0.0.
### Verification
`mvn clean verify` on this branch: BUILD SUCCESS, 645 tests, 0 failures (adds `ResourceResolverImplTest#testGetParentResourceType`, which asserts the second lookup is served from the cache).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] SLING-13275: cache the result of the getParentResourceType call (backport to 1.x) [sling-org-apache-sling-resourceresolver]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #219:
URL: https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/219#issuecomment-5113738464
## [](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-resourceresolver&pullRequest=219) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver&pullRequest=219&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver&pullRequest=219&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-resourceresolver&pullRequest=219&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [100.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-resourceresolver&pullRequest=219&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-resourceresolver&pullRequest=219&metric=new_duplicated_lines_density&view=list)
<!-- sqra-placement-anchor -->
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-resourceresolver&pullRequest=219)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] SLING-13275: cache the result of the getParentResourceType call (backport to 1.x) [sling-org-apache-sling-resourceresolver]
Posted by "royteeuwen (via GitHub)" <gi...@apache.org>.
royteeuwen merged PR #219:
URL: https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/219
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org