You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by sh...@apache.org on 2008/10/15 13:13:47 UTC

svn commit: r704862 - in /lucene/solr/trunk: CHANGES.txt src/java/org/apache/solr/common/util/NamedListCodec.java

Author: shalin
Date: Wed Oct 15 04:13:46 2008
New Revision: 704862

URL: http://svn.apache.org/viewvc?rev=704862&view=rev
Log:
SOLR-808 -- Write string keys in Maps as extern strings in the javabin format

Modified:
    lucene/solr/trunk/CHANGES.txt
    lucene/solr/trunk/src/java/org/apache/solr/common/util/NamedListCodec.java

Modified: lucene/solr/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/CHANGES.txt?rev=704862&r1=704861&r2=704862&view=diff
==============================================================================
--- lucene/solr/trunk/CHANGES.txt (original)
+++ lucene/solr/trunk/CHANGES.txt Wed Oct 15 04:13:46 2008
@@ -62,6 +62,8 @@
  1. SOLR-374: Use IndexReader.reopen to save resources by re-using parts of the
     index that haven't changed. (Mark Miller via yonik)
 
+ 2. SOLR-808: Write string keys in Maps as extern strings in the javabin format. (Noble Paul via shalin)
+
 
 Bug Fixes
 ----------------------

Modified: lucene/solr/trunk/src/java/org/apache/solr/common/util/NamedListCodec.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/common/util/NamedListCodec.java?rev=704862&r1=704861&r2=704862&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/common/util/NamedListCodec.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/common/util/NamedListCodec.java Wed Oct 15 04:13:46 2008
@@ -495,7 +495,12 @@
           throws IOException {
     writeTag(MAP, val.size());
     for (Map.Entry entry : (Set<Map.Entry>) val.entrySet()) {
-      writeVal(entry.getKey());
+      Object key = entry.getKey();
+      if (key instanceof String) {
+        writeExternString((String) key);
+      } else {
+        writeVal(key);
+      }
       writeVal(entry.getValue());
     }
   }