Cole-Greer commented on code in PR #3209:
URL: https://github.com/apache/tinkerpop/pull/3209#discussion_r2373568173
##########
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AddPropertyStepPlaceholder.java:
##########
@@ -66,11 +69,19 @@ public AddPropertyStepPlaceholder(final Traversal.Admin
traversal, final VertexP
throw new IllegalArgumentException("GValue is not allowed for
property keys");
}
this.key = keyObject;
- this.value = GValue.of(valueObject);
- this.cardinality = cardinality;
+ if (this.key instanceof Traversal) {
+ this.integrateChild(((Traversal<?, ?>) this.key).asAdmin());
+ }
if (valueObject instanceof GValue) {
traversal.getGValueManager().register((GValue<?>) valueObject);
+ this.value = new GValueConstantTraversal<>((GValue<?>)
valueObject);
+ } else if (valueObject instanceof Traversal) {
+ this.value = ((Traversal<?, ?>) valueObject).asAdmin();
+ this.integrateChild(((Traversal<?, ?>) valueObject).asAdmin());
+ } else {
+ this.value = new ConstantTraversal<>(valueObject);
Review Comment:
That's an interesting point. integrating a `ConstantTraversal` as a child
won't really do much, as a ConstantTraversal does not make use of GValues, and
unless a `bypassTraversal` is set, it can't really have a parent or side
effects either.
For the sake of consistency though, it would make sense to also integrate
the ConstantTraversal here. I will make the change.
--
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]