You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by fm...@apache.org on 2013/02/16 11:52:38 UTC

svn commit: r1446871 - /chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/JSONConverter.java

Author: fmui
Date: Sat Feb 16 10:52:38 2013
New Revision: 1446871

URL: http://svn.apache.org/r1446871
Log:
CMIS-630: ignore null extensions

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/JSONConverter.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/JSONConverter.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/JSONConverter.java?rev=1446871&r1=1446870&r2=1446871&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/JSONConverter.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/JSONConverter.java Sat Feb 16 10:52:38 2013
@@ -254,7 +254,8 @@ public final class JSONConverter {
 
         JSONObject result = new JSONObject();
 
-        result.put(JSON_CAP_CONTENT_STREAM_UPDATABILITY, getJSONEnumValue((capabilities.getContentStreamUpdatesCapability())));
+        result.put(JSON_CAP_CONTENT_STREAM_UPDATABILITY,
+                getJSONEnumValue((capabilities.getContentStreamUpdatesCapability())));
         result.put(JSON_CAP_CHANGES, getJSONEnumValue(capabilities.getChangesCapability()));
         result.put(JSON_CAP_RENDITIONS, getJSONEnumValue(capabilities.getRenditionsCapability()));
         result.put(JSON_CAP_GET_DESCENDANTS, capabilities.isGetDescendantsSupported());
@@ -2583,6 +2584,10 @@ public final class JSONConverter {
         }
 
         for (CmisExtensionElement ext : source.getExtensions()) {
+            if (ext == null) {
+                continue;
+            }
+
             if (ext.getChildren() != null && !ext.getChildren().isEmpty()) {
                 target.put(ext.getName(), convertExtensionList(ext.getChildren()));
             } else {
@@ -2599,6 +2604,10 @@ public final class JSONConverter {
         JSONObject result = new JSONObject();
 
         for (CmisExtensionElement ext : extensionList) {
+            if (ext == null) {
+                continue;
+            }
+
             if (ext.getChildren() != null && !ext.getChildren().isEmpty()) {
                 result.put(ext.getName(), convertExtensionList(ext.getChildren()));
             } else {