test(dijkstra): correct pathReader close placement
This commit is contained in:
parent
bbd6fac17f
commit
0cfdaf1ef2
1 changed files with 3 additions and 2 deletions
|
@ -47,11 +47,12 @@ public class DijkstraAlgorithmTest {
|
||||||
|
|
||||||
// Create a PathReader.
|
// Create a PathReader.
|
||||||
final PathReader pathReader = new BinaryPathReader(new DataInputStream(new BufferedInputStream(new FileInputStream(pathName))));
|
final PathReader pathReader = new BinaryPathReader(new DataInputStream(new BufferedInputStream(new FileInputStream(pathName))));
|
||||||
// free resources
|
|
||||||
pathReader.close();
|
|
||||||
|
|
||||||
// Read the path.
|
// Read the path.
|
||||||
path = pathReader.readPath(graph);
|
path = pathReader.readPath(graph);
|
||||||
|
|
||||||
|
// free resources
|
||||||
|
pathReader.close();
|
||||||
}
|
}
|
||||||
catch (FileNotFoundException e) {
|
catch (FileNotFoundException e) {
|
||||||
System.err.println("File not found: " + e.getMessage());
|
System.err.println("File not found: " + e.getMessage());
|
||||||
|
|
Loading…
Reference in a new issue