xiazcy commented on code in PR #2361:
URL: https://github.com/apache/tinkerpop/pull/2361#discussion_r1403674590


##########
gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalTest.java:
##########
@@ -174,8 +175,13 @@ else if (boolean.class.isAssignableFrom(type))
                         else if (String[].class.isAssignableFrom(type)) {
                             arguments[i] = new String[random.nextInt(10) + 1];
                             for (int j = 0; j < ((String[]) 
arguments[i]).length; j++) {
-                                list.add(((String[]) arguments[i])[j] = 
randomString(random));
+                                list.add(((String[]) arguments[i])[j] = 
arguments[0] + randomString(random)); // adds the first string to all to avoid 
duplicates
                             }
+                            // makes sure that no duplicated random string is 
created by removing duplicates
+                            arguments[i] = Arrays.stream((String[]) 
arguments[i]).distinct().toArray(String[]::new);
+                            final Set<Object> tempSet = new 
LinkedHashSet<>(list);
+                            list.clear();
+                            list.addAll(tempSet);

Review Comment:
   updated in 
https://github.com/apache/tinkerpop/pull/2361/commits/701245111c6d72c762d3ef9635b0e2046fcf165e



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to