test(dijkstra): correct pathReader close placement

This commit is contained in:
Paul Alnet 2024-05-17 08:39:13 +02:00
parent bbd6fac17f
commit 0cfdaf1ef2

View file

@ -47,11 +47,12 @@ public class DijkstraAlgorithmTest {
// Create a PathReader.
final PathReader pathReader = new BinaryPathReader(new DataInputStream(new BufferedInputStream(new FileInputStream(pathName))));
// free resources
pathReader.close();
// Read the path.
path = pathReader.readPath(graph);
// free resources
pathReader.close();
}
catch (FileNotFoundException e) {
System.err.println("File not found: " + e.getMessage());