nkuprins opened a new pull request, #965: URL: https://github.com/apache/fesod/pull/965
## Purpose of the pull request Closed: #955 ## What's changed? An `.xlsx` cell whose `t` attribute isn't a recognized type (`s`, `str`, `inlineStr`, `e`, `b`, `n`) made `CellDataTypeEnum.buildFromCellType` return `null`, which `CellTagHandler` passed straight into `new ReadCellData<>(type)`, leading to `IllegalArgumentException: Type can not be null`, which names neither the cell nor the attribute. `CellTagHandler.startElement` now detects the `null` and throws an `ExcelAnalysisException` that names the type and the cell: ```java Invalid cell data type: 'unknown' in cell B4 ``` Following the discussion with @bengbengbalabalabeng on the issue, the check lives in the handler (rather than centralised in `CellDataTypeEnum.buildFromCellType`), so the message can point at the exact cell. And `CellDataTypeEnum.buildFromCellType` Javadoc now documents that it may return `null` for an unrecognised type. Covered by `CellTagHandlerTest`. ## Checklist - [x] I have read the [Contributor Guide](https://fesod.apache.org/community/contribution/). - [x] I have written the necessary doc or comment. - [x] I have added the necessary unit tests and all cases have passed. -- 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]
