Skip to content
Snippets Groups Projects
Commit 071da287 authored by Leonard Kupper's avatar Leonard Kupper
Browse files

Add try with resource.

parent 9ec2bab3
No related branches found
No related tags found
1 merge request!28Bug/jar resource handling 49
......@@ -23,11 +23,8 @@ public class PropertiesParser extends AbstractBrailleTableParser {
public PropertiesParser(final String filePath) {
Objects.requireNonNull(filePath);
InputStream stream;
try {
stream = new GeneralResource(filePath).getInputStream(); // use input stream (jar resource) instead of file input stream.
try (InputStream stream = new GeneralResource(filePath).getInputStream()) { // use input stream (jar resource) instead of file input stream.
mProperties.load(stream);
stream.close();
} catch (java.io.IOException e) {
throw new RuntimeException(e);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment