This is an automated email from the ASF dual-hosted git repository.
reschke pushed a commit to branch SLING-12648
in repository
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-resourceresolver.git
The following commit(s) were added to refs/heads/SLING-12648 by this push:
new edc83f0 SLING-12648: MapEntries: factor out vanity path handling -
move 'updateTargetPaths'
edc83f0 is described below
commit edc83f0a26af5f717efe1ea9d338c46b664e81ce
Author: Julian Reschke <[email protected]>
AuthorDate: Fri Feb 14 17:23:11 2025 +0100
SLING-12648: MapEntries: factor out vanity path handling - move
'updateTargetPaths'
---
.../resourceresolver/impl/mapping/MapEntries.java | 26 +++++++++++-----------
1 file changed, 13 insertions(+), 13 deletions(-)
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 5c0c297..9d95abc 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
@@ -1003,18 +1003,6 @@ public class MapEntries implements
return it;
}
- private void updateTargetPaths(final Map<String, List<String>>
targetPaths, final String key, final String entry) {
- if (entry == null) {
- return;
- }
- List<String> entries = targetPaths.get(key);
- if (entries == null) {
- entries = new ArrayList<>();
- targetPaths.put(key, entries);
- }
- entries.add(entry);
- }
-
private void loadConfiguration(final MapConfigurationProvider factory,
final List<MapEntry> entries) {
// virtual uris
final Map<String, String> virtuals = factory.getVirtualURLMap();
@@ -1552,6 +1540,18 @@ public class MapEntries implements
return targetPaths;
}
+ private void updateTargetPaths(final Map<String, List<String>>
targetPaths, final String key, final String entry) {
+ if (entry == null) {
+ return;
+ }
+ List<String> entries = targetPaths.get(key);
+ if (entries == null) {
+ entries = new ArrayList<>();
+ targetPaths.put(key, entries);
+ }
+ entries.add(entry);
+ }
+
/**
* Load vanity path given a resource
*
@@ -1627,7 +1627,7 @@ public class MapEntries implements
}
if (addedEntry) {
// 3. keep the path to return
- MapEntries.this.updateTargetPaths(targetPaths,
redirect, checkPath);
+ this.updateTargetPaths(targetPaths, redirect,
checkPath);
if (updateCounter) {
vanityCounter.addAndGet(2);