lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sar...@apache.org
Subject [11/19] lucene-solr:apiv2: SOLR-9720: tweak JSONWriter.writeArray
Date Mon, 07 Nov 2016 16:50:25 GMT
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/358bdd49
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/358bdd49
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/358bdd49

Branch: refs/heads/apiv2
Commit: 358bdd490b1b15f3af6a355f93a98caf83594b18
Parents: b2bf87d
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:20:50 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/358bdd49/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