You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2019/11/06 17:25:27 UTC

[tinkerpop] branch TINKERPOP-2235 updated (0880743 -> 4ea38a4)

This is an automated email from the ASF dual-hosted git repository.

spmallette pushed a change to branch TINKERPOP-2235
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git.


    from 0880743  TINKERPOP-2235 Added upgrade and reference docs
     new 5042c2b  TINKERPOP-2235 Cleanup comments/javadoc a bit for MapStep
     new af7d7e9  TINKERPOP-2235 Expand imports to match code style
     new 4ea38a4  TINKERPOP-2235 Improved upgrade docs for null handling

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 docs/src/upgrade/release-3.5.x.asciidoc                      |  5 +++++
 .../gremlin/process/traversal/step/map/MapStep.java          | 12 ++++++------
 .../tinkerpop/gremlin/util/iterator/ArrayIteratorTest.java   |  4 +++-
 3 files changed, 14 insertions(+), 7 deletions(-)


[tinkerpop] 01/03: TINKERPOP-2235 Cleanup comments/javadoc a bit for MapStep

Posted by sp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

spmallette pushed a commit to branch TINKERPOP-2235
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git

commit 5042c2b6a3c6dbe012dc0cbc87e9d0e5c104af4f
Author: stephen <sp...@gmail.com>
AuthorDate: Wed Nov 6 11:46:45 2019 -0500

    TINKERPOP-2235 Cleanup comments/javadoc a bit for MapStep
---
 .../gremlin/process/traversal/step/map/MapStep.java          | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MapStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MapStep.java
index 2747b9c..51535e7 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MapStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MapStep.java
@@ -25,6 +25,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.traverser.util.EmptyTraver
 
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
+ * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public abstract class MapStep<S, E> extends AbstractStep<S, E> {
 
@@ -36,10 +37,6 @@ public abstract class MapStep<S, E> extends AbstractStep<S, E> {
     protected Traverser.Admin<E> processNextStart() {
         final Traverser.Admin<S> traverser = this.starts.next();
         final E obj = this.map(traverser);
-
-        // maybe looks tricky, but it's just a play on Java generics without having to tear apart every MapStep
-        // instance. basically just want to respect the fact that a subclass can return an EmptyTraverser from
-        // map() and if so, just return that empty.
         return isEmptyTraverser(obj) ? EmptyTraverser.instance() : traverser.split(obj, this);
     }
 
@@ -47,9 +44,12 @@ public abstract class MapStep<S, E> extends AbstractStep<S, E> {
 
     /**
      * Determines if the value returned from {@link #map(Traverser.Admin)} should be representative of an
-     * {@link EmptyTraverser}. Such traversers will effectively be filtered out by the traversal.
+     * {@link EmptyTraverser}. Such traversers will effectively be filtered out by the traversal. This method works in
+     * conjunction with {@link #map(Traverser.Admin)} in the sense that both work are called in the default
+     * implementation of {@link #processNextStart()} which will call this method after "map()"-ing the traverser to
+     * determine if that step consider the returned value as "empty".
      */
-    protected boolean isEmptyTraverser(E obj) {
+    protected boolean isEmptyTraverser(final E obj) {
         return false;
     }
 


[tinkerpop] 02/03: TINKERPOP-2235 Expand imports to match code style

Posted by sp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

spmallette pushed a commit to branch TINKERPOP-2235
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git

commit af7d7e90e4a1ef0ff6e19e4e2f2c355b8f8df77f
Author: stephen <sp...@gmail.com>
AuthorDate: Wed Nov 6 11:49:01 2019 -0500

    TINKERPOP-2235 Expand imports to match code style
---
 .../org/apache/tinkerpop/gremlin/util/iterator/ArrayIteratorTest.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/util/iterator/ArrayIteratorTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/util/iterator/ArrayIteratorTest.java
index 32f7401..2293277 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/util/iterator/ArrayIteratorTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/util/iterator/ArrayIteratorTest.java
@@ -23,7 +23,9 @@ import org.junit.Test;
 
 import java.util.Iterator;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
 
 /**
  * @author Stephen Mallette (http://stephen.genoprime.com)


[tinkerpop] 03/03: TINKERPOP-2235 Improved upgrade docs for null handling

Posted by sp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

spmallette pushed a commit to branch TINKERPOP-2235
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git

commit 4ea38a4939818c65ad840513283bfa158c36b239
Author: stephen <sp...@gmail.com>
AuthorDate: Wed Nov 6 12:24:57 2019 -0500

    TINKERPOP-2235 Improved upgrade docs for null handling
---
 docs/src/upgrade/release-3.5.x.asciidoc | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/docs/src/upgrade/release-3.5.x.asciidoc b/docs/src/upgrade/release-3.5.x.asciidoc
index 9e75caa..1a9df8e 100644
--- a/docs/src/upgrade/release-3.5.x.asciidoc
+++ b/docs/src/upgrade/release-3.5.x.asciidoc
@@ -166,6 +166,11 @@ gremlin> g.addV().property("x", 1).property("y", null).property("z", 2)
 ==>v[15]
 ----
 
+In conclusion, this change in greater support of `null` may affect the behavior of existing traversals written in past
+versions of TinkerPop as it is no longer possible to rely on `null` to expect a filtering action for traversers.
+Please review existing Gremlin carefully to ensure that there are no unintended consequences of this change and that
+there are no opportunities to improve existing logic to take greater advantage of this expansion of `null` semantics.
+
 See: link:https://issues.apache.org/jira/browse/TINKERPOP-2235[TINKERPOP-2235],
 link:https://issues.apache.org/jira/browse/TINKERPOP-2099[TINKERPOP-2099]