xiazcy commented on code in PR #2361:
URL: https://github.com/apache/tinkerpop/pull/2361#discussion_r1403649505
##########
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
Review Comment:
No, this array is strictly argument[1]. The way this is set up, the actual
argument array is [`String`, `String[]`], where argument[0] is of type `String`
and gets processed (turned into a random string) in the previous if case, and
only argument[1] gets to this if case. As I think there is still a chance that
whatever string was generated for argument[0] to be duplicated in the arrays of
string generate for `String[]`, so the simplest way to avoid that is to just
append argument[0] to all the string inside of argument[1].
--
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]