FasterXML / FasterXML/jackson-dataformats-binary

(smile) `SmileGenerator.writeNumber(String)` validates number length against default `StreamReadConstraints` instead of configured ones

Open Beginner friendly
#781 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
347
Forks
156
Avg merge
3d 3h
Merged PRs (30d)
22

Description

\`SmileGenerator._writeIntegralNumber()\` / \`_writeDecimalNumber()\` (used by \`writeNumber(String)\`) guard against too-long number Strings via \`_streamReadConstraints().validateIntegerLength()\` / \`validateFPLength()\`.

But \`_streamReadConstraints()\` returns \`StreamReadConstraints.defaults()\`, so a \`maxNumberLength\` configured on the \`SmileFactory\` is ignored on the write path — both a lower limit (not enforced) and a higher limit (spuriously rejected).

Since \`IOContext\` carries the factory's \`StreamReadConstraints\` (2.15+), the generator can use \`_ioContext.streamReadConstraints()\` instead.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in SmileGenerator at _writeIntegralNumber(), _writeDecimalNumber(), and _streamReadConstraints(), then inspect how IOContext carries constraints from SmileFactory. Verify writeNumber(String) with configured lower and higher maxNumberLength values, and add or run regression tests showing that the configured limit, rather than the default, determines acceptance.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.