Copilot commented on code in PR #957: URL: https://github.com/apache/fesod/pull/957#discussion_r3652273138
########## fesod-sheet/src/test/java/org/apache/fesod/sheet/style/ContentStyleDataFormatPollutionTest.java: ########## @@ -0,0 +1,147 @@ +/* + * 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.style; + +import java.io.File; +import java.util.Arrays; +import java.util.List; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.fesod.sheet.FesodSheet; +import org.apache.fesod.sheet.annotation.ExcelProperty; +import org.apache.fesod.sheet.annotation.write.style.ContentStyle; +import org.apache.fesod.sheet.enums.CacheLocationEnum; +import org.apache.fesod.sheet.metadata.data.DataFormatData; +import org.apache.fesod.sheet.testkit.assertions.ExcelAssertions; +import org.apache.fesod.sheet.testkit.base.AbstractExcelTest; +import org.apache.fesod.sheet.testkit.enums.ExcelFormat; +import org.apache.fesod.sheet.write.metadata.style.WriteCellStyle; +import org.apache.fesod.sheet.write.style.HorizontalCellStyleStrategy; +import org.junit.jupiter.api.Test; + +/** + * A registered cell style strategy must not overwrite the cached {@link ContentStyle#dataFormat()} + * of a field. Before the fix, {@code WriteCellStyle.merge} aliased the annotation's shared + * {@link DataFormatData} into the per-cell style without cloning, so a later merge from another + * style source mutated the cached annotation format in place and subsequent cells (or, with + * {@link CacheLocationEnum#MEMORY}, subsequent writes) silently lost the annotation's number format. + */ +public class ContentStyleDataFormatPollutionTest extends AbstractExcelTest { Review Comment: Test classes in this module consistently declare a JUnit `@Tag` (e.g., @Tag(Tags.ROUND_TRIP) in StyleDataTest / FillStyleDataTest). This new integration-style test writes and reads a real file but is currently untagged, which makes it harder to include/exclude in the suite via tag filters. -- 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]
