roeniss commented on code in PR #813:
URL: https://github.com/apache/fesod/pull/813#discussion_r2837208078


##########
fesod-examples/fesod-sheet-examples/src/test/java/org/apache/fesod/sheet/temp/issue462/EscapedPlaceholderTest.java:
##########
@@ -0,0 +1,178 @@
+/*
+ * 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.temp.issue462;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.apache.fesod.sheet.FesodSheet;
+import org.apache.fesod.sheet.util.TestFileUtil;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Test case for issue #462: ArrayIndexOutOfBoundsException when placeholder 
content is '{foo\}'
+ *
+ * When a placeholder has an escaped closing brace like {foo\}, the parser 
should handle it
+ * gracefully without throwing an exception.
+ */
+public class EscapedPlaceholderTest {
+
+    private static final String TEMPLATE_PATH = TestFileUtil.getPath() + 
"temp/issue462" + File.separator;
+
+    @BeforeAll
+    public static void createTemplates() throws IOException {
+        // Create template with escaped placeholder {foo\}
+        createTemplate("escaped_suffix.xlsx", "{foo\\}");
+
+        // Create template with escaped prefix \{foo}
+        createTemplate("escaped_prefix.xlsx", "\\{foo}");
+
+        // Create template with normal placeholder for comparison
+        createTemplate("normal.xlsx", "{foo}");
+
+        // Create template with mixed content
+        createTemplate("mixed.xlsx", "prefix {foo\\} suffix");
+    }
+
+    private static void createTemplate(String fileName, String content) throws 
IOException {
+        File templateFile = new File(TEMPLATE_PATH + fileName);

Review Comment:
   @psxjoy I think this feedback doesn't make sense, what do you think?



-- 
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]

Reply via email to