todmorrison commented on a change in pull request #6629:
URL: https://github.com/apache/geode/pull/6629#discussion_r657309152



##########
File path: 
geode-core/src/main/java/org/apache/geode/pdx/internal/json/PdxToJSON.java
##########
@@ -135,17 +135,16 @@ private void writeValue(JsonGenerator jg, Object value, 
String pf)
       jg.writeString(value.toString());
     } else if (value.getClass().equals(PdxInstanceEnumInfo.class)) {
       jg.writeString(value.toString());
+    } else if (value instanceof PdxInstance) {
+      getJSONString(jg, (PdxInstance) value);
+    } else if (value instanceof Collection) {
+      getJSONStringFromCollection(jg, (Collection<?>) value, pf);
+    } else if (value instanceof Map) {
+      getJSONStringFromMap(jg, (Map) value, pf);
     } else {
-      if (value instanceof PdxInstance) {
-        getJSONString(jg, (PdxInstance) value);
-      } else if (value instanceof Collection) {
-        getJSONStringFromCollection(jg, (Collection<?>) value, pf);
-      } else if (value instanceof Map) {
-        getJSONStringFromMap(jg, (Map) value, pf);
-      } else {
-        throw new IllegalStateException(
-            "PdxInstance returns unknwon pdxfield " + pf + " for type " + 
value);
-      }
+      throw new IllegalStateException(
+          "PdxInstance returns unsupported type " + value.getClass()

Review comment:
       Agreed, though I went with a single sentence:
   ```
             "The pdx field " + pf + " has a value " + value + " whose type " + 
value.getClass()
                 + " can not be converted to JSON.");
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to