GitHub user FlorianHockmann opened a pull request:
https://github.com/apache/tinkerpop/pull/953
TINKERPOP-1972 Fix inject step in Gremlin.Net
https://issues.apache.org/jira/browse/TINKERPOP-1972
We had two issues with the `inject` step in Gremlin.Net. The first one
prevented the Gherkin test runner from executing scenarios that included an
`inject` step. This was fixed by @jorgebay with the first commit in this PR.
Thanks for that, Jorge!
The second issue was that the arguments passed to the `inject` step were
always wrapped in an array which was caused by the fact that the `inject` step
takes a `params` array with a generic member type. We created a `List<S>` for
these arguments and provided that to the method `ByteCode.AddStep()` which
expects a `params object[]` argument. Since the compiler can't convert
`List<S>` into `object[]`, it simply treated the `List<S>` as the first
argument which resulted in an `object[]` with just one element, namely the
`List<S>`.
Simply using a `List<object>` for the arguments and then converting each
argument to `object` fixes the problem.
This could also have affected other steps, but `inject` was the only one
with such a generic `params` array which is probably why we didn't notice the
problem before.
All .NET tests, including the GLV scenarios, are now passing again ð
VOTE +1
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/apache/tinkerpop TINKERPOP-1972
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/tinkerpop/pull/953.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #953
----
commit 2a2e47ebdb5342c30ebee2e9a0cca138e07fc58c
Author: Jorge Bay Gondra <jorgebaygondra@...>
Date: 2018-09-12T09:17:54Z
TINKERPOP-1972 Fix test harness, extract child type in generic params array
commit dee155e50eab747afa1d302ed0c027c8c3629e2b
Author: Florian Hockmann <fh@...>
Date: 2018-10-05T15:32:09Z
TINKERPOP-1972 Fix arg handling for inject step
To be precise, this affects all steps that have a params array with a
generic type parameter as the member type but currently inject is the
only step in Gremlin.Net that has such an array as an argument.
The arguments passed as such a params array were incorrectly wrapped in
one array before instead of individual arguments.
----
---