Skip to content

Fixing non-blocking parser reporting incorrect location when fed with non-zero offset #1415

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java_version: ['8', '11', '17', '21', '23']
java_version: ['8', '17', '21', '23']
# We will actually need "os" as Matrix to have Windows build
os: ['ubuntu-22.04']
include:
Expand Down
8 changes: 8 additions & 0 deletions release-notes/CREDITS-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ David Nault (dnault@github)
* Reported #531: Non-blocking parser reports incorrect locations when fed with
non-zero offset
(2.10.0)
* Reported 1412: More cases of Non-blocking parser reporting incorrect locations
when fed with non-zero offset
(2.19.0)

Fabien Renaud (fabienrenaud@github)
* Reported, contributed fix for #533: UTF-8 BOM not accounted for in
Expand Down Expand Up @@ -471,3 +474,8 @@ Eduard Gomoliako (@Gems)
* Contributed #1356: Make `JsonGenerator::writeTypePrefix` method to not write a
`WRAPPER_ARRAY` when `typeIdDef.id == null`
(2.19.0)

Fawzi Essam (@iifawzi)
* Contributed fix for #1412: More cases of Non-blocking parser reporting incorrect locations
when fed with non-zero offset
(2.19.0)
4 changes: 4 additions & 0 deletions release-notes/VERSION-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ a pure JSON library.
at root level
#1407: [gradle-module-metadata-maven-plugin] update to version 1.0
(contributed by @jjohannes)
#1412: More cases of Non-blocking parser reporting incorrect locations
when fed with non-zero offset
(reported by David N)
(fixed by Fawzi E)

2.18.3 (28-Feb-2025)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ public JsonToken nextToken() throws IOException

// No: fresh new token; may or may not have existing one
_numTypesValid = NR_UNKNOWN;
_tokenInputTotal = _currInputProcessed + _inputPtr;
_tokenInputTotal = _currInputProcessed + (_inputPtr - _currBufferStart);

// also: clear any data retained so far
_binaryValue = null;
int ch = getNextUnsignedByteFromBuffer();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ void feedByteByByteFromOffsetZero() throws Exception {
}
}

@JacksonTestFailureExpected
@Test
@DisplayName("Feed one byte at a time from non-zero array offset")
void feedByteByByteFromNonZeroOffset() throws Exception {
Expand All @@ -94,7 +93,6 @@ void feedByteByByteFromNonZeroOffset() throws Exception {
}
}

@JacksonTestFailureExpected
@Test
@DisplayName("Feed whole document at once from non-zero array offset")
void feedWholeDocumentFromNonZeroOffset() throws Exception {
Expand Down