tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ok...@apache.org
Subject tinkerpop git commit: minor nothings. still in hole. moving to Python work.
Date Tue, 23 Aug 2016 17:34:33 GMT
Repository: tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-1278 e4c750d2a -> 1cdf2d9a3


minor nothings. still in hole. moving to Python work.


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

Branch: refs/heads/TINKERPOP-1278
Commit: 1cdf2d9a3be0f3569b87a4090c725dd17783fddc
Parents: e4c750d
Author: Marko A. Rodriguez <okrammarko@gmail.com>
Authored: Tue Aug 23 11:34:29 2016 -0600
Committer: Marko A. Rodriguez <okrammarko@gmail.com>
Committed: Tue Aug 23 11:34:29 2016 -0600

----------------------------------------------------------------------
 .../structure/io/graphson/GraphSONModule.java   | 22 ++++++++++----------
 .../GraphSONTraversalSerializersV2d0.java       |  8 +++----
 2 files changed, 15 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1cdf2d9a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java
index c40af5c..0265cd2 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java
@@ -129,7 +129,7 @@ abstract class GraphSONModule extends TinkerPopJacksonModule {
                     VertexProperty.Cardinality.values(),
                     Column.values(),
                     Direction.values(),
-                    // Operator.values(),
+                    //Operator.values(),
                     Order.values(),
                     Pop.values(),
                     SackFunctions.Barrier.values(),
@@ -183,15 +183,15 @@ abstract class GraphSONModule extends TinkerPopJacksonModule {
             // TODO: review (added for integration with new GraphSON model for GLV bytecode)
             addSerializer(Traversal.class, new GraphSONTraversalSerializersV2d0.TraversalJacksonSerializer());
             addSerializer(Bytecode.class, new GraphSONTraversalSerializersV2d0.BytecodeJacksonSerializer());
-            Stream.of(VertexProperty.Cardinality.values(),
-                    Column.values(),
-                    //Operator.values(),
-                    Direction.values(),
-                    Order.values(),
-                    Pop.values(),
-                    SackFunctions.Barrier.values(),
-                    Scope.values(),
-                    T.values()).flatMap(Stream::of).forEach(e -> addSerializer(e.getClass(),
new GraphSONTraversalSerializersV2d0.EnumJacksonSerializer()));
+            Stream.of(VertexProperty.Cardinality.class,
+                    Column.class,
+                    Direction.class,
+                    Operator.class,
+                    Order.class,
+                    Pop.class,
+                    SackFunctions.Barrier.class,
+                    Scope.class,
+                    T.class).forEach(e -> addSerializer(e, new GraphSONTraversalSerializersV2d0.EnumJacksonSerializer()));
             addSerializer(P.class, new GraphSONTraversalSerializersV2d0.PJacksonSerializer());
             addSerializer(Lambda.class, new GraphSONTraversalSerializersV2d0.LambdaJacksonSerializer());
             addSerializer(Bytecode.Binding.class, new GraphSONTraversalSerializersV2d0.BindingJacksonSerializer());
@@ -230,7 +230,7 @@ abstract class GraphSONModule extends TinkerPopJacksonModule {
             Stream.of(VertexProperty.Cardinality.values(),
                     Column.values(),
                     Direction.values(),
-                    //Operator.values(),
+                    Operator.values(),
                     Order.values(),
                     Pop.values(),
                     SackFunctions.Barrier.values(),

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1cdf2d9a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTraversalSerializersV2d0.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTraversalSerializersV2d0.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTraversalSerializersV2d0.java
index 0741b05..89f4662 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTraversalSerializersV2d0.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTraversalSerializersV2d0.java
@@ -241,14 +241,16 @@ final class GraphSONTraversalSerializersV2d0 {
 
     final static class EnumJacksonDeserializer<A extends Enum> extends StdDeserializer<A>
{
 
+        private final A enumInstance;
 
         public EnumJacksonDeserializer(final A enumInstance) {
-            super(enumInstance.getDeclaringClass());
+            super(enumInstance.getClass());
+            this.enumInstance = enumInstance;
         }
 
         @Override
         public A deserialize(final JsonParser jsonParser, final DeserializationContext deserializationContext)
throws IOException, JsonProcessingException {
-            final Class<A> enumClass = (Class<A>) this._valueClass;
+            final Class<A> enumClass = (Class<A>) this.enumInstance.getDeclaringClass();
             final String enumName = jsonParser.getText();
             for (final Enum a : enumClass.getEnumConstants()) {
                 if (a.name().equals(enumName))
@@ -256,8 +258,6 @@ final class GraphSONTraversalSerializersV2d0 {
             }
             throw new IOException("Unknown enum type: " + enumClass);
         }
-
-
     }
 
     final static class PJacksonDeserializer extends AbstractObjectDeserializer<P> {


Mime
View raw message