Skip to content

Commit ed4e92d

Browse files
committed
SLING-12519 - Remove Double-Checked Locking in ScriptableBase.java
* Replaced with a simpler, non-thread-safe version to improve readability, as current acccess is already confined to a single thread.
1 parent c4fac55 commit ed4e92d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/org/apache/sling/scripting/javascript/wrapper/ScriptableBase.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ public abstract class ScriptableBase extends ScriptableObject {
3636

3737
public static final String JSFUNC_PREFIX = "jsFunction_";
3838

39-
protected synchronized Object getNative(String name, Scriptable start) {
39+
/** Not thread-safe: designed for use in single-threaded environments only. */
40+
protected Object getNative(String name, Scriptable start) {
4041
final Object wrapped = getWrappedObject();
4142

4243
if (wrapped == null) {

0 commit comments

Comments
 (0)