You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fesod.apache.org by "utafrali (via GitHub)" <gi...@apache.org> on 2026/04/07 17:05:29 UTC
[PR] Fix custom converters not being inherited from parent write holders [fesod]
utafrali opened a new pull request, #893:
URL: https://github.com/apache/fesod/pull/893
## Purpose
Closes #648
## What's changed?
The global custom converters weren't being inherited by child write holders. The parent holder wasn't storing which custom converters it had, so there was nothing to pass down when initializing child holders. Added a `customConverterList` field to track custom converters and updated the initialization logic to apply inherited converters when building the converter map. Also added a test to verify the behavior works correctly.
## Checklist
- [x] Read Contributor Guide
- [x] Documentation/comments added
- [x] Unit tests with passing cases
--
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: commits-unsubscribe@fesod.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For additional commands, e-mail: commits-help@fesod.apache.org
Re: [PR] Fix custom converters not being inherited from parent write holders [fesod]
Posted by "psxjoy (via GitHub)" <gi...@apache.org>.
psxjoy merged PR #893:
URL: https://github.com/apache/fesod/pull/893
--
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: commits-unsubscribe@fesod.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For additional commands, e-mail: commits-help@fesod.apache.org
Re: [PR] Fix custom converters not being inherited from parent write holders [fesod]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #893:
URL: https://github.com/apache/fesod/pull/893#discussion_r3048903230
##########
fesod-sheet/src/test/java/org/apache/fesod/sheet/converter/CustomConverterTest.java:
##########
@@ -83,6 +88,28 @@ void t04Write12() throws Exception {
writeFile(converterExcelFile12);
}
+ @Test
+ void t05GlobalConverterInSheetHolder() throws Exception {
+ TimestampStringConverter timestampStringConverter = new TimestampStringConverter();
+ ExcelWriter excelWriter = FesodSheet.write(converterExcelFile13)
+ .registerConverter(timestampStringConverter)
+ .build();
+ excelWriter.write(data(), new ExcelWriterSheetBuilder().sheetNo(0).build());
+ WriteSheetHolder sheetHolder = excelWriter.writeContext().writeSheetHolder();
+ Map<ConverterKeyBuild.ConverterKey, Converter<?>> sheetConverterMap = sheetHolder.converterMap();
+ excelWriter.finish();
+ Assertions.assertTrue(sheetConverterMap.containsKey(ConverterKeyBuild.buildKey(
+ timestampStringConverter.supportJavaTypeKey(), timestampStringConverter.supportExcelTypeKey())));
+ }
+
+ @Test
+ void t06GlobalConverterWriteWithoutAnnotation() throws Exception {
+ FesodSheet.write(converterCsvFile14)
+ .registerConverter(new TimestampStringConverter())
+ .sheet()
+ .doWrite(globalData());
+ }
Review Comment:
Test name `t06GlobalConverterWriteWithoutAnnotation` is misleading because `GlobalConverterWriteData` uses `@ExcelProperty`. Consider renaming the test to reflect the actual intent (e.g., “without converter annotation” / “without field-level converter config”).
--
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: commits-unsubscribe@fesod.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For additional commands, e-mail: commits-help@fesod.apache.org
Re: [PR] Fix custom converters not being inherited from parent write holders [fesod]
Posted by "utafrali (via GitHub)" <gi...@apache.org>.
utafrali commented on PR #893:
URL: https://github.com/apache/fesod/pull/893#issuecomment-4217755707
Done, pushed the fix.
--
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: commits-unsubscribe@fesod.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For additional commands, e-mail: commits-help@fesod.apache.org