Non-root number separator validation not applied to non-blocking (async) parser (follow-up to #1557)
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 68/100
Research direction
Start in NonBlockingJsonParserBase and compare its number-completion sites with the equivalent checks in ReaderBasedJsonParser, UTF8StreamJsonParser, and UTF8DataInputJsonParser. Exercise the listed malformed inputs across chunk boundaries, and consider the work done when async parsing reports the error at the offending character while deferring decisions at NEED_MORE_INPUT boundaries.
Written by the indexing model from the issue text.
Description
Follow-up to #1557 / #1615, as discussed in https://github.com/FasterXML/jackson-core/pull/1615#issuecomment (with @cowtowncoder agreeing async warrants a separate change).
Background
#1615 generalized the root-only _verifyRootSpace into _verifyNumberSeparator and now eagerly validates the separator after non-root number values, but only in the three blocking parsers (ReaderBasedJsonParser, UTF8StreamJsonParser, UTF8DataInputJsonParser).
The non-blocking / async parser path (NonBlockingJsonParserBase and its subclasses NonBlockingJsonParser / NonBlockingByteArrayJsonParser) was intentionally left out of that PR and still fails lazily — the malformed content is only detected when the next token is read, one token too late.
Repro
The same inputs from #1557 that are now caught eagerly by the blocking parsers still slip through on the async path:
[ 123true ] // -> reports number token 123, fails only on next token
[ 100k ] // -> 100
[ 100/ ] // -> 100
[ 1.5x ] // -> 1.5
[ 1.5false ] // -> 1.5
Scope
Apply the equivalent trailing-separator check at the number-completion sites in the non-blocking parser so async parsing reports the error at the offending character, matching the blocking parsers' behavior and location. Async introduces NEED_MORE_INPUT boundaries at end-of-chunk, so the check has to tolerate a not-yet-available trailing byte (defer the decision to the next feed rather than reject), which is why this is a separate change from #1615.
Happy to pick this up.
- Dominant language
- Java
- Stars
- 2.4k
- Forks
- 952
- Avg merge
- 3d 6h
- Merged PRs (30d)
- 32
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from FasterXML/jackson-core
-
Concurrent `BufferRecycler.releaseToPool()` calls can return the same recycler more than oncePossibly taken @Dongnyoung claimed this 5 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 70/100
FasterXML/jackson-core#1824 ·
Maintainers usually reply within 1 day
-
`UTF8DataInputJsonParser` reports end-of-input as `JacksonIOException` instead of `UnexpectedEndOfInputException`Possibly taken @curforever claimed this 34 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 57/100
FasterXML/jackson-core#1761 · 1 reaction ·
Maintainers usually reply within 1 day
-
3.4
Difficulty 5/5 Over a week Newbie friendliness 38/100
FasterXML/jackson-core#1740 · 5 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
`maxStringLength` is not enforced when skipping String valuesPossibly taken @Dongnyoung claimed this 39 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 75/100
FasterXML/jackson-core#1735 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Consider validating raw unpaired UTF-16 surrogates in ReaderBasedJsonParserPossibly taken @nvsaigokul-sudo claimed this 7 days ago. Open
Difficulty 5/5 Over a week Newbie friendliness 35/100
FasterXML/jackson-core#1705 · 5 comments · 1 reaction ·
Maintainers usually reply within 1 day
All issues in FasterXML/jackson-core
Similar issues
-
Cleanup: restore the interrupt flag in AiFailureAnalyzerPossibly taken @Rishankgupta08 claimed this today. Opengood first issue
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
seleniumboot/selenium-boot#258 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
dense-analysis/ale#5181 ·
-
bug subsystem:agent-harness triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
ShaftHQ/SHAFT_ENGINE#8043 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
johanhaleby/occurrent#1505 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day