You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by ke...@apache.org on 2023/04/21 02:43:13 UTC
[tinkerpop] branch 3.6-dev updated: Add PropertyMapStep getters and a constructor with TraversalRing (#2029)
This is an automated email from the ASF dual-hosted git repository.
kenhuuu pushed a commit to branch 3.6-dev
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
The following commit(s) were added to refs/heads/3.6-dev by this push:
new 33f74a5db0 Add PropertyMapStep getters and a constructor with TraversalRing (#2029)
33f74a5db0 is described below
commit 33f74a5db09024dd4868d3cb42b1500d65e04210
Author: Oleksandr Porunov <al...@gmail.com>
AuthorDate: Fri Apr 21 03:43:07 2023 +0100
Add PropertyMapStep getters and a constructor with TraversalRing (#2029)
* Add PropertyMapStep getters and a constructor with TraversalRing
Related issue: https://issues.apache.org/jira/browse/TINKERPOP-2927
Signed-off-by: Oleksandr Porunov <al...@gmail.com>
---------
Signed-off-by: Oleksandr Porunov <al...@gmail.com>
---
CHANGELOG.asciidoc | 2 +-
.../process/traversal/step/map/PropertyMapStep.java | 17 ++++++++++++++---
2 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 7d9ea1c4c2..69e2705b29 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -25,7 +25,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
This release also includes changes from <<release-3-5-6, 3.5.6>>.
-* Refactored `PropertyMapStep` to improve extensibility by providers.
+* Refactored `PropertyMapStep` to improve extensibility by providers. Removed `final` class declaration for `ProjectStep` and `CoalesceStep`.
* Fixed bug in grammar that prevented declaration of a `Map` key named `new` without quotes.
* Fixed bug in grammar that prevented parsing of `Map` key surrounded by parenthesis which is allowable in Groovy.
* Fixed bug in `GroovyTranslator` that surrounded `String` keys with parenthesis for `Map` when not necessary.
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PropertyMapStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PropertyMapStep.java
index eef44940dd..f089636572 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PropertyMapStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PropertyMapStep.java
@@ -40,7 +40,6 @@ import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
-import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
@@ -64,12 +63,16 @@ public class PropertyMapStep<K,E> extends ScalarMapStep<Element, Map<K, E>>
protected Parameters parameters = new Parameters();
protected TraversalRing<K, E> traversalRing;
- public PropertyMapStep(final Traversal.Admin traversal, final PropertyType propertyType, final String... propertyKeys) {
+ public PropertyMapStep(final Traversal.Admin traversal, final PropertyType propertyType, TraversalRing<K, E> traversalRing, final String... propertyKeys) {
super(traversal);
this.propertyKeys = propertyKeys;
this.returnType = propertyType;
this.propertyTraversal = null;
- this.traversalRing = new TraversalRing<>();
+ this.traversalRing = traversalRing;
+ }
+
+ public PropertyMapStep(final Traversal.Admin traversal, final PropertyType propertyType, final String... propertyKeys) {
+ this(traversal, propertyType, new TraversalRing<>(), propertyKeys);
}
public PropertyMapStep(final Traversal.Admin traversal, final int options, final PropertyType propertyType, final String... propertyKeys) {
@@ -248,4 +251,12 @@ public class PropertyMapStep<K,E> extends ScalarMapStep<Element, Map<K, E>>
this.traversalRing.reset();
}
}
+
+ public Traversal.Admin<Element, ? extends Property> getPropertyTraversal() {
+ return propertyTraversal;
+ }
+
+ public TraversalRing<K, E> getTraversalRing() {
+ return traversalRing;
+ }
}