lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cpoersc...@apache.org
Subject lucene-solr:branch_6x: SOLR-9720: tweak JSONWriter.writeArray
Date Fri, 04 Nov 2016 20:54:33 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/branch_6x 758aacc7b -> 98e4ab523


SOLR-9720: tweak JSONWriter.writeArray


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/98e4ab52
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/98e4ab52
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/98e4ab52

Branch: refs/heads/branch_6x
Commit: 98e4ab52322e163de79a861796f80c2ad518784b
Parents: 758aacc
Author: Christine Poerschke <cpoerschke@apache.org>
Authored: Fri Nov 4 20:20:50 2016 +0000
Committer: Christine Poerschke <cpoerschke@apache.org>
Committed: Fri Nov 4 20:40:03 2016 +0000

----------------------------------------------------------------------
 .../src/java/org/apache/solr/response/JSONResponseWriter.java   | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/98e4ab52/solr/core/src/java/org/apache/solr/response/JSONResponseWriter.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/response/JSONResponseWriter.java b/solr/core/src/java/org/apache/solr/response/JSONResponseWriter.java
index 206bbd6..5149560 100644
--- a/solr/core/src/java/org/apache/solr/response/JSONResponseWriter.java
+++ b/solr/core/src/java/org/apache/solr/response/JSONResponseWriter.java
@@ -544,12 +544,14 @@ class JSONWriter extends TextResponseWriter {
   public void writeArray(String name, List l) throws IOException {
     writeArrayOpener(l.size());
     writeJsonIter(l.iterator());
+    writeArrayCloser();
   }
 
   @Override
   public void writeArray(String name, Iterator val) throws IOException {
     writeArrayOpener(-1); // no trivial way to determine array size
     writeJsonIter(val);
+    writeArrayCloser();
   }
 
   private void writeJsonIter(Iterator val) throws IOException {
@@ -564,7 +566,6 @@ class JSONWriter extends TextResponseWriter {
       first=false;
     }
     decLevel();
-    writeArrayCloser();
   }
 
   //
@@ -636,7 +637,7 @@ class ArrayOfNamedValuePairJSONWriter extends JSONWriter {
 
   @Override
   public void writeArray(String name, List l) throws IOException {
-    writeArray(name, l.iterator());
+    super.writeArray(name, l);
   }
 
   @Override


Mime
View raw message