incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1075901 - /sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/FileDataStore.java
Date Tue, 01 Mar 2011 16:49:01 GMT
Author: cziegeler
Date: Tue Mar  1 16:49:00 2011
New Revision: 1075901

URL: http://svn.apache.org/viewvc?rev=1075901&view=rev
Log:
SLING-2007 : Improve digest calculation for configurations

Modified:
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/FileDataStore.java

Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/FileDataStore.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/FileDataStore.java?rev=1075901&r1=1075900&r2=1075901&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/FileDataStore.java
(original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/FileDataStore.java
Tue Mar  1 16:49:00 2011
@@ -240,15 +240,20 @@ public class FileDataStore {
             final ObjectOutputStream oos = new ObjectOutputStream(bos);
 
             final SortedSet<String> sortedKeys = new TreeSet<String>();
-            if(data != null) {
+            if (data != null) {
                 for(Enumeration<String> e = data.keys(); e.hasMoreElements(); ) {
                     final String key = e.nextElement();
                     sortedKeys.add(key);
                 }
             }
-            for(String key : sortedKeys) {
+            for(final String key : sortedKeys) {
                 oos.writeObject(key);
-                oos.writeObject(data.get(key));
+                final Object val = data.get(key);
+                if ( val instanceof Number ) {
+                    oos.writeObject(String.valueOf(val));
+                } else {
+                    oos.writeObject(val);
+                }
             }
 
             bos.flush();



Mime
View raw message