You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ki...@apache.org on 2019/10/26 19:13:16 UTC

svn commit: r1869013 - /poi/trunk/src/java/org/apache/poi/util/GenericRecordJsonWriter.java

Author: kiwiwings
Date: Sat Oct 26 19:13:16 2019
New Revision: 1869013

URL: http://svn.apache.org/viewvc?rev=1869013&view=rev
Log:
#63745 - Fix line endings ... again

Modified:
    poi/trunk/src/java/org/apache/poi/util/GenericRecordJsonWriter.java

Modified: poi/trunk/src/java/org/apache/poi/util/GenericRecordJsonWriter.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/util/GenericRecordJsonWriter.java?rev=1869013&r1=1869012&r2=1869013&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/util/GenericRecordJsonWriter.java (original)
+++ poi/trunk/src/java/org/apache/poi/util/GenericRecordJsonWriter.java Sat Oct 26 19:13:16 2019
@@ -56,6 +56,7 @@ public class GenericRecordJsonWriter imp
     private static final String TABS;
     private static final String ZEROS = "0000000000000000";
     private static final Pattern ESC_CHARS = Pattern.compile("[\"\\p{Cntrl}\\\\]");
+    private static final String NL = System.getProperty("line.separator");
 
     @FunctionalInterface
     protected interface GenericRecordHandler {
@@ -192,7 +193,7 @@ public class GenericRecordJsonWriter imp
         }
 
         indent++;
-        aw.setHoldBack(tabs() + (hasProperties ? ", " : "") + "\"children\": [\n");
+        aw.setHoldBack(tabs() + (hasProperties ? ", " : "") + "\"children\": [" + NL);
         final int oldChildIndex = childIndex;
         childIndex = 0;
         long cnt = list.stream().filter(l -> writeValue(null, l) && ++childIndex > 0).count();
@@ -216,7 +217,7 @@ public class GenericRecordJsonWriter imp
 
     protected boolean writeProp(String name, Supplier<?> value) {
         final boolean isNext = (childIndex>0);
-        aw.setHoldBack(isNext ? "\n" + tabs() + "\t, " : tabs() + "\t  ");
+        aw.setHoldBack(isNext ? NL + tabs() + "\t, " : tabs() + "\t  ");
         final int oldChildIndex = childIndex;
         childIndex = 0;
         boolean written = writeValue(name, value.get());



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org