tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ok...@apache.org
Subject [39/42] tinkerpop git commit: TranslationStrategy wasn't being sorted correctly. Fixed. All tests except 2 pass -- 1 I know why, the other I don't.
Date Mon, 13 Jun 2016 19:37:57 GMT
TranslationStrategy wasn't being sorted correctly. Fixed. All tests except 2 pass -- 1 I know
why, the other I don't.


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

Branch: refs/heads/TINKERPOP-1278
Commit: 1532e1a13549484ed03ad49e0c5aff03f8936709
Parents: f336410
Author: Marko A. Rodriguez <okrammarko@gmail.com>
Authored: Mon Jun 13 12:13:13 2016 -0600
Committer: Marko A. Rodriguez <okrammarko@gmail.com>
Committed: Mon Jun 13 12:13:13 2016 -0600

----------------------------------------------------------------------
 .../gremlin/process/traversal/TraversalStrategies.java         | 2 +-
 .../gremlin/process/traversal/dsl/graph/GraphTraversal.java    | 6 +++---
 .../traversal/strategy/creation/TranslationStrategy.java       | 5 +++--
 3 files changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1532e1a1/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java
index 8780d4e..8eccc04 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java
@@ -57,7 +57,7 @@ import java.util.stream.Collectors;
  */
 public interface TraversalStrategies extends Serializable, Cloneable {
 
-    static List<Class<? extends TraversalStrategy>> STRATEGY_CATEGORIES = Collections.unmodifiableList(Arrays.asList(TraversalStrategy.DecorationStrategy.class,
TraversalStrategy.OptimizationStrategy.class, TraversalStrategy.ProviderOptimizationStrategy.class,
TraversalStrategy.FinalizationStrategy.class, TraversalStrategy.VerificationStrategy.class));
+    static List<Class<? extends TraversalStrategy>> STRATEGY_CATEGORIES = Collections.unmodifiableList(Arrays.asList(TraversalStrategy.CreationStrategy.class,
TraversalStrategy.DecorationStrategy.class, TraversalStrategy.OptimizationStrategy.class,
TraversalStrategy.ProviderOptimizationStrategy.class, TraversalStrategy.FinalizationStrategy.class,
TraversalStrategy.VerificationStrategy.class));
 
     /**
      * Return all the {@link TraversalStrategy} singleton instances associated with this
{@link TraversalStrategies}.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1532e1a1/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
index 534b1ef..f7cf0a4 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
@@ -809,9 +809,9 @@ public interface GraphTraversal<S, E> extends Traversal<S, E>
{
                 this.from(firstVertexKeyOrEdgeLabel).to((String) propertyKeyValues[0]);
             else
                 this.to(firstVertexKeyOrEdgeLabel).from((String) propertyKeyValues[0]);
-            final Object[] temp = Arrays.copyOfRange(propertyKeyValues, 1, propertyKeyValues.length);
-            for (int i = 0; i < temp.length; i = i + 2) {
-                this.property(temp[i], temp[i + 1]);
+
+            for (int i = 1; i < propertyKeyValues.length; i = i + 2) {
+                this.property(propertyKeyValues[i], propertyKeyValues[i + 1]);
             }
             // ((Mutating) this.asAdmin().getEndStep()).addPropertyMutations(Arrays.copyOfRange(propertyKeyValues,
1, propertyKeyValues.length));
             return (GraphTraversal<S, Edge>) this;

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1532e1a1/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/creation/TranslationStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/creation/TranslationStrategy.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/creation/TranslationStrategy.java
index b712270..3fbec2c 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/creation/TranslationStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/creation/TranslationStrategy.java
@@ -59,7 +59,8 @@ public class TranslationStrategy extends AbstractTraversalStrategy<TraversalStra
             return;
         try {
             final String traversalScriptString = this.translator.getTraversalScript();
-            System.out.println(traversalScriptString + "!!!");
+            System.out.println(traversal.getStrategies().toList() + "!!!");
+            // System.out.println(traversalScriptString + "!!!");
             __.setAnonymousGraphTraversalSupplier(null);
             ScriptEngine engine = ScriptEngineCache.get(this.translator.getScriptEngine());
             TraversalStrategies strategies = traversal.getStrategies().clone().removeStrategies(TranslationStrategy.class);
@@ -68,7 +69,7 @@ public class TranslationStrategy extends AbstractTraversalStrategy<TraversalStra
             Traversal.Admin<?, ?> translatedTraversal = (Traversal.Admin<?, ?>)
engine.eval(traversalScriptString, bindings);
             assert !translatedTraversal.isLocked();
             assert !traversal.isLocked();
-            //traversal.setSideEffects(translatedTraversal.getSideEffects());
+            traversal.setSideEffects(translatedTraversal.getSideEffects());
             traversal.setStrategies(strategies);
             TraversalHelper.removeAllSteps(traversal);
             TraversalHelper.removeToTraversal((Step) translatedTraversal.getStartStep(),
EmptyStep.instance(), traversal);


Mime
View raw message