You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by dk...@apache.org on 2015/04/30 19:02:52 UTC

[1/2] incubator-tinkerpop git commit: relaxed equality and inequality checks for numbers

Repository: incubator-tinkerpop
Updated Branches:
  refs/heads/master 2e4e2eda8 -> 250b27dc5


relaxed equality and inequality checks for numbers


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

Branch: refs/heads/master
Commit: 1a8f0ac56121e787e800c35bc47f217998aa2bd7
Parents: c41b199
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Thu Apr 30 19:00:56 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Thu Apr 30 19:00:56 2015 +0200

----------------------------------------------------------------------
 .../apache/tinkerpop/gremlin/structure/Compare.java   |  8 ++++----
 .../process/traversal/step/filter/GroovyIsTest.groovy | 14 ++++++++------
 .../gremlin/process/traversal/step/filter/IsTest.java |  7 +++----
 3 files changed, 15 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1a8f0ac5/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Compare.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Compare.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Compare.java
index bddf109..8184381 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Compare.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Compare.java
@@ -33,7 +33,9 @@ public enum Compare implements BiPredicate<Object, Object> {
         public boolean test(final Object first, final Object second) {
             if (null == first)
                 return second == null;
-            return first.equals(second);
+            return first instanceof Number && second instanceof Number && !first.getClass().equals(second.getClass())
+                    ? ((Number) first).doubleValue() == ((Number) second).doubleValue()
+                    : first.equals(second);
         }
 
         @Override
@@ -43,9 +45,7 @@ public enum Compare implements BiPredicate<Object, Object> {
     }, neq {
         @Override
         public boolean test(final Object first, final Object second) {
-            if (null == first)
-                return second != null;
-            return !first.equals(second);
+            return !eq.test(first, second);
         }
 
         @Override

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1a8f0ac5/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyIsTest.groovy
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyIsTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyIsTest.groovy
index d1b2051..f407664 100644
--- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyIsTest.groovy
+++ b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyIsTest.groovy
@@ -18,13 +18,15 @@
  */
 package org.apache.tinkerpop.gremlin.process.traversal.step.filter
 
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal
+import org.apache.tinkerpop.gremlin.process.UseEngine
 import org.apache.tinkerpop.gremlin.process.computer.ComputerTestHelper
+import org.apache.tinkerpop.gremlin.process.traversal.Traversal
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine
-import org.apache.tinkerpop.gremlin.process.UseEngine
-import static org.apache.tinkerpop.gremlin.structure.P.*;
-import org.apache.tinkerpop.gremlin.structure.Vertex
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__
+import org.apache.tinkerpop.gremlin.structure.Vertex
+
+import static org.apache.tinkerpop.gremlin.structure.P.*
+
 /**
  * @author Daniel Kuppitz (http://gremlin.guru)
  */
@@ -50,7 +52,7 @@ public abstract class GroovyIsTest {
 
         @Override
         public Traversal<Vertex, String> get_g_V_hasXinXcreatedX_count_isX1XX_valuesXnameX() {
-            return g.V().has(__.in('created').count().is(1l)).values('name');
+            return g.V().has(__.in('created').count().is(1)).values('name');
         }
 
         @Override
@@ -79,7 +81,7 @@ public abstract class GroovyIsTest {
 
         @Override
         public Traversal<Vertex, String> get_g_V_hasXinXcreatedX_count_isX1XX_valuesXnameX() {
-            ComputerTestHelper.compute("g.V().has(__.in('created').count().is(1l)).values('name')", g)
+            ComputerTestHelper.compute("g.V().has(__.in('created').count().is(1)).values('name')", g)
         }
 
         @Override

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1a8f0ac5/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/IsTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/IsTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/IsTest.java
index 74add2c..7a616d4 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/IsTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/IsTest.java
@@ -20,10 +20,9 @@ package org.apache.tinkerpop.gremlin.process.traversal.step.filter;
 
 import org.apache.tinkerpop.gremlin.LoadGraphWith;
 import org.apache.tinkerpop.gremlin.process.AbstractGremlinProcessTest;
+import org.apache.tinkerpop.gremlin.process.UseEngine;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
-import org.apache.tinkerpop.gremlin.process.UseEngine;
-import org.apache.tinkerpop.gremlin.structure.Compare;
 import org.apache.tinkerpop.gremlin.structure.P;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.junit.Test;
@@ -31,7 +30,7 @@ import org.junit.Test;
 import java.util.Arrays;
 
 import static org.apache.tinkerpop.gremlin.LoadGraphWith.GraphData.MODERN;
-import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.*;
+import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.in;
 import static org.junit.Assert.*;
 
 /**
@@ -115,7 +114,7 @@ public abstract class IsTest extends AbstractGremlinProcessTest {
 
         @Override
         public Traversal<Vertex, String> get_g_V_hasXinXcreatedX_count_isX1XX_valuesXnameX() {
-            return g.V().has(in("created").count().is(1l)).values("name");
+            return g.V().has(in("created").count().is(1)).values("name");
         }
 
         @Override


[2/2] incubator-tinkerpop git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-tinkerpop

Posted by dk...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-tinkerpop


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

Branch: refs/heads/master
Commit: 250b27dc5fbf13f36d8b8d3e64daa8eec2f0891c
Parents: 1a8f0ac 2e4e2ed
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Thu Apr 30 19:01:10 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Thu Apr 30 19:01:10 2015 +0200

----------------------------------------------------------------------
 README.asciidoc                                 |  2 +-
 .../gremlin/process/traversal/Traverser.java    |  2 +-
 .../strategy/decoration/EventStrategy.java      |  2 +-
 .../tinkerpop/gremlin/structure/Graph.java      | 18 ++---
 .../gremlin/structure/Transaction.java          |  2 +-
 .../gremlin/structure/VertexProperty.java       |  2 +-
 .../gremlin/structure/io/GraphMigrator.java     | 28 ++++----
 .../gremlin/structure/io/GraphReader.java       |  4 +-
 .../gremlin/structure/io/GraphWriter.java       | 10 +--
 .../tinkerpop/gremlin/structure/io/IoCore.java  |  2 +-
 .../structure/io/gryo/GryoClassResolver.java    |  2 +-
 .../gremlin/structure/io/gryo/GryoIo.java       | 19 +++++-
 .../gremlin/structure/io/gryo/GryoMapper.java   | 28 +++++++-
 .../gremlin/structure/io/gryo/GryoReader.java   | 72 +++++++++++++++++++-
 .../structure/io/gryo/GryoSerializers.java      | 11 +--
 .../gremlin/structure/io/gryo/GryoWriter.java   | 31 ++++++++-
 .../structure/util/AbstractTransaction.java     |  2 +-
 .../structure/util/detached/DetachedEdge.java   |  2 +-
 .../structure/util/detached/DetachedVertex.java |  2 +-
 .../groovy/GroovyEnvironmentIntegrateSuite.java |  4 +-
 .../GroovyEnvironmentPerformanceSuite.java      |  4 +-
 .../gremlin/groovy/GroovyEnvironmentSuite.java  |  2 +-
 .../process/GroovyProcessComputerSuite.java     |  2 +-
 .../process/GroovyProcessStandardSuite.java     |  2 +-
 .../gremlin/groovy/engine/GremlinExecutor.java  |  2 +-
 .../groovy/jsr223/DependencyManager.java        |  2 +-
 .../jsr223/GremlinGroovyScriptEngine.java       |  2 +-
 .../gremlin/server/AbstractChannelizer.java     |  2 +-
 .../server/GremlinDriverIntegrateTest.java      |  2 +-
 .../apache/tinkerpop/gremlin/GraphProvider.java | 10 +--
 .../apache/tinkerpop/gremlin/LoadGraphWith.java |  4 +-
 .../gremlin/process/ProcessComputerSuite.java   |  2 +-
 .../process/ProcessPerformanceSuite.java        |  2 +-
 .../gremlin/process/ProcessStandardSuite.java   |  2 +-
 .../structure/StructurePerformanceSuite.java    |  2 +-
 .../structure/StructureStandardSuite.java       |  2 +-
 pom.xml                                         |  4 +-
 .../tinkergraph/structure/TinkerGraph.java      |  6 +-
 .../structure/IoDataGenerationTest.java         |  1 -
 39 files changed, 212 insertions(+), 88 deletions(-)
----------------------------------------------------------------------