From 0ee985e319b72058eb0c68a4595dfc0a15f57936 Mon Sep 17 00:00:00 2001 From: Marco Foscato Date: Fri, 11 Nov 2022 10:32:06 +0100 Subject: [PATCH] resolves error from unit testing on Windows --- src/main/java/denoptim/io/IteratingAtomContainerReader.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/denoptim/io/IteratingAtomContainerReader.java b/src/main/java/denoptim/io/IteratingAtomContainerReader.java index 54c7bb74a..054fc46ac 100644 --- a/src/main/java/denoptim/io/IteratingAtomContainerReader.java +++ b/src/main/java/denoptim/io/IteratingAtomContainerReader.java @@ -76,8 +76,10 @@ public IteratingAtomContainerReader(File input) FormatFactory factory = new FormatFactory(); factory.registerFormat(new SMILESListFormat()); - IChemFormat chemFormat = factory.guessFormat( - new BufferedReader(new FileReader(input))); + BufferedReader headReader = new BufferedReader(new FileReader(input)); + IChemFormat chemFormat = factory.guessFormat(headReader); + headReader.close(); + if (chemFormat instanceof MDLV2000Format || chemFormat instanceof MDLV3000Format) {