Fix resource leaks in core file processing classes

- Add try-with-resources for FileInputStream in ZUGFeRDVisualizer
- Fix unclosed InputStream in ZUGFeRDInvoiceImporter with try-with-resources
- Add explicit close() call for XMLWriter in ZUGFeRDValidator
- Properly close DataInputStream in ZUGFeRDExporterFromPDFA
- Fix resource management in Main.convertInputStreamToString
This commit is contained in:
Ivan Pereverziev
2025-03-13 11:26:35 +01:00
parent 5e511acf3c
commit 7fa2d70128
6 changed files with 31 additions and 25 deletions

View File

@@ -301,6 +301,7 @@ public class ZUGFeRDValidator {
XMLWriter writer = new XMLWriter(sw, format);
try {
writer.write(document);
writer.close();
} catch (Exception e) {
LOGGER.error(e.getMessage());
}