[Bug] Writing multiple sheets to CSV silently drops unflushed rows
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 88/100
Línea de trabajo
Comience en CsvWorkbook#createSheet en las líneas 172-182 y 270-273; después, inspeccione CsvWorkbook#write y CsvSheet alrededor de las líneas 659-665. Reproduzca el problema mediante la API pública de ExcelWriter y añada una prueba de regresión. Se considera terminado cuando crear una segunda hoja CSV lógica provoca una excepción en tiempo de ejecución antes de que puedan perderse las filas almacenadas en búfer.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Fesod version
Current main at 5a9a16b.
Description
Writing two distinct WriteSheet instances through one CSV ExcelWriter succeeds without an exception, but rows buffered by the earlier sheet are silently discarded.
Location
fesod-sheet/src/main/java/org/apache/fesod/sheet/metadata/csv/CsvWorkbook.java:172-182fesod-sheet/src/main/java/org/apache/fesod/sheet/metadata/csv/CsvWorkbook.java:270-273fesod-sheet/src/main/java/org/apache/fesod/sheet/metadata/csv/CsvSheet.java:659-665
CsvWorkbook#createSheet uses assert csvSheet == null to enforce the single-sheet CSV contract. Assertions are disabled in normal JVM runs, so a second sheet replaces the only csvSheet reference. CsvWorkbook#write then closes and flushes only the replacement sheet.
Reproduction
try (ExcelWriter writer = FesodSheet.write(file)
.excelType(ExcelTypeEnum.CSV)
.build()) {
writer.write(Collections.singletonList(Collections.singletonList("first-row")),
FesodSheet.writerSheet(0).build());
writer.write(Collections.singletonList(Collections.singletonList("second-row")),
FesodSheet.writerSheet(1).build());
}
The resulting CSV contains only second-row. With 101 rows in the first sheet, the first 100 rows are flushed, row 101 is lost, and the second sheet is appended. No exception is raised.
Expected behavior
CSV should reject creation of a second logical sheet with a normal runtime exception before any data can be lost.
Suggested fix
Replace the assert checks in both createSheet overloads with an explicit guard and add a regression test through the public writer API.
Related existing work
Issue #103 concerns parallel writing of multiple Excel sheets. It does not cover CSV silently discarding buffered rows.
Are you willing to submit a PR?
Yes.
- Lenguaje dominante
- Java
- Estrellas
- 6.3k
- Forks
- 545
- Merge medio
- 2 d 22 h
- PR fusionados (30 d)
- 41
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/fesod
-
[Enhancement] Allow static imports in test sources so AssertJ is usablePosiblemente ocupada @qiaolezi001 la tomó hoy. Abiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 69/100
apache/fesod#1267 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
[Task] mvnw.cmd always shows as modified after cloningPosiblemente ocupada @yebuguntang la tomó hace 4 días. Abiertodiscussion welcome help wanted
Dificultad 1/5 Menos de una hora Aptitud para principiantes 91/100
Los mantenedores suelen responder en 1 día
-
discussion welcome security waiting for feedback
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
apache/fesod#1184 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
[Bug] xlsx stream write leaves temp filePosiblemente ocupada @nkuprins la tomó hace 21 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
apache/fesod#1137 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
[Bug] A cell read into a ReadCellData field loses its row and column indexPosiblemente ocupada @CodeMan-cmd la tomó hace 36 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
apache/fesod#1131 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de apache/fesod
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
quarkiverse/quarkus-google-cloud-services#1188 ·
Los mantenedores suelen responder en 1 día
-
Component: Frontend Component: Web Component Type: Maintenance
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
it-at-m/refarch-templates#1944 ·
Los mantenedores suelen responder en 2 días
-
priority: p2 type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
googleapis/java-genai#1372 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 60/100
-
GeoSeries scale and skew tests fail with pytest 9.2.0Posiblemente ocupada @jiayuasu la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día