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

colegreer pushed a commit to branch GValueManager3.8-wip
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git


The following commit(s) were added to refs/heads/GValueManager3.8-wip by this 
push:
     new a91ff1832c fix GValueManagerVerifier tests failing due to map key 
collisions
a91ff1832c is described below

commit a91ff1832cb9b3bbf3e184b9901797c8072e8206
Author: Cole-Greer <[email protected]>
AuthorDate: Mon Jun 16 12:36:26 2025 -0700

    fix GValueManagerVerifier tests failing due to map key collisions
---
 .../traversal/strategy/GValueManagerVerifier.java     | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git 
a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/GValueManagerVerifier.java
 
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/GValueManagerVerifier.java
index 90f06edeba..45564422e9 100644
--- 
a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/GValueManagerVerifier.java
+++ 
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/GValueManagerVerifier.java
@@ -36,6 +36,7 @@ import java.util.Collections;
 import java.util.IdentityHashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Set;
 import java.util.stream.Collectors;
 
@@ -187,12 +188,18 @@ public class GValueManagerVerifier {
 
             // compute the preStepVariables from the preStepGValues by 
converting the GValue to their name if
             // their isVariable is true
-            this.preStepVariables = preStepGValues.entrySet().stream().
-                    collect(Collectors.toMap(Map.Entry::getKey,
-                            e -> e.getValue().stream().
-                                    filter(GValue::isVariable).
-                                    map(GValue::getName).
-                                    collect(Collectors.toSet())
+            this.preStepVariables = preStepGValues.entrySet().stream()
+                    .collect(java.util.stream.Collectors.toMap(
+                            Map.Entry::getKey,
+                            e -> e.getValue().stream()
+                                    .filter(GValue::isVariable)
+                                    .map(GValue::getName)
+                                    
.collect(java.util.stream.Collectors.toSet()),
+                            (v1, v2) -> {
+                                v1.addAll(v2);
+                                return v1;
+                            },
+                            IdentityHashMap::new
                     ));
         }
 

Reply via email to