1
0
Fork 0
mirror of https://github.com/ethauvin/version-processor.git synced 2025-04-24 23:47:11 -07:00

Fixed property file left open after reading.

This commit is contained in:
Erik C. Thauvin 2016-01-16 17:20:39 -08:00
parent c84e4dcd49
commit 5e5a8ce059

View file

@ -79,8 +79,10 @@ public class VersionProcessor extends AbstractProcessor {
if (f.exists()) { if (f.exists()) {
log("Found " + f); log("Found " + f);
Properties p = new Properties(); Properties p = new Properties();
p.load(new FileReader(f)); FileReader r = new FileReader(f);
p.load(r);
String result = p.getProperty(version.propertyName()); String result = p.getProperty(version.propertyName());
r.close();
return result; return result;
} else { } else {
error("Couldn't find " + version.fileName()); error("Couldn't find " + version.fileName());
@ -90,6 +92,7 @@ public class VersionProcessor extends AbstractProcessor {
return null; return null;
} }
@Override
public Set<String> getSupportedAnnotationTypes() { public Set<String> getSupportedAnnotationTypes() {
Set<String> result = new HashSet<>(); Set<String> result = new HashSet<>();
result.add(Version.class.getCanonicalName()); result.add(Version.class.getCanonicalName());