[
https://issues.apache.org/jira/browse/TINKERPOP-1521?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15812201#comment-15812201
]
ASF GitHub Bot commented on TINKERPOP-1521:
-------------------------------------------
GitHub user okram opened a pull request:
https://github.com/apache/tinkerpop/pull/527
TINKERPOP-1521: Mutating steps don't recognize side-effects
https://issues.apache.org/jira/browse/TINKERPOP-1521
`AddVertexStartStep` was using an `EmptyTraverser` to compute the
`Parameters`. I thus, create a dummy traverser that has respective traversal
side-effects. Added two new test cases to `AddVertexTest`.
```groovy
gremlin> g = TinkerGraph.open().traversal()
==>graphtraversalsource[tinkergraph[vertices:0 edges:0], standard]
gremlin> g.withSideEffect("a", "marko").addV().property("name", select("a"))
==>v[0]
gremlin> g.V().valueMap()
==>[name:[marko]]
gremlin>
```
Finally, realized that `PathRetractionStrategy` was adding a
`NoOpBarrierStep` to the end of local traversal. This is pointless computation
as 99% of local traversals are `by()`-modulators that only need the first
`next()`.
VOTE +1.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/apache/tinkerpop TINKERPOP-1521
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/tinkerpop/pull/527.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 #527
----
commit 276064530617c04706b62ac57ec4e2e660a756a4
Author: Marko A. Rodriguez <[email protected]>
Date: 2017-01-09T16:36:15Z
fixed an NPE in AddVertexStartStep. In PathRetractionStrategy, NoOpBarriers
are only added to global children as 99% of local children are by()-modulation
based and thus, there is no point to fully compute the traversal if only the
first next() is going to be used.
----
> Mutating steps don't recognize side-effects
> -------------------------------------------
>
> Key: TINKERPOP-1521
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1521
> Project: TinkerPop
> Issue Type: Bug
> Components: process
> Affects Versions: 3.2.3
> Reporter: Daniel Kuppitz
>
> {code}
> gremlin> g.withSideEffect("a", "marko").addV().property("name", select("a"))
> java.lang.NullPointerException
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)