From d199b49eee7b3f3af6683a1db9ffbd1f9dd02525 Mon Sep 17 00:00:00 2001 From: Nayan Date: Thu, 26 Oct 2023 11:08:00 +0600 Subject: [PATCH] chore: Use concurrent set instead of set (#28298) ## Description Replaced set with concurrent set #### PR fixes following issue(s) Fixes #28322 --- .../onpageload/internal/PageLoadExecutablesUtilCEImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/onpageload/internal/PageLoadExecutablesUtilCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/onpageload/internal/PageLoadExecutablesUtilCEImpl.java index fef69e7f49..681b506f05 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/onpageload/internal/PageLoadExecutablesUtilCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/onpageload/internal/PageLoadExecutablesUtilCEImpl.java @@ -34,6 +34,7 @@ import java.util.List; import java.util.Map; import java.util.Optional; import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicReference; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -101,7 +102,7 @@ public class PageLoadExecutablesUtilCEImpl implements PageLoadExecutablesUtilCE Set onPageLoadExecutableSetRef = new HashSet<>(); Set explicitUserSetOnLoadExecutablesRef = new HashSet<>(); - Set bindingsFromExecutablesRef = new HashSet<>(); + Set bindingsFromExecutablesRef = ConcurrentHashMap.newKeySet(); // Function `extractAndSetExecutableBindingsInGraphEdges` updates this map to keep a track of all the // executables which @@ -857,7 +858,7 @@ public class PageLoadExecutablesUtilCEImpl implements PageLoadExecutablesUtilCE // All executables found from possibleExecutableNames set would add their dependencies in the following set for // further // walk to find more executables recursively. - Set newBindings = new HashSet<>(); + Set newBindings = ConcurrentHashMap.newKeySet(); // First fetch all the executables in the page whose name matches the words found in all the dynamic bindings Mono> findAndAddExecutablesInBindingsMono = getPossibleEntityReferences(