aboutsummaryrefslogtreecommitdiffstats
path: root/src/java
diff options
context:
space:
mode:
authorAndreas Beeker <kiwiwings@apache.org>2019-10-26 19:13:16 +0000
committerAndreas Beeker <kiwiwings@apache.org>2019-10-26 19:13:16 +0000
commit52b4ecfa9b301adeb15d1d50aa541fbc510daddf (patch)
tree26ab33c72af283ec0b9e8e39def3427f5886cbd2 /src/java
parent8906cba704b4b589d0d5cd24e4f2090ba2e82e51 (diff)
downloadpoi-52b4ecfa9b301adeb15d1d50aa541fbc510daddf.tar.gz
poi-52b4ecfa9b301adeb15d1d50aa541fbc510daddf.zip
#63745 - Fix line endings ... again
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1869013 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java')
-rw-r--r--src/java/org/apache/poi/util/GenericRecordJsonWriter.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/java/org/apache/poi/util/GenericRecordJsonWriter.java b/src/java/org/apache/poi/util/GenericRecordJsonWriter.java
index 10e6beb314..08dc3c371a 100644
--- a/src/java/org/apache/poi/util/GenericRecordJsonWriter.java
+++ b/src/java/org/apache/poi/util/GenericRecordJsonWriter.java
@@ -56,6 +56,7 @@ public class GenericRecordJsonWriter implements Closeable {
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 implements Closeable {
}
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 implements Closeable {
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());