Repository navigation
Conversation
…e#1098) ConverterUtils.convertToStringMap resolved the converter for header cells through the holder's converter map, which also carries user registrations, so a user-registered Converter<String> rewrote the header text itself: "flag" became "FLAG", @ExcelProperty name matching failed, and the field was silently left null (the data cell was not converted either). The header path now uses the built-in read converters only; the data-cell path is untouched. ConverterUtilsTest is updated to the new contract: the convertToStringMap tests now assert that a user registration under the same key is not consulted, and the missing-converter case uses DATE, which has no built-in (String, DATE) converter (BOOLEAN does). invokeHeadMap now receives the raw header map, as settled in apache#1098.
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.
Fixes #1098
What changes were proposed in this pull request?
ConverterUtils.convertToStringMapturns header cells into strings for two consumers: the name matching inDefaultAnalysisEventProcessor.buildHeadand the map handed toAnalysisEventListener.invokeHeadMap. It resolved the converter through the holder's converter map, which also carries user registrations — so a user-registeredConverter<String>was applied to the header text itself: the headerflagbecameFLAG,@ExcelProperty("flag")no longer matched, and the field was leftnullwith no exception. The data cell was not converted either.The lookup now uses the built-in read converters (
DefaultConverterLoader.loadDefaultReadConverter()) only. Data cells are still resolved with user converters throughconvertToJavaObject; the write path is untouched.Why
(String, STRING)registration reproduces the failure on currentmain; a wildcardConverter<String>would reach the same path once feat: honor wildcard custom converters when reading #1086 expands wildcard registrations on read.Converter not founderror.Impact
invokeHeadMapnow receives the raw header map — the behaviour change settled in [Bug] Header cells are converted with user-registered String converters, breaking @ExcelProperty(name) matching #1098 ("the header should stay raw text").Converter<String>is covered as well; this is the case feat: honor wildcard custom converters when reading #1086 would otherwise widen into the header path.@ExcelProperty(converter = ...)) and the write path are untouched.How was this patch tested?
New
HeaderConverterIsolationTest(3 tests):STRING-key converter: name matching still works and the data cell is converted (red before the fix: the field wasnull);invokeHeadMapreceives the raw header text (red before the fix:FLAGinstead offlag);ConverterUtilsTestis updated to the new contract: theconvertToStringMaptests now assert that a user registration in the holder's map is not consulted (the mock converter is never invoked), and the missing-converter case uses DATE, which genuinely has no built-in(String, DATE)converter (BOOLEAN does, so it no longer exercised that path).Red/green verified: both failing cases were reproduced against the pre-fix code, then turned green. Full suite: 1047/1047 green; spotless and javadoc pass.
Notes
ConverterUtils; whichever lands second needs a trivial rebase of this one line.