sxssf workbook dispose no longer needed

This commit is contained in:
PJ Fanning 2025-07-11 19:50:51 +01:00
parent fa9428511a
commit 1eee67fb8b
2 changed files with 10 additions and 8 deletions

View File

@ -53,12 +53,13 @@ public class DeferredGeneration {
try (FileOutputStream fileOut = new FileOutputStream("DeferredGeneration.xlsx")) {
wb.write(fileOut);
//writeAvoidingTempFiles was added as an experimental change in POI 5.1.0
//wb.writeAvoidingTempFiles(fileOut);
} finally {
//the dispose call is necessary to ensure temp files are removed
wb.dispose();
// writeAvoidingTempFiles was added as an experimental change in POI 5.1.0
// wb.writeAvoidingTempFiles(fileOut);
}
// finally {
// the dispose call is no longer necessary to ensure temp files are removed
// wb.dispose();
// }
System.out.println("wrote DeferredGeneration.xlsx");
}
}

View File

@ -46,10 +46,11 @@ public class Outlining {
try (FileOutputStream fileOut = new FileOutputStream("outlining_collapsed.xlsx")) {
wb2.write(fileOut);
} finally {
//the dispose call is necessary to ensure temp files are removed
wb2.dispose();
}
// finally {
// the dispose call is no longer necessary to ensure temp files are removed
// wb2.dispose();
// }
}
}
}