polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paulmer...@apache.org
Subject [41/52] [abbrv] polygene-java git commit: Fix value type lookup in JSON entity store helpers
Date Sun, 02 Apr 2017 17:48:23 GMT
Fix value type lookup in JSON entity store helpers

POLYGENE-105


Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/8895965d
Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/8895965d
Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/8895965d

Branch: refs/heads/develop
Commit: 8895965d67d05a897d8b26d5214447056e111e74
Parents: a34432d
Author: Paul Merlin <paulmerlin@apache.org>
Authored: Sun Mar 26 17:02:31 2017 +0200
Committer: Paul Merlin <paulmerlin@apache.org>
Committed: Sun Apr 2 19:16:24 2017 +0200

----------------------------------------------------------------------
 .../apache/polygene/spi/entitystore/helpers/JSONEntityState.java | 4 +++-
 .../spi/entitystore/helpers/JSONMapEntityStoreMixin.java         | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8895965d/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/JSONEntityState.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/JSONEntityState.java
b/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/JSONEntityState.java
index e4b5c05..151f144 100644
--- a/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/JSONEntityState.java
+++ b/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/JSONEntityState.java
@@ -120,6 +120,7 @@ public final class JSONEntityState
                 // TODO This rely on _type explicitely :(
                 // Needed because of this mess that is JsonEntityState
                 ValueType propertyValueType = null;
+                ModuleDescriptor propertyModule = module;
                 if( json.getValueType() == JsonValue.ValueType.OBJECT )
                 {
                     String typeInfo = ( (JsonObject) json ).getString( "_type", null );
@@ -129,6 +130,7 @@ public final class JSONEntityState
                         if( valueDescriptor != null )
                         {
                             propertyValueType = valueDescriptor.valueType();
+                            propertyModule = valueDescriptor.module();
                         }
                     }
                 }
@@ -145,7 +147,7 @@ public final class JSONEntityState
                 {
                     return null;
                 }
-                return serialization.fromJson( module, propertyValueType, json );
+                return serialization.fromJson( propertyModule, propertyValueType, json );
             }
         }
         catch( SerializationException e )

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8895965d/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/JSONMapEntityStoreMixin.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/JSONMapEntityStoreMixin.java
b/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/JSONMapEntityStoreMixin.java
index a7f7690..2a0ddc3 100644
--- a/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/JSONMapEntityStoreMixin.java
+++ b/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/JSONMapEntityStoreMixin.java
@@ -453,7 +453,7 @@ public class JSONMapEntityStoreMixin
                 throw new NoSuchEntityTypeException( type, module.name(), module.typeLookup()
);
             }
 
-            return new JSONEntityState( module, serialization,
+            return new JSONEntityState( entityDescriptor.module(), serialization,
                                         version, modified,
                                         EntityReference.create( identity ),
                                         status, entityDescriptor,
@@ -502,7 +502,7 @@ public class JSONMapEntityStoreMixin
                 EntityDescriptor entityDescriptor = module.entityDescriptor( type );
                 String version = data.getString( JSONKeys.VERSION );
                 Instant lastModified = Instant.ofEpochMilli( data.getJsonNumber( JSONKeys.MODIFIED
).longValueExact() );
-                return new JSONEntityState( module, serialization,
+                return new JSONEntityState( entityDescriptor.module(), serialization,
                                             version, lastModified,
                                             reference,
                                             EntityStatus.LOADED, entityDescriptor,


Mime
View raw message