incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1348631 - in /sling/trunk: bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/DefaultSlingScript.java launchpad/builder/src/main/bundles/list.xml
Date Sun, 10 Jun 2012 18:07:32 GMT
Author: cziegeler
Date: Sun Jun 10 18:07:32 2012
New Revision: 1348631

URL: http://svn.apache.org/viewvc?rev=1348631&view=rev
Log:
SLING-2507 : Thread local for resource resolver does not handle includes correctly

Modified:
    sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/DefaultSlingScript.java
    sling/trunk/launchpad/builder/src/main/bundles/list.xml

Modified: sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/DefaultSlingScript.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/DefaultSlingScript.java?rev=1348631&r1=1348630&r2=1348631&view=diff
==============================================================================
--- sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/DefaultSlingScript.java
(original)
+++ sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/DefaultSlingScript.java
Sun Jun 10 18:07:32 2012
@@ -18,6 +18,7 @@
  */
 package org.apache.sling.scripting.core.impl;
 
+import static org.apache.sling.api.scripting.SlingBindings.FLUSH;
 import static org.apache.sling.api.scripting.SlingBindings.LOG;
 import static org.apache.sling.api.scripting.SlingBindings.OUT;
 import static org.apache.sling.api.scripting.SlingBindings.READER;
@@ -25,7 +26,6 @@ import static org.apache.sling.api.scrip
 import static org.apache.sling.api.scripting.SlingBindings.RESOURCE;
 import static org.apache.sling.api.scripting.SlingBindings.RESPONSE;
 import static org.apache.sling.api.scripting.SlingBindings.SLING;
-import static org.apache.sling.api.scripting.SlingBindings.FLUSH;
 
 import java.io.BufferedReader;
 import java.io.IOException;
@@ -182,6 +182,7 @@ class DefaultSlingScript implements Slin
         Bindings bindings = null;
         Reader reader = null;
         boolean disposeScriptHelper = !props.containsKey(SLING);
+        ResourceResolver oldResolver = null;
         try {
             bindings = verifySlingBindings(props);
 
@@ -343,6 +344,7 @@ class DefaultSlingScript implements Slin
 
             // set the current resource resolver if a request is available from the bindings
             if ( props.getRequest() != null ) {
+                oldResolver = requestResourceResolver.get();
                 requestResourceResolver.set(props.getRequest().getResourceResolver());
             }
 
@@ -387,7 +389,9 @@ class DefaultSlingScript implements Slin
                 cause);
 
         } finally {
-            requestResourceResolver.remove();
+            if ( props.getRequest() != null ) {
+                requestResourceResolver.set(oldResolver);
+            }
 
             // close the script reader (SLING-380)
             if (reader != null) {

Modified: sling/trunk/launchpad/builder/src/main/bundles/list.xml
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/builder/src/main/bundles/list.xml?rev=1348631&r1=1348630&r2=1348631&view=diff
==============================================================================
--- sling/trunk/launchpad/builder/src/main/bundles/list.xml (original)
+++ sling/trunk/launchpad/builder/src/main/bundles/list.xml Sun Jun 10 18:07:32 2012
@@ -170,7 +170,7 @@
         <bundle>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.scripting.core</artifactId>
-            <version>2.0.22</version>
+            <version>2.0.23-SNAPSHOT</version>
         </bundle>
         <bundle>
             <groupId>org.apache.sling</groupId>



Mime
View raw message