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 2017/04/07 13:40:10 UTC

[1/4] tinkerpop git commit: TINKERPOP-1664 Fixed a bug in StarVertexProperty where properties are now validated. Key value arrays now check for null values.

Repository: tinkerpop
Updated Branches:
  refs/heads/tp32 95d3efc03 -> 664cd5a64


TINKERPOP-1664  Fixed a bug in StarVertexProperty where properties are now validated.
Key value arrays now check for null values.


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/4713be48
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/4713be48
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/4713be48

Branch: refs/heads/tp32
Commit: 4713be48a415bb6a253231298a8bc1c324207eb3
Parents: 11903a2
Author: BrynCooke <br...@gmail.com>
Authored: Thu Apr 6 09:45:18 2017 +0100
Committer: BrynCooke <br...@gmail.com>
Committed: Thu Apr 6 09:45:18 2017 +0100

----------------------------------------------------------------------
 CHANGELOG.asciidoc                                          | 4 ++++
 .../tinkerpop/gremlin/structure/util/ElementHelper.java     | 4 ++++
 .../tinkerpop/gremlin/structure/util/star/StarGraph.java    | 1 +
 .../tinkerpop/gremlin/structure/util/ElementHelperTest.java | 9 +++++++++
 4 files changed, 18 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4713be48/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 3ac081b..54ab8dd 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -30,6 +30,10 @@ TinkerPop 3.1.7 (Release Date: NOT OFFICIALLY RELEASED YET)
 * Fixed `EventStrategy` so that newly added properties trigger events with the name of the key that was added.
 * Drop use of jitpack for the jbcrypt artifact - using the official one in Maven Central.
 
+Bugs
+^^^^
+* TINKERPOP-1664 StarVertexProperty properties were not validated.
+
 [[release-3-1-6]]
 TinkerPop 3.1.6 (Release Date: February 3, 2017)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4713be48/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java
index d42bdee..d0d6aab 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java
@@ -116,6 +116,10 @@ public final class ElementHelper {
         for (int i = 0; i < propertyKeyValues.length; i = i + 2) {
             if (!(propertyKeyValues[i] instanceof String) && !(propertyKeyValues[i] instanceof T))
                 throw Element.Exceptions.providedKeyValuesMustHaveALegalKeyOnEvenIndices();
+
+            if (propertyKeyValues[i + 1] == null) {
+                throw Property.Exceptions.propertyValueCanNotBeNull();
+            }
         }
     }
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4713be48/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraph.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraph.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraph.java
index 2089c42..d9dc329 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraph.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraph.java
@@ -480,6 +480,7 @@ public final class StarGraph implements Graph, Serializable {
 
         @Override
         public <U> Property<U> property(final String key, final U value) {
+            ElementHelper.validateProperty(key, value);
             if (null == metaProperties)
                 metaProperties = new HashMap<>();
             Map<String, Object> properties = metaProperties.get(this.id);

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4713be48/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelperTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelperTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelperTest.java
index e8ec27c..f4c8082 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelperTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelperTest.java
@@ -119,6 +119,15 @@ public class ElementHelperTest {
     }
 
     @Test
+    public void shouldNotAllowEvenNumberOfKeyValuesAndInvalidValues() {
+        try {
+            ElementHelper.legalPropertyKeyValueArray("aKey", "test", "value-for-this-one", 1, "1", null);
+        } catch (IllegalArgumentException iae) {
+            assertEquals(Property.Exceptions.propertyValueCanNotBeNull().getMessage(), iae.getMessage());
+        }
+    }
+
+    @Test
     public void shouldFindTheIdValueAlone() {
         assertEquals(123l, ElementHelper.getIdValue(T.id, 123l).get());
     }


[2/4] tinkerpop git commit: Fixed changelog entry CTR

Posted by sp...@apache.org.
Fixed changelog entry CTR


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/df9de56e
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/df9de56e
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/df9de56e

Branch: refs/heads/tp32
Commit: df9de56e4749fd74b4fd18b4542ac28026c71d4b
Parents: 4713be4
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Apr 7 09:02:18 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Apr 7 09:02:18 2017 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/df9de56e/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 54ab8dd..effdc07 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,14 +26,11 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 TinkerPop 3.1.7 (Release Date: NOT OFFICIALLY RELEASED YET)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
+* Added validation to `StarVertexProperty`.
 * Bumped to Jackson 2.8.7.
 * Fixed `EventStrategy` so that newly added properties trigger events with the name of the key that was added.
 * Drop use of jitpack for the jbcrypt artifact - using the official one in Maven Central.
 
-Bugs
-^^^^
-* TINKERPOP-1664 StarVertexProperty properties were not validated.
-
 [[release-3-1-6]]
 TinkerPop 3.1.6 (Release Date: February 3, 2017)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


[3/4] tinkerpop git commit: Reversed logic of if to place null first CTR

Posted by sp...@apache.org.
Reversed logic of if to place null first CTR


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/7c99635e
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/7c99635e
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/7c99635e

Branch: refs/heads/tp32
Commit: 7c99635e4909b6904e89020b02a9193d5b7ea0d9
Parents: df9de56
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Apr 7 09:03:02 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Apr 7 09:03:02 2017 -0400

----------------------------------------------------------------------
 .../org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/7c99635e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java
index d0d6aab..445b9e5 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java
@@ -117,7 +117,7 @@ public final class ElementHelper {
             if (!(propertyKeyValues[i] instanceof String) && !(propertyKeyValues[i] instanceof T))
                 throw Element.Exceptions.providedKeyValuesMustHaveALegalKeyOnEvenIndices();
 
-            if (propertyKeyValues[i + 1] == null) {
+            if (null == propertyKeyValues[i + 1]) {
                 throw Property.Exceptions.propertyValueCanNotBeNull();
             }
         }


[4/4] tinkerpop git commit: Merge branch 'tp31' into tp32

Posted by sp...@apache.org.
Merge branch 'tp31' into tp32


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/664cd5a6
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/664cd5a6
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/664cd5a6

Branch: refs/heads/tp32
Commit: 664cd5a6472c0018f474ed524fa0d525b7c77b4d
Parents: 95d3efc 7c99635
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Apr 7 09:03:40 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Apr 7 09:03:40 2017 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                                          | 1 +
 .../tinkerpop/gremlin/structure/util/ElementHelper.java     | 4 ++++
 .../tinkerpop/gremlin/structure/util/star/StarGraph.java    | 1 +
 .../tinkerpop/gremlin/structure/util/ElementHelperTest.java | 9 +++++++++
 4 files changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/664cd5a6/CHANGELOG.asciidoc
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/664cd5a6/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/664cd5a6/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraph.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/664cd5a6/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelperTest.java
----------------------------------------------------------------------