You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ra...@apache.org on 2022/06/21 09:02:57 UTC

[sling-org-apache-sling-scripting-sightly-js-provider] branch issues/SLING-11373 created (now d9af868)

This is an automated email from the ASF dual-hosted git repository.

radu pushed a change to branch issues/SLING-11373
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-sightly-js-provider.git


      at d9af868  SLING-11373 - The MergingServletResourceProvider does not wrap resources correctly

This branch includes the following new commits:

     new d9af868  SLING-11373 - The MergingServletResourceProvider does not wrap resources correctly

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[sling-org-apache-sling-scripting-sightly-js-provider] 01/01: SLING-11373 - The MergingServletResourceProvider does not wrap resources correctly

Posted by ra...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

radu pushed a commit to branch issues/SLING-11373
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-sightly-js-provider.git

commit d9af8682f1fd92c6a3bc5f94e05faa01d5fd44cd
Author: Radu Cotescu <ra...@apache.org>
AuthorDate: Tue Jun 21 11:02:08 2022 +0200

    SLING-11373 - The MergingServletResourceProvider does not wrap resources correctly
    
    * switched to getResource
---
 .../scripting/sightly/js/impl/use/DependencyResolver.java    | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/src/main/java/org/apache/sling/scripting/sightly/js/impl/use/DependencyResolver.java b/src/main/java/org/apache/sling/scripting/sightly/js/impl/use/DependencyResolver.java
index b150c1e..f4c2fc8 100644
--- a/src/main/java/org/apache/sling/scripting/sightly/js/impl/use/DependencyResolver.java
+++ b/src/main/java/org/apache/sling/scripting/sightly/js/impl/use/DependencyResolver.java
@@ -126,18 +126,12 @@ public class DependencyResolver {
     private Resource resolveResource(String type) {
         Resource servletResource = null;
         if (type.startsWith("/")) {
-            servletResource = scriptingResourceResolver.resolve(type);
-            if (ResourceUtil.isNonExistingResource(servletResource)) {
-                servletResource = scriptingResourceResolver.getResource(type);
-            }
+            servletResource = scriptingResourceResolver.getResource(type);
         } else {
             for (String searchPath : scriptingResourceResolver.getSearchPath()) {
-                String absolutePath = ResourceUtil.normalize(searchPath + "/" + type);
+                String absolutePath = ResourceUtil.normalize(searchPath + type);
                 if (absolutePath != null) {
-                    servletResource = scriptingResourceResolver.resolve(absolutePath);
-                    if (ResourceUtil.isNonExistingResource(servletResource)) {
-                        servletResource = scriptingResourceResolver.getResource(type);
-                    }
+                    servletResource = scriptingResourceResolver.getResource(absolutePath);
                     if (servletResource != null) {
                         return servletResource;
                     }