Refactoring, trying to figure out how to get rid of mandatory `loadMore[Guaranteed]` methods without big backwards compat pains
diff --git a/src/main/java/com/fasterxml/jackson/core/JsonFactory.java b/src/main/java/com/fasterxml/jackson/core/JsonFactory.java
index c85652f..c68317f 100644
--- a/src/main/java/com/fasterxml/jackson/core/JsonFactory.java
+++ b/src/main/java/com/fasterxml/jackson/core/JsonFactory.java
@@ -442,6 +442,9 @@
* @since 2.1
*/
public boolean canUseSchema(FormatSchema schema) {
+ if (schema == null){
+ return false;
+ }
String ourFormat = getFormatName();
return (ourFormat != null) && ourFormat.equals(schema.getSchemaType());
}
diff --git a/src/main/java/com/fasterxml/jackson/core/base/ParserBase.java b/src/main/java/com/fasterxml/jackson/core/base/ParserBase.java
index 8c69f72..92ed3af 100644
--- a/src/main/java/com/fasterxml/jackson/core/base/ParserBase.java
+++ b/src/main/java/com/fasterxml/jackson/core/base/ParserBase.java
@@ -1152,7 +1152,8 @@
/*
/**********************************************************
- /* Stuff deprecated in 2.8, to be removed in 2.9 or later
+ /* Stuff that was abstract and required before 2.8, but that
+ /* is not mandatory in 2.8 or above.
/**********************************************************
*/
@@ -1164,6 +1165,6 @@
@Deprecated // since 2.8
protected boolean loadMore() throws IOException { return false; }
- @Deprecated // since 2.8
+ // Can't declare as deprecated, for now, but shouldn't be needed
protected void _finishString() throws IOException { }
}
diff --git a/src/main/java/com/fasterxml/jackson/core/json/ReaderBasedJsonParser.java b/src/main/java/com/fasterxml/jackson/core/json/ReaderBasedJsonParser.java
index 4417124..a3b251d 100644
--- a/src/main/java/com/fasterxml/jackson/core/json/ReaderBasedJsonParser.java
+++ b/src/main/java/com/fasterxml/jackson/core/json/ReaderBasedJsonParser.java
@@ -165,7 +165,7 @@
protected char getNextChar(String eofMsg) throws IOException {
if (_inputPtr >= _inputEnd) {
- if (!loadMore()) { _reportInvalidEOF(eofMsg); }
+ if (!_loadMore()) { _reportInvalidEOF(eofMsg); }
}
return _inputBuffer[_inputPtr++];
}
@@ -214,11 +214,11 @@
/**********************************************************
*/
- protected void loadMoreGuaranteed() throws IOException {
- if (!loadMore()) { _reportInvalidEOF(); }
+ protected void _loadMoreGuaranteed() throws IOException {
+ if (!_loadMore()) { _reportInvalidEOF(); }
}
- protected boolean loadMore() throws IOException
+ protected boolean _loadMore() throws IOException
{
final int bufSize = _inputEnd;
@@ -466,7 +466,7 @@
char ch;
do {
if (_inputPtr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
}
ch = _inputBuffer[_inputPtr++];
} while (ch <= INT_SPACE);
@@ -493,7 +493,7 @@
// then second base64 char; can't get padding yet, nor ws
if (_inputPtr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
}
ch = _inputBuffer[_inputPtr++];
bits = b64variant.decodeBase64Char(ch);
@@ -504,7 +504,7 @@
// third base64 char; can be padding, but not ws
if (_inputPtr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
}
ch = _inputBuffer[_inputPtr++];
bits = b64variant.decodeBase64Char(ch);
@@ -523,7 +523,7 @@
if (bits == Base64Variant.BASE64_VALUE_PADDING) {
// Ok, must get padding
if (_inputPtr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
}
ch = _inputBuffer[_inputPtr++];
if (!b64variant.usesPaddingChar(ch)) {
@@ -539,7 +539,7 @@
decodedData = (decodedData << 6) | bits;
// fourth and last base64 char; can be padding, but not ws
if (_inputPtr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
}
ch = _inputBuffer[_inputPtr++];
bits = b64variant.decodeBase64Char(ch);
@@ -1428,7 +1428,7 @@
outPtr = 0;
}
outBuf[outPtr++] = c;
- if (_inputPtr >= _inputEnd && !loadMore()) {
+ if (_inputPtr >= _inputEnd && !_loadMore()) {
// EOF is legal for main level int values
c = CHAR_NULL;
eof = true;
@@ -1448,7 +1448,7 @@
fract_loop:
while (true) {
- if (_inputPtr >= _inputEnd && !loadMore()) {
+ if (_inputPtr >= _inputEnd && !_loadMore()) {
eof = true;
break fract_loop;
}
@@ -1499,7 +1499,7 @@
outPtr = 0;
}
outBuf[outPtr++] = c;
- if (_inputPtr >= _inputEnd && !loadMore()) {
+ if (_inputPtr >= _inputEnd && !_loadMore()) {
eof = true;
break exp_loop;
}
@@ -1543,7 +1543,7 @@
private char _verifyNLZ2() throws IOException
{
- if (_inputPtr >= _inputEnd && !loadMore()) {
+ if (_inputPtr >= _inputEnd && !_loadMore()) {
return '0';
}
char ch = _inputBuffer[_inputPtr];
@@ -1556,7 +1556,7 @@
// if so, just need to skip either all zeroes (if followed by number); or all but one (if non-number)
++_inputPtr; // Leading zero to be skipped
if (ch == INT_0) {
- while (_inputPtr < _inputEnd || loadMore()) {
+ while (_inputPtr < _inputEnd || _loadMore()) {
ch = _inputBuffer[_inputPtr];
if (ch < '0' || ch > '9') { // followed by non-number; retain one zero
return '0';
@@ -1578,7 +1578,7 @@
{
if (ch == 'I') {
if (_inputPtr >= _inputEnd) {
- if (!loadMore()) { _reportInvalidEOFInValue(); }
+ if (!_loadMore()) { _reportInvalidEOFInValue(); }
}
ch = _inputBuffer[_inputPtr++];
if (ch == 'N') {
@@ -1671,7 +1671,7 @@
while (true) {
if (_inputPtr >= _inputEnd) {
- if (!loadMore()) {
+ if (!_loadMore()) {
_reportInvalidEOF(": was expecting closing '"+((char) endChar)+"' for name");
}
}
@@ -1851,7 +1851,7 @@
break;
case '+': // note: '-' is taken as number
if (_inputPtr >= _inputEnd) {
- if (!loadMore()) {
+ if (!_loadMore()) {
_reportInvalidEOFInValue();
}
}
@@ -1873,7 +1873,7 @@
while (true) {
if (_inputPtr >= _inputEnd) {
- if (!loadMore()) {
+ if (!_loadMore()) {
_reportInvalidEOF(": was expecting closing quote for a string value");
}
}
@@ -1916,7 +1916,7 @@
while (true) {
if (_inputPtr >= _inputEnd) {
- if (!loadMore()) { // acceptable for now (will error out later)
+ if (!_loadMore()) { // acceptable for now (will error out later)
break;
}
}
@@ -1951,6 +1951,7 @@
}
}
+ @Override
protected final void _finishString() throws IOException
{
/* First: let's try to see if we have simple String value: one
@@ -1996,7 +1997,7 @@
while (true) {
if (_inputPtr >= _inputEnd) {
- if (!loadMore()) {
+ if (!_loadMore()) {
_reportInvalidEOF(": was expecting closing quote for a string value");
}
}
@@ -2042,7 +2043,7 @@
while (true) {
if (inPtr >= inLen) {
_inputPtr = inPtr;
- if (!loadMore()) {
+ if (!_loadMore()) {
_reportInvalidEOF(": was expecting closing quote for a string value");
}
inPtr = _inputPtr;
@@ -2085,7 +2086,7 @@
* (to see if we have \n following \r).
*/
protected final void _skipCR() throws IOException {
- if (_inputPtr < _inputEnd || loadMore()) {
+ if (_inputPtr < _inputEnd || _loadMore()) {
if (_inputBuffer[_inputPtr] == '\n') {
++_inputPtr;
}
@@ -2152,7 +2153,7 @@
{
while (true) {
if (_inputPtr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
}
int i = (int) _inputBuffer[_inputPtr++];
if (i > INT_SPACE) {
@@ -2269,7 +2270,7 @@
private final int _skipAfterComma2() throws IOException
{
- while (_inputPtr < _inputEnd || loadMore()) {
+ while (_inputPtr < _inputEnd || _loadMore()) {
int i = (int) _inputBuffer[_inputPtr++];
if (i > INT_SPACE) {
if (i == INT_SLASH) {
@@ -2302,7 +2303,7 @@
// Let's handle first character separately since it is likely that
// it is either non-whitespace; or we have longer run of white space
if (_inputPtr >= _inputEnd) {
- if (!loadMore()) {
+ if (!_loadMore()) {
return _eofAsNextChar();
}
}
@@ -2352,7 +2353,7 @@
{
while (true) {
if (_inputPtr >= _inputEnd) {
- if (!loadMore()) { // We ran out of input...
+ if (!_loadMore()) { // We ran out of input...
return _eofAsNextChar();
}
}
@@ -2387,7 +2388,7 @@
_reportUnexpectedChar('/', "maybe a (non-standard) comment? (not recognized as one since Feature 'ALLOW_COMMENTS' not enabled for parser)");
}
// First: check which comment (if either) it is:
- if (_inputPtr >= _inputEnd && !loadMore()) {
+ if (_inputPtr >= _inputEnd && !_loadMore()) {
_reportInvalidEOF(" in a comment");
}
char c = _inputBuffer[_inputPtr++];
@@ -2403,11 +2404,11 @@
private void _skipCComment() throws IOException
{
// Ok: need the matching '*/'
- while ((_inputPtr < _inputEnd) || loadMore()) {
+ while ((_inputPtr < _inputEnd) || _loadMore()) {
int i = (int) _inputBuffer[_inputPtr++];
if (i <= '*') {
if (i == '*') { // end?
- if ((_inputPtr >= _inputEnd) && !loadMore()) {
+ if ((_inputPtr >= _inputEnd) && !_loadMore()) {
break;
}
if (_inputBuffer[_inputPtr] == INT_SLASH) {
@@ -2443,7 +2444,7 @@
private void _skipLine() throws IOException
{
// Ok: need to find EOF or linefeed
- while ((_inputPtr < _inputEnd) || loadMore()) {
+ while ((_inputPtr < _inputEnd) || _loadMore()) {
int i = (int) _inputBuffer[_inputPtr++];
if (i < INT_SPACE) {
if (i == INT_LF) {
@@ -2464,7 +2465,7 @@
protected char _decodeEscaped() throws IOException
{
if (_inputPtr >= _inputEnd) {
- if (!loadMore()) {
+ if (!_loadMore()) {
_reportInvalidEOF(" in character escape sequence");
}
}
@@ -2500,7 +2501,7 @@
int value = 0;
for (int i = 0; i < 4; ++i) {
if (_inputPtr >= _inputEnd) {
- if (!loadMore()) {
+ if (!_loadMore()) {
_reportInvalidEOF(" in character escape sequence");
}
}
@@ -2571,7 +2572,7 @@
do {
if (_inputPtr >= _inputEnd) {
- if (!loadMore()) {
+ if (!_loadMore()) {
_reportInvalidToken(matchStr.substring(0, i));
}
}
@@ -2583,7 +2584,7 @@
// but let's also ensure we either get EOF, or non-alphanum char...
if (_inputPtr >= _inputEnd) {
- if (!loadMore()) {
+ if (!_loadMore()) {
return;
}
}
@@ -2619,7 +2620,7 @@
char ch;
do {
if (_inputPtr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
}
ch = _inputBuffer[_inputPtr++];
} while (ch <= INT_SPACE);
@@ -2638,7 +2639,7 @@
// then second base64 char; can't get padding yet, nor ws
if (_inputPtr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
}
ch = _inputBuffer[_inputPtr++];
bits = b64variant.decodeBase64Char(ch);
@@ -2649,7 +2650,7 @@
// third base64 char; can be padding, but not ws
if (_inputPtr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
}
ch = _inputBuffer[_inputPtr++];
bits = b64variant.decodeBase64Char(ch);
@@ -2668,7 +2669,7 @@
if (bits == Base64Variant.BASE64_VALUE_PADDING) {
// Ok, must get more padding chars, then
if (_inputPtr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
}
ch = _inputBuffer[_inputPtr++];
if (!b64variant.usesPaddingChar(ch)) {
@@ -2685,7 +2686,7 @@
decodedData = (decodedData << 6) | bits;
// fourth and last base64 char; can be padding, but not ws
if (_inputPtr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
}
ch = _inputBuffer[_inputPtr++];
bits = b64variant.decodeBase64Char(ch);
@@ -2781,7 +2782,7 @@
*/
while (true) {
if (_inputPtr >= _inputEnd) {
- if (!loadMore()) {
+ if (!_loadMore()) {
break;
}
}
diff --git a/src/main/java/com/fasterxml/jackson/core/json/UTF8DataInputJsonParser.java b/src/main/java/com/fasterxml/jackson/core/json/UTF8DataInputJsonParser.java
index 8166ee6..8f89740 100644
--- a/src/main/java/com/fasterxml/jackson/core/json/UTF8DataInputJsonParser.java
+++ b/src/main/java/com/fasterxml/jackson/core/json/UTF8DataInputJsonParser.java
@@ -1787,6 +1787,7 @@
/**********************************************************
*/
+ @Override
protected void _finishString() throws IOException
{
int outPtr = 0;
diff --git a/src/main/java/com/fasterxml/jackson/core/json/UTF8StreamJsonParser.java b/src/main/java/com/fasterxml/jackson/core/json/UTF8StreamJsonParser.java
index dbf2cdc..531070d 100644
--- a/src/main/java/com/fasterxml/jackson/core/json/UTF8StreamJsonParser.java
+++ b/src/main/java/com/fasterxml/jackson/core/json/UTF8StreamJsonParser.java
@@ -183,7 +183,7 @@
/**********************************************************
*/
- protected final boolean loadMore() throws IOException
+ protected final boolean _loadMore() throws IOException
{
final int bufSize = _inputEnd;
@@ -560,7 +560,7 @@
int ch;
do {
if (_inputPtr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
}
ch = (int) _inputBuffer[_inputPtr++] & 0xFF;
} while (ch <= INT_SPACE);
@@ -587,7 +587,7 @@
// then second base64 char; can't get padding yet, nor ws
if (_inputPtr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
}
ch = _inputBuffer[_inputPtr++] & 0xFF;
bits = b64variant.decodeBase64Char(ch);
@@ -598,7 +598,7 @@
// third base64 char; can be padding, but not ws
if (_inputPtr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
}
ch = _inputBuffer[_inputPtr++] & 0xFF;
bits = b64variant.decodeBase64Char(ch);
@@ -617,7 +617,7 @@
if (bits == Base64Variant.BASE64_VALUE_PADDING) {
// Ok, must get padding
if (_inputPtr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
}
ch = _inputBuffer[_inputPtr++] & 0xFF;
if (!b64variant.usesPaddingChar(ch)) {
@@ -633,7 +633,7 @@
decodedData = (decodedData << 6) | bits;
// fourth and last base64 char; can be padding, but not ws
if (_inputPtr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
}
ch = _inputBuffer[_inputPtr++] & 0xFF;
bits = b64variant.decodeBase64Char(ch);
@@ -1411,7 +1411,7 @@
outBuf[outPtr++] = '-';
// Must have something after sign too
if (_inputPtr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
}
int c = (int) _inputBuffer[_inputPtr++] & 0xFF;
// Note: must be followed by a digit
@@ -1472,7 +1472,7 @@
{
// Ok, parse the rest
while (true) {
- if (_inputPtr >= _inputEnd && !loadMore()) {
+ if (_inputPtr >= _inputEnd && !_loadMore()) {
_textBuffer.setCurrentLength(outPtr);
return resetInt(negative, intPartLength);
}
@@ -1509,7 +1509,7 @@
private final int _verifyNoLeadingZeroes() throws IOException
{
// Ok to have plain "0"
- if (_inputPtr >= _inputEnd && !loadMore()) {
+ if (_inputPtr >= _inputEnd && !_loadMore()) {
return INT_0;
}
int ch = _inputBuffer[_inputPtr] & 0xFF;
@@ -1524,7 +1524,7 @@
// if so, just need to skip either all zeroes (if followed by number); or all but one (if non-number)
++_inputPtr; // Leading zero to be skipped
if (ch == INT_0) {
- while (_inputPtr < _inputEnd || loadMore()) {
+ while (_inputPtr < _inputEnd || _loadMore()) {
ch = _inputBuffer[_inputPtr] & 0xFF;
if (ch < INT_0 || ch > INT_9) { // followed by non-number; retain one zero
return INT_0;
@@ -1550,7 +1550,7 @@
fract_loop:
while (true) {
- if (_inputPtr >= _inputEnd && !loadMore()) {
+ if (_inputPtr >= _inputEnd && !_loadMore()) {
eof = true;
break fract_loop;
}
@@ -1580,7 +1580,7 @@
outBuf[outPtr++] = (char) c;
// Not optional, can require that we get one more char
if (_inputPtr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
}
c = (int) _inputBuffer[_inputPtr++] & 0xFF;
// Sign indicator?
@@ -1592,7 +1592,7 @@
outBuf[outPtr++] = (char) c;
// Likewise, non optional:
if (_inputPtr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
}
c = (int) _inputBuffer[_inputPtr++] & 0xFF;
}
@@ -1605,7 +1605,7 @@
outPtr = 0;
}
outBuf[outPtr++] = (char) c;
- if (_inputPtr >= _inputEnd && !loadMore()) {
+ if (_inputPtr >= _inputEnd && !_loadMore()) {
eof = true;
break exp_loop;
}
@@ -1879,7 +1879,7 @@
protected String slowParseName() throws IOException
{
if (_inputPtr >= _inputEnd) {
- if (!loadMore()) {
+ if (!_loadMore()) {
_reportInvalidEOF(": was expecting closing '\"' for name");
}
}
@@ -1985,7 +1985,7 @@
currQuadBytes = 1;
}
if (_inputPtr >= _inputEnd) {
- if (!loadMore()) {
+ if (!_loadMore()) {
_reportInvalidEOF(" in field name");
}
}
@@ -2055,7 +2055,7 @@
currQuadBytes = 1;
}
if (_inputPtr >= _inputEnd) {
- if (!loadMore()) {
+ if (!_loadMore()) {
_reportInvalidEOF(" in field name");
}
}
@@ -2087,7 +2087,7 @@
protected String _parseAposName() throws IOException
{
if (_inputPtr >= _inputEnd) {
- if (!loadMore()) {
+ if (!_loadMore()) {
_reportInvalidEOF(": was expecting closing '\'' for name");
}
}
@@ -2169,7 +2169,7 @@
currQuadBytes = 1;
}
if (_inputPtr >= _inputEnd) {
- if (!loadMore()) {
+ if (!_loadMore()) {
_reportInvalidEOF(" in field name");
}
}
@@ -2369,16 +2369,17 @@
/**********************************************************
*/
- protected void loadMoreGuaranteed() throws IOException {
- if (!loadMore()) { _reportInvalidEOF(); }
+ protected void _loadMoreGuaranteed() throws IOException {
+ if (!_loadMore()) { _reportInvalidEOF(); }
}
+ @Override
protected void _finishString() throws IOException
{
// First, single tight loop for ASCII content, not split across input buffer boundary:
int ptr = _inputPtr;
if (ptr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
ptr = _inputPtr;
}
int outPtr = 0;
@@ -2412,7 +2413,7 @@
// First, single tight loop for ASCII content, not split across input buffer boundary:
int ptr = _inputPtr;
if (ptr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
ptr = _inputPtr;
}
int outPtr = 0;
@@ -2454,7 +2455,7 @@
while (true) {
int ptr = _inputPtr;
if (ptr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
ptr = _inputPtr;
}
if (outPtr >= outBuf.length) {
@@ -2544,7 +2545,7 @@
int ptr = _inputPtr;
int max = _inputEnd;
if (ptr >= max) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
ptr = _inputPtr;
max = _inputEnd;
}
@@ -2644,7 +2645,7 @@
break;
case '+': // note: '-' is taken as number
if (_inputPtr >= _inputEnd) {
- if (!loadMore()) {
+ if (!_loadMore()) {
_reportInvalidEOFInValue();
}
}
@@ -2677,7 +2678,7 @@
ascii_loop:
while (true) {
if (_inputPtr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
}
if (outPtr >= outBuf.length) {
outBuf = _textBuffer.finishCurrentSegment();
@@ -2760,7 +2761,7 @@
{
while (ch == 'I') {
if (_inputPtr >= _inputEnd) {
- if (!loadMore()) {
+ if (!_loadMore()) {
_reportInvalidEOFInValue();
}
}
@@ -2807,7 +2808,7 @@
{
final int len = matchStr.length();
do {
- if (((_inputPtr >= _inputEnd) && !loadMore())
+ if (((_inputPtr >= _inputEnd) && !_loadMore())
|| (_inputBuffer[_inputPtr] != matchStr.charAt(i))) {
_reportInvalidToken(matchStr.substring(0, i));
}
@@ -2815,7 +2816,7 @@
} while (++i < len);
// but let's also ensure we either get EOF, or non-alphanum char...
- if (_inputPtr >= _inputEnd && !loadMore()) {
+ if (_inputPtr >= _inputEnd && !_loadMore()) {
return;
}
int ch = _inputBuffer[_inputPtr] & 0xFF;
@@ -2865,7 +2866,7 @@
private final int _skipWS2() throws IOException
{
- while (_inputPtr < _inputEnd || loadMore()) {
+ while (_inputPtr < _inputEnd || _loadMore()) {
int i = _inputBuffer[_inputPtr++] & 0xFF;
if (i > INT_SPACE) {
if (i == INT_SLASH) {
@@ -2898,7 +2899,7 @@
// Let's handle first character separately since it is likely that
// it is either non-whitespace; or we have longer run of white space
if (_inputPtr >= _inputEnd) {
- if (!loadMore()) {
+ if (!_loadMore()) {
return _eofAsNextChar();
}
}
@@ -2946,7 +2947,7 @@
private final int _skipWSOrEnd2() throws IOException
{
- while ((_inputPtr < _inputEnd) || loadMore()) {
+ while ((_inputPtr < _inputEnd) || _loadMore()) {
int i = _inputBuffer[_inputPtr++] & 0xFF;
if (i > INT_SPACE) {
if (i == INT_SLASH) {
@@ -3031,7 +3032,7 @@
private final int _skipColon2(boolean gotColon) throws IOException
{
- while (_inputPtr < _inputEnd || loadMore()) {
+ while (_inputPtr < _inputEnd || _loadMore()) {
int i = _inputBuffer[_inputPtr++] & 0xFF;
if (i > INT_SPACE) {
@@ -3074,7 +3075,7 @@
_reportUnexpectedChar('/', "maybe a (non-standard) comment? (not recognized as one since Feature 'ALLOW_COMMENTS' not enabled for parser)");
}
// First: check which comment (if either) it is:
- if (_inputPtr >= _inputEnd && !loadMore()) {
+ if (_inputPtr >= _inputEnd && !_loadMore()) {
_reportInvalidEOF(" in a comment");
}
int c = _inputBuffer[_inputPtr++] & 0xFF;
@@ -3094,13 +3095,13 @@
// Ok: need the matching '*/'
main_loop:
- while ((_inputPtr < _inputEnd) || loadMore()) {
+ while ((_inputPtr < _inputEnd) || _loadMore()) {
int i = (int) _inputBuffer[_inputPtr++] & 0xFF;
int code = codes[i];
if (code != 0) {
switch (code) {
case '*':
- if (_inputPtr >= _inputEnd && !loadMore()) {
+ if (_inputPtr >= _inputEnd && !_loadMore()) {
break main_loop;
}
if (_inputBuffer[_inputPtr] == INT_SLASH) {
@@ -3150,7 +3151,7 @@
{
// Ok: need to find EOF or linefeed
final int[] codes = CharTypes.getInputCodeComment();
- while ((_inputPtr < _inputEnd) || loadMore()) {
+ while ((_inputPtr < _inputEnd) || _loadMore()) {
int i = (int) _inputBuffer[_inputPtr++] & 0xFF;
int code = codes[i];
if (code != 0) {
@@ -3187,7 +3188,7 @@
protected char _decodeEscaped() throws IOException
{
if (_inputPtr >= _inputEnd) {
- if (!loadMore()) {
+ if (!_loadMore()) {
_reportInvalidEOF(" in character escape sequence");
}
}
@@ -3223,7 +3224,7 @@
int value = 0;
for (int i = 0; i < 4; ++i) {
if (_inputPtr >= _inputEnd) {
- if (!loadMore()) {
+ if (!_loadMore()) {
_reportInvalidEOF(" in character escape sequence");
}
}
@@ -3292,7 +3293,7 @@
private final int _decodeUtf8_2(int c) throws IOException
{
if (_inputPtr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
}
int d = (int) _inputBuffer[_inputPtr++];
if ((d & 0xC0) != 0x080) {
@@ -3304,7 +3305,7 @@
private final int _decodeUtf8_3(int c1) throws IOException
{
if (_inputPtr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
}
c1 &= 0x0F;
int d = (int) _inputBuffer[_inputPtr++];
@@ -3313,7 +3314,7 @@
}
int c = (c1 << 6) | (d & 0x3F);
if (_inputPtr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
}
d = (int) _inputBuffer[_inputPtr++];
if ((d & 0xC0) != 0x080) {
@@ -3346,7 +3347,7 @@
private final int _decodeUtf8_4(int c) throws IOException
{
if (_inputPtr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
}
int d = (int) _inputBuffer[_inputPtr++];
if ((d & 0xC0) != 0x080) {
@@ -3355,7 +3356,7 @@
c = ((c & 0x07) << 6) | (d & 0x3F);
if (_inputPtr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
}
d = (int) _inputBuffer[_inputPtr++];
if ((d & 0xC0) != 0x080) {
@@ -3363,7 +3364,7 @@
}
c = (c << 6) | (d & 0x3F);
if (_inputPtr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
}
d = (int) _inputBuffer[_inputPtr++];
if ((d & 0xC0) != 0x080) {
@@ -3379,7 +3380,7 @@
private final void _skipUtf8_2(int c) throws IOException
{
if (_inputPtr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
}
c = (int) _inputBuffer[_inputPtr++];
if ((c & 0xC0) != 0x080) {
@@ -3393,7 +3394,7 @@
private final void _skipUtf8_3(int c) throws IOException
{
if (_inputPtr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
}
//c &= 0x0F;
c = (int) _inputBuffer[_inputPtr++];
@@ -3401,7 +3402,7 @@
_reportInvalidOther(c & 0xFF, _inputPtr);
}
if (_inputPtr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
}
c = (int) _inputBuffer[_inputPtr++];
if ((c & 0xC0) != 0x080) {
@@ -3412,21 +3413,21 @@
private final void _skipUtf8_4(int c) throws IOException
{
if (_inputPtr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
}
int d = (int) _inputBuffer[_inputPtr++];
if ((d & 0xC0) != 0x080) {
_reportInvalidOther(d & 0xFF, _inputPtr);
}
if (_inputPtr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
}
d = (int) _inputBuffer[_inputPtr++];
if ((d & 0xC0) != 0x080) {
_reportInvalidOther(d & 0xFF, _inputPtr);
}
if (_inputPtr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
}
d = (int) _inputBuffer[_inputPtr++];
if ((d & 0xC0) != 0x080) {
@@ -3446,7 +3447,7 @@
*/
protected final void _skipCR() throws IOException
{
- if (_inputPtr < _inputEnd || loadMore()) {
+ if (_inputPtr < _inputEnd || _loadMore()) {
if (_inputBuffer[_inputPtr] == BYTE_LF) {
++_inputPtr;
}
@@ -3458,7 +3459,7 @@
private int nextByte() throws IOException
{
if (_inputPtr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
}
return _inputBuffer[_inputPtr++] & 0xFF;
}
@@ -3483,7 +3484,7 @@
* nothing fancy here (nor fast).
*/
while (true) {
- if (_inputPtr >= _inputEnd && !loadMore()) {
+ if (_inputPtr >= _inputEnd && !_loadMore()) {
break;
}
int i = (int) _inputBuffer[_inputPtr++];
@@ -3554,7 +3555,7 @@
int ch;
do {
if (_inputPtr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
}
ch = (int) _inputBuffer[_inputPtr++] & 0xFF;
} while (ch <= INT_SPACE);
@@ -3573,7 +3574,7 @@
// then second base64 char; can't get padding yet, nor ws
if (_inputPtr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
}
ch = _inputBuffer[_inputPtr++] & 0xFF;
bits = b64variant.decodeBase64Char(ch);
@@ -3584,7 +3585,7 @@
// third base64 char; can be padding, but not ws
if (_inputPtr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
}
ch = _inputBuffer[_inputPtr++] & 0xFF;
bits = b64variant.decodeBase64Char(ch);
@@ -3603,7 +3604,7 @@
if (bits == Base64Variant.BASE64_VALUE_PADDING) {
// Ok, must get padding
if (_inputPtr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
}
ch = _inputBuffer[_inputPtr++] & 0xFF;
if (!b64variant.usesPaddingChar(ch)) {
@@ -3619,7 +3620,7 @@
decodedData = (decodedData << 6) | bits;
// fourth and last base64 char; can be padding, but not ws
if (_inputPtr >= _inputEnd) {
- loadMoreGuaranteed();
+ _loadMoreGuaranteed();
}
ch = _inputBuffer[_inputPtr++] & 0xFF;
bits = b64variant.decodeBase64Char(ch);
diff --git a/src/test/java/com/fasterxml/jackson/core/TestJDKSerializability.java b/src/test/java/com/fasterxml/jackson/core/TestJDKSerializability.java
index ced0384..c03458f 100644
--- a/src/test/java/com/fasterxml/jackson/core/TestJDKSerializability.java
+++ b/src/test/java/com/fasterxml/jackson/core/TestJDKSerializability.java
@@ -11,7 +11,7 @@
import com.fasterxml.jackson.core.util.DefaultPrettyPrinter;
/**
- * Unit tests for [Issue#31] (https://github.com/FasterXML/jackson-core/issues/31)
+ * Unit tests for [core#31] (https://github.com/FasterXML/jackson-core/issues/31)
*/
public class TestJDKSerializability extends BaseTest
{
@@ -128,7 +128,7 @@
objIn.close();
}
}
-
+
@SuppressWarnings("resource")
protected String _copyJson(JsonFactory f, String json, boolean useBytes) throws IOException
{
@@ -144,13 +144,13 @@
return sw.toString();
}
- protected void _copyJson(JsonFactory f, String json, JsonGenerator jg) throws IOException
+ protected void _copyJson(JsonFactory f, String json, JsonGenerator g) throws IOException
{
- JsonParser jp = f.createParser(json);
- while (jp.nextToken() != null) {
- jg.copyCurrentEvent(jp);
+ JsonParser p = f.createParser(json);
+ while (p.nextToken() != null) {
+ g.copyCurrentEvent(p);
}
- jp.close();
- jg.close();
+ p.close();
+ g.close();
}
}