incubator-ace-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r998029 - /incubator/ace/trunk/ace-client-repository-impl/src/main/java/org/apache/ace/client/repository/impl/RepositoryObjectImpl.java
Date Fri, 17 Sep 2010 09:22:39 GMT
Author: marrs
Date: Fri Sep 17 09:22:37 2010
New Revision: 998029

URL: http://svn.apache.org/viewvc?rev=998029&view=rev
Log:
Added a check so only non-null keys and values in object attribute or tag maps are written
to XML.

Modified:
    incubator/ace/trunk/ace-client-repository-impl/src/main/java/org/apache/ace/client/repository/impl/RepositoryObjectImpl.java

Modified: incubator/ace/trunk/ace-client-repository-impl/src/main/java/org/apache/ace/client/repository/impl/RepositoryObjectImpl.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/ace-client-repository-impl/src/main/java/org/apache/ace/client/repository/impl/RepositoryObjectImpl.java?rev=998029&r1=998028&r2=998029&view=diff
==============================================================================
--- incubator/ace/trunk/ace-client-repository-impl/src/main/java/org/apache/ace/client/repository/impl/RepositoryObjectImpl.java
(original)
+++ incubator/ace/trunk/ace-client-repository-impl/src/main/java/org/apache/ace/client/repository/impl/RepositoryObjectImpl.java
Fri Sep 17 09:22:37 2010
@@ -427,10 +427,12 @@ public class RepositoryObjectImpl<T exte
     static void writeMap(HierarchicalStreamWriter writer, Map<String, String> entries,
String name) {
         writer.startNode(name);
         for (Map.Entry<String, String> entry : entries.entrySet()) {
-            writer.startNode(entry.getKey());
-            assert (entry.getValue() != null);
-            writer.setValue(entry.getValue());
-            writer.endNode();
+            if (entry.getKey() != null && entry.getValue() != null) {
+                // we only write values that have non null keys and values
+                writer.startNode(entry.getKey());
+                writer.setValue(entry.getValue());
+                writer.endNode();
+            }
         }
         writer.endNode();
     }



Mime
View raw message