Repository navigation
fix(sheet): match sheet names case-insensitively when reading - #1286
Open
Sean-Walker0 wants to merge 1 commit into
Open
Sean-Walker0 wants to merge 1 commit into
Sean-Walker0 wants to merge 1 commit into
Conversation
Mikkey-f
reviewed
Nov 1, 2026
Mikkey-f
left a comment
Contributor
There was a problem hiding this comment.
Thanks — I verified this on Windows/JDK 17.
Verification
SheetNameCaseInsensitiveReadTestpasses on the PR head; revertingequalsIgnoreCasetoequalsmakes thedata/DATAassertions fail withexpected: <1> but was: <0>, so the test pins the fix.SheetUtilsTeststill passes (7/7), so exact-name and autoStrip/autoTrim paths are unaffected.
One factual correction: the Notes say tabs differing only in case are legal in Excel, but sheet names are case-insensitively unique there — POI validates it too: createSheet("DATA") after createSheet("Data") throws The workbook already contains a sheet named 'DATA'. So that ambiguity is only reachable with a hand-crafted package; worth adjusting the note.
Non-blocking suggestions
- The test covers XLSX only;
SheetUtils.matchis shared by the XLS and CSV executors, so an XLS case through the existing format parameterization would guard the same path. - Minor style: the test uses the fully-qualified
org.apache.fesod.sheet.testkit.enums.ExcelFormat.XLSXinline.
No blocking issues from my side.
Sean-Walker0
force-pushed
the
fix/read-sheet-name-case-insensitive
branch
2 times, most recently
from
November 8, 2026 06:42
125e101 to
ee4d45c
Compare
Contributor
Author
|
Thanks for the verification and the correction — all three points addressed and force-pushed as ee4d45c:
|
Sean-Walker0
force-pushed
the
fix/read-sheet-name-case-insensitive
branch
3 times, most recently
from
November 11, 2026 11:28
05d7277 to
5362b0f
Compare
SheetUtils.match compared the requested sheet name with the workbook's tab name case-sensitively, while the workbook model itself resolves sheet names case-insensitively: POI's Workbook.getSheet (which the write and fill paths use) matches 'data', 'Data' and 'DATA' against a 'Data' tab. Reading the same workbook with the same name variants silently delivered zero rows with no error - the read/write pair behaved differently for the identical request. Compare names ignoring case. The strip/trim handling above the comparison is unchanged, and exact names keep matching as before. Verified with SheetNameCaseInsensitiveReadTest (the lowercase variant reads 0 rows before the change and 1 after; the exact-name and unrelated-name cases are pinned on both sides) plus the existing SheetUtilsTest, the full fesod-sheet suite (1790 tests) and spotless:check.
Sean-Walker0
force-pushed
the
fix/read-sheet-name-case-insensitive
branch
from
November 23, 2026 07:39
5362b0f to
20fecf8
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose of the pull request
SheetUtils.matchcompared the requested sheet name with the workbook's tab name case-sensitively, while the workbook model itself resolves sheet names case-insensitively — POI'sWorkbook.getSheet(String)(which fesod's write and fill paths go through) matchesdata/Data/DATAagainst aDatatab. The same request on the two paths therefore behaved differently:A case-differing read name delivers an empty result with no error, which is easy to hit (constants vs tab names) and hard to notice.
Reproduced on current main:
.sheet("data")and.sheet("DATA")on aDatatab read 0 rows; POI'sgetSheetfinds the tab for both.No issue exists for this yet; found while probing read/write name-matching symmetry.
What's changed?
The name comparison in
SheetUtils.matchignores case. The surrounding strip/trim handling (autoStrip/autoTrimpreprocessing of both names) is unchanged, and exact names keep matching as before. Sheet-number matching is untouched.Checklist
Verifying this change
SheetNameCaseInsensitiveReadTest(one workbook, tabData):red before (
a lowercase variant matches like POI's getSheet ==> expected: <1> but was: <0>);green after:
Data,dataandDATAeach read the row, while an unrelated name still reads 0 rows.Existing
SheetUtilsTest: 7/7 (including the autoStrip name-matching cases)../mvnw clean package -B -Dmaven.test.skip=false -pl fesod-common,fesod-shaded,fesod-sheet: 1790 tests, 0 failures, 0 errors../mvnw -pl fesod-sheet spotless:check: clean.Notes
createSheet), so two tabs differing only in case cannot come from a real workbook - the matching can never be ambiguous for well-formed files; a hand-crafted package is the only way to reach such a pair, where first-match applies like POIgetSheetSheetUtils.