From 364cdc87e3935ac5eb603d161fa82cdf968832bb Mon Sep 17 00:00:00 2001 From: Kevin Risden Date: Thu, 3 Nov 2022 16:58:29 -0400 Subject: [PATCH] SOLR-16512: Fix writing JSON objects in NoggitJSONWriter --- .../java/org/apache/solr/common/util/NoggitJSONWriter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/solr/solrj/src/java/org/apache/solr/common/util/NoggitJSONWriter.java b/solr/solrj/src/java/org/apache/solr/common/util/NoggitJSONWriter.java index d31e598604c..7dc474faa6b 100644 --- a/solr/solrj/src/java/org/apache/solr/common/util/NoggitJSONWriter.java +++ b/solr/solrj/src/java/org/apache/solr/common/util/NoggitJSONWriter.java @@ -59,7 +59,7 @@ public void write(Object o) { private IteratorWriter.ItemWriter itemWriter() { return new IteratorWriter.ItemWriter() { - private boolean first; + private boolean first = true; @Override public IteratorWriter.ItemWriter add(Object o) { @@ -77,7 +77,7 @@ public IteratorWriter.ItemWriter add(Object o) { private MapWriter.EntryWriter entryWriter() { return new MapWriter.EntryWriter() { - private boolean first; + private boolean first = true; @Override public MapWriter.EntryWriter put(CharSequence k, Object v) {