Satwik-Bhardwaj opened a new pull request, #967:
URL: https://github.com/apache/poi/pull/967
### Summary
This PR addresses the issue of silent sheet name truncation caused by the
**Apache POI 31-character limit** (referenced in #966).
The primary goal is to provide immediate feedback to users when they attempt
to retrieve a sheet using a name that exceeds this limit, preventing unexpected
`null` return values without modifying the core sheet retrieval API.
### Changes Implemented
* **Logging Added:** Introduced a logging mechanism (at the `WARN` level)
that triggers whenever a sheet name passed to the retrieval method exceeds 31
characters.
* The warning explicitly informs the user that the name will be
truncated by POI and that they must use the truncated name to ensure successful
retrieval.
* **Documentation Update:** Updated the Javadoc/method comments for the
affected method(s) to clearly document the 31-character limitation and the
potential for a `null` return if the input name is too long.
* **Test Case Included:** Added a new unit test
(`searchSheetExceed31CharactersName`) to verify that the sheet must be null if
the name exceeds 31 character limits.
### Testing
I have validated these changes locally and included a dedicated test case.
The core functionality of retrieving sheets with valid names remains unchanged.
### Feedback Requested
I am open to any suggestions, particularly regarding the verbosity or
logging level of the new warning message, as well as the clarity of the updated
method comments. Please let me know if any further changes are required before
merging.
--
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]