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

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-scxml.git


The following commit(s) were added to refs/heads/master by this push:
     new f97fa48  Revert "Use modern Map API"
f97fa48 is described below

commit f97fa48dea9de0fe3fc30907cbe6377ae4b240a6
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Sat Jul 8 11:27:36 2023 -0400

    Revert "Use modern Map API"
    
    This reverts commit 54204868d34208e0b02843bcf476123534841c68.
---
 src/main/java/org/apache/commons/scxml2/SCInstance.java | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/main/java/org/apache/commons/scxml2/SCInstance.java 
b/src/main/java/org/apache/commons/scxml2/SCInstance.java
index 5a1e839..f417e6a 100644
--- a/src/main/java/org/apache/commons/scxml2/SCInstance.java
+++ b/src/main/java/org/apache/commons/scxml2/SCInstance.java
@@ -484,11 +484,12 @@ public class SCInstance implements Serializable {
      * @return The context.
      */
     public Context getContext(final EnterableState state) {
-        return contexts.computeIfAbsent(state, k -> {
-            Context context;
+        Context context = contexts.get(state);
+        if (context == null) {
             if (singleContext) {
                 context = getGlobalContext();
-            } else {
+            }
+            else {
                 final EnterableState parent = state.getParent();
                 if (parent == null) {
                     // docroot
@@ -498,11 +499,12 @@ public class SCInstance implements Serializable {
                 }
             }
             if (state instanceof TransitionalState) {
-                final Datamodel datamodel = ((TransitionalState) 
state).getDatamodel();
+                final Datamodel datamodel = 
((TransitionalState)state).getDatamodel();
                 cloneDatamodel(datamodel, context, evaluator, errorReporter);
             }
-            return context;
-        });
+            contexts.put(state, context);
+        }
+        return context;
     }
 
     /**

Reply via email to