Croway opened a new pull request, #30228:
URL: https://github.com/apache/camel/pull/30228

   JIRA: [CAMEL-27058](https://issues.apache.org/jira/browse/CAMEL-27058)
   
   - In a fixed-length record, `trim = true` on a numeric `@DataField` with 
`paddingChar = '0'` removed every `0` of a field holding `000`, so the value 0 
was read as an empty field: `null` for `Integer`/`BigDecimal`, `MIN_VALUE` for 
`int`/`long`, the `defaultValue` when set, and "mandatory field ... is empty" 
for a `required` field. Marshal writes 0 as `000`, so 0 did not round-trip.
   - `BindyFixedLengthFactory.trim` now keeps `"0"` when trimming the padding 
char `'0'` leaves nothing of a numeric field (primitive or `Number`), so the 
field is parsed as 0 with its own format (precision, implied decimal).
   - Text fields, numeric fields padded with another char, and fields with no 
characters (line too short) keep their behaviour.
   - Docs: `@DataField.trim` description and the "Field padding" section of the 
bindy page.
   
   Tests: `BindyFixedLengthTrimZeroPaddingTest` (9 tests): 4 fail before the 
change (null, `MIN_VALUE`, mandatory-field error), all pass after; 5 controls 
pass both ways. camel-bindy suite green.
   
   Upgrade guide: entry in `camel-4x-upgrade-guide-4_24.adoc` (a zero-padded 
number that is only `0`s is now read as 0).
   
   _Claude Code on behalf of Federico Mariani_
   


-- 
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