pjfanning opened a new pull request, #1427:
URL: https://github.com/apache/poi/pull/1427

   Makes `getFormat(double, int, String, boolean)` and `createFormat(double, 
int, String)` in `DataFormatter` protected, with javadoc and `@since 6.0.0`.
   
   This lets a subclass change the `Format` used for some format strings and 
leave everything else to `DataFormatter`. Today the only hooks are 
`formatRawCellContents` and `addFormat`, so a subclass has to take over whole 
formats itself. The motivating case is Apache Fesod, which has its own copy of 
`DataFormatter` with fixes for some formats, mainly Chinese date formats. With 
these hooks it could extend POI's class and keep only its overrides.
   
   - `getFormat(Cell, ConditionalFormattingEvaluator)` stays private. It calls 
the value-based `getFormat`, so an override also applies to `formatCellValue`.
   - The javadoc notes that both methods can return null (the value is then 
shown with `String.valueOf`), and that for date formats the returned `Format` 
is given a `java.util.Date`.
   - Two new tests in `TestDataFormatter` override each method in a subclass.
   
   No behaviour change. `TestDataFormatter` and `TestHSSFDataFormatter` pass.
   
   🤖 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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to