psiby opened a new pull request, #23496:
URL: https://github.com/apache/kafka/pull/23496

   `SimpleHeaderConverter` deserializes header values via `Values.parseString`, 
which infers a type from the first token only. A top-level value like `1::2` 
was parsed as the number `1`, silently dropping `::2`.
   
   The parser already guards against this for the `null`/`true`/`false` 
literals: `canParseSingleTokenLiteral` only accepts a literal when it is 
embedded or consumes the entire input. The number branch in `parseNextToken` 
had no equivalent guard.
   
   Fix: only treat a token as a number when `embedded || !parser.hasNext()`, so 
a non-embedded value that leaves trailing tokens falls back to a string. 
Embedded values (array/map elements) are unaffected.
   
   Tests:
   - `ValuesTest.shouldParseStringsBeginningWithNumberAsStrings` — 
`parseString("1::2")` returns `(STRING, "1::2")`.
   - 
`SimpleHeaderConverterTest.shouldConvertStringBeginningWithDigitFollowedByDelimiters`
 — round-trips `"1::2"` as a string.
   
   JIRA: https://issues.apache.org/jira/browse/KAFKA-20892
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to