-
Notifications
You must be signed in to change notification settings - Fork 753
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LinkImpl: avoid redundant repository lookups #2453
Conversation
Kudos, SonarCloud Quality Gate passed! |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2453 +/- ##
============================================
- Coverage 87.21% 87.17% -0.04%
- Complexity 2665 2668 +3
============================================
Files 233 233
Lines 7123 7128 +5
Branches 1085 1090 +5
============================================
+ Hits 6212 6214 +2
- Misses 362 363 +1
- Partials 549 551 +2 ☔ View full report in Codecov by Sentry. |
# Conflicts: # bundles/core/src/main/java/com/adobe/cq/wcm/core/components/internal/link/LinkBuilderImpl.java
Quality Gate passedIssues Measures |
The LinkBuilderImpl does a few lookups in the repository (mostly path-to-resource lookups), which are redundant and can be avoided.
This is the case if the LinkBuilderImpl is already invoked with a linktarget of an asset or a page; there is no need to retrieve the asset/page again from the path of the provided object).
Also in the creation of the linkUrl there is no need to trying to resolve the path back to a page to determine if the ".html" extension should be added, this information is already available.