Skip to content

Commit 056bf5e

Browse files
committed
start adding non-blocking/async json parser (will take a while)
1 parent 20972a2 commit 056bf5e

File tree

3 files changed

+485
-5
lines changed

3 files changed

+485
-5
lines changed

src/main/java/com/fasterxml/jackson/core/base/ParserMinimalBase.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,16 @@ public abstract class ParserMinimalBase extends JsonParser
5454

5555
protected final static char CHAR_NULL = '\0';
5656

57+
/**
58+
* @since 2.9
59+
*/
60+
protected final static byte[] NO_BYTES = new byte[0];
61+
62+
/**
63+
* @since 2.9
64+
*/
65+
protected final static int[] NO_INTS = new int[0];
66+
5767
/*
5868
/**********************************************************
5969
/* Constants and fields of former 'JsonNumericParserBase'

src/main/java/com/fasterxml/jackson/core/json/UTF8StreamJsonParser.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -290,11 +290,9 @@ protected void _releaseBuffers() throws IOException
290290
if (_bufferRecyclable) {
291291
byte[] buf = _inputBuffer;
292292
if (buf != null) {
293-
/* 21-Nov-2014, tatu: Let's not set it to null; this way should
294-
* get slightly more meaningful error messages in case someone
295-
* closes parser indirectly, without realizing.
296-
*/
297-
_inputBuffer = ByteArrayBuilder.NO_BYTES;
293+
// Let's not set it to null; this way should get slightly more meaningful
294+
// error messages in case someone closes parser indirectly, without realizing.
295+
_inputBuffer = NO_BYTES;
298296
_ioContext.releaseReadIOBuffer(buf);
299297
}
300298
}

0 commit comments

Comments
 (0)