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 2021/08/02 16:14:46 UTC

[sling-org-apache-sling-scripting-core] 02/02: trivial: use the LazyBindings.Supplier for the properties key

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

radu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-core.git

commit 6341c17afa74ca9eef7389fe2530d9335fc41766
Author: Radu Cotescu <ra...@apache.org>
AuthorDate: Mon Aug 2 18:13:50 2021 +0200

    trivial: use the LazyBindings.Supplier for the properties key
---
 .../apache/sling/scripting/core/impl/bundled/ScriptContextProvider.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/scripting/core/impl/bundled/ScriptContextProvider.java b/src/main/java/org/apache/sling/scripting/core/impl/bundled/ScriptContextProvider.java
index f11586f..c4612fd 100644
--- a/src/main/java/org/apache/sling/scripting/core/impl/bundled/ScriptContextProvider.java
+++ b/src/main/java/org/apache/sling/scripting/core/impl/bundled/ScriptContextProvider.java
@@ -98,7 +98,7 @@ public class ScriptContextProvider implements BundleListener {
         }
         // prepare the SlingBindings
         Bindings bindings = new LazyBindings();
-        bindings.put("properties", request.getResource().getValueMap());
+        bindings.put("properties", (LazyBindings.Supplier) () -> request.getResource().getValueMap());
         bindings.put(SlingBindings.REQUEST, request);
         bindings.put(SlingBindings.RESPONSE, response);
         bindings.put(SlingBindings.READER, request.getReader());