Skip to content

Commit 182105a

Browse files
committed
PR Feedback.
1 parent c3d02b0 commit 182105a

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

java/src/json/ext/AbstractByteListDirectOutputStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
abstract class AbstractByteListDirectOutputStream extends OutputStream {
99

10-
private static final String PROP_SEGMENTED_BUFFER = "json.useSegmentedOutputStream";
10+
private static final String PROP_SEGMENTED_BUFFER = "jruby.json.useSegmentedOutputStream";
1111
private static final String PROP_SEGMENTED_BUFFER_DEFAULT = "true";
1212

1313
private static final boolean USE_SEGMENTED_BUFFER;

java/src/json/ext/SegmentedByteListDirectOutputStream.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ public class SegmentedByteListDirectOutputStream extends AbstractByteListDirectO
99
private static final int DEFAULT_CAPACITY = 1024;
1010

1111
private int totalLength;
12+
// Why 21? The minimum segment size is 1024 bytes. If we double the segment size each time
13+
// we need a new segment, we only need 21 segments to reach the maximum array size in Java.
1214
private byte[][] segments = new byte[21][];
1315
private int currentSegmentIndex;
1416
private int currentSegmentLength;

java/src/json/ext/StringEncoder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class StringEncoder extends ByteListTranscoder {
114114

115115
protected final byte[] escapeTable;
116116

117-
private static final String USE_SWAR_BASIC_ENCODER_PROP = "json.useSWARBasicEncoder";
117+
private static final String USE_SWAR_BASIC_ENCODER_PROP = "jruby.json.useSWARBasicEncoder";
118118
private static final String USE_SWAR_BASIC_ENCODER_DEFAULT = "true";
119119
private static final boolean USE_BASIC_SWAR_ENCODER;
120120

0 commit comments

Comments
 (0)