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 22:29:09 UTC
[geode] branch develop updated: GEODE-6288: change isDeserializable
to return true on JSON pdx (#3089)
This is an automated email from the ASF dual-hosted git repository.
dschneider pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git
The following commit(s) were added to refs/heads/develop by this push:
new 4ca1c22 GEODE-6288: change isDeserializable to return true on JSON pdx (#3089)
4ca1c22 is described below
commit 4ca1c220dd8bb59db5e66768e78eb49da191dde2
Author: Darrel Schneider <ds...@pivotal.io>
AuthorDate: Thu Jan 17 14:28:36 2019 -0800
GEODE-6288: change isDeserializable to return true on JSON pdx (#3089)
---
.../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();
}
}