skytin1004 commented on code in PR #899:
URL: https://github.com/apache/fesod/pull/899#discussion_r3166882252
##########
fesod-sheet/src/main/java/org/apache/fesod/sheet/write/metadata/holder/WriteSheetHolder.java:
##########
@@ -47,7 +47,7 @@
*/
@Getter
@Setter
-@EqualsAndHashCode
+@EqualsAndHashCode(exclude = {"parentWriteWorkbookHolder",
"hasBeenInitializedTable"})
Review Comment:
This excludes the sheet's parent workbook holder from `equals/hashCode`,
which makes sense. But I still see a `StackOverflowError` when I run the new
test locally.
The remaining loop seems to be:
`WriteWorkbookHolder.hashCode()` -> `WorkbookWriteHandlerContext.hashCode()`
-> `WriteWorkbookHolder.hashCode()`
Could you check this path too?
##########
fesod-sheet/src/test/java/org/apache/fesod/sheet/converter/ZonedDateTimeConverterTest.java:
##########
@@ -0,0 +1,111 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.fesod.sheet.converter;
+
+import java.io.ByteArrayOutputStream;
+import java.math.BigDecimal;
+import java.time.ZoneId;
+import java.time.ZonedDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.List;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.fesod.sheet.FesodSheet;
+import org.apache.fesod.sheet.annotation.ExcelProperty;
+import org.apache.fesod.sheet.annotation.format.DateTimeFormat;
+import org.apache.fesod.sheet.annotation.format.NumberFormat;
+import org.apache.fesod.sheet.converters.Converter;
+import org.apache.fesod.sheet.enums.CellDataTypeEnum;
+import org.apache.fesod.sheet.metadata.GlobalConfiguration;
+import org.apache.fesod.sheet.metadata.data.WriteCellData;
+import org.apache.fesod.sheet.metadata.property.ExcelContentProperty;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+public class ZonedDateTimeConverterTest {
+
+ @Test
+ void writePojoWithZonedDateTimeAndCustomConverter() {
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ MixedMetadataRow row = new MixedMetadataRow();
+ row.setStatus("ACTIVE");
+ row.setAmount(new BigDecimal("1234.5"));
+ row.setCreatedAt(ZonedDateTime.of(2026, 3, 24, 15, 30, 45, 0,
ZoneId.of("Asia/Shanghai")));
+
+ Assertions.assertDoesNotThrow(() -> FesodSheet.write(out,
MixedMetadataRow.class)
Review Comment:
I ran this test locally with `-Dmaven.test.skip=false`, but it still fails
with `StackOverflowError`.
So this is a good reproducer, but the current fix does not make it pass yet.
--
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]