Skip to content

Commit 0ee985e

Browse files
committed
resolves error from unit testing on Windows
1 parent b99a050 commit 0ee985e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/denoptim/io/IteratingAtomContainerReader.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,10 @@ public IteratingAtomContainerReader(File input)
7676
FormatFactory factory = new FormatFactory();
7777
factory.registerFormat(new SMILESListFormat());
7878

79-
IChemFormat chemFormat = factory.guessFormat(
80-
new BufferedReader(new FileReader(input)));
79+
BufferedReader headReader = new BufferedReader(new FileReader(input));
80+
IChemFormat chemFormat = factory.guessFormat(headReader);
81+
headReader.close();
82+
8183
if (chemFormat instanceof MDLV2000Format
8284
|| chemFormat instanceof MDLV3000Format)
8385
{

0 commit comments

Comments
 (0)