You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by ds...@apache.org on 2019/01/17 19:11:04 UTC

[geode] branch feature/GEODE-6288 updated: GEODE-6288: change isDeserializable to return true on JSON pdx

This is an automated email from the ASF dual-hosted git repository.

dschneider pushed a commit to branch feature/GEODE-6288
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/feature/GEODE-6288 by this push:
     new b79e275  GEODE-6288: change isDeserializable to return true on JSON pdx
b79e275 is described below

commit b79e275c8f6fb9d61e76bd67e53137d215f3ba79
Author: Darrel Schneider <ds...@pivotal.io>
AuthorDate: Thu Jan 17 11:10:03 2019 -0800

    GEODE-6288: change isDeserializable to return true on JSON pdx
---
 .../java/org/apache/geode/pdx/PdxInstanceFactoryJUnitTest.java    | 8 ++++++++
 .../main/java/org/apache/geode/pdx/internal/PdxInstanceImpl.java  | 5 ++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/geode-core/src/integrationTest/java/org/apache/geode/pdx/PdxInstanceFactoryJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/pdx/PdxInstanceFactoryJUnitTest.java
index 3138854..dc97aa9 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/pdx/PdxInstanceFactoryJUnitTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/pdx/PdxInstanceFactoryJUnitTest.java
@@ -1355,4 +1355,12 @@ public class PdxInstanceFactoryJUnitTest {
 
     assertThat(instance.isDeserializable()).isTrue();
   }
+
+  @Test
+  public void jsonPdxInstanceIsDeserializableReturnsTrue() {
+    PdxInstance jsonPdxInstance =
+        cache.createPdxInstanceFactory(JSONFormatter.JSON_CLASSNAME, false).create();
+
+    assertThat(jsonPdxInstance.isDeserializable()).isTrue();
+  }
 }
diff --git a/geode-core/src/main/java/org/apache/geode/pdx/internal/PdxInstanceImpl.java b/geode-core/src/main/java/org/apache/geode/pdx/internal/PdxInstanceImpl.java
index dfb9b6b..f18c53c 100644
--- a/geode-core/src/main/java/org/apache/geode/pdx/internal/PdxInstanceImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/pdx/internal/PdxInstanceImpl.java
@@ -214,7 +214,7 @@ public class PdxInstanceImpl extends PdxReaderImpl implements InternalPdxInstanc
       // In case of Developer Rest APIs, All PdxInstances converted from Json will have a className
       // =__GEMFIRE_JSON.
       // Following code added to convert Json/PdxInstance into the Java object.
-      if (this.getClassName().equals("__GEMFIRE_JSON")) {
+      if (this.getClassName().equals(JSONFormatter.JSON_CLASSNAME)) {
 
         // introspect the JSON, does the @type meta-data exist.
         String className = extractTypeMetaData();
@@ -658,6 +658,9 @@ public class PdxInstanceImpl extends PdxReaderImpl implements InternalPdxInstanc
 
   @Override
   public boolean isDeserializable() {
+    if (this.getClassName().equals(JSONFormatter.JSON_CLASSNAME)) {
+      return true;
+    }
     return !getPdxType().getNoDomainClass();
   }
 }