reader should be closed after use

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@791246 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2009-07-05 14:01:14 +00:00
parent b0873e4476
commit 9789089343
1 changed files with 19 additions and 14 deletions

View File

@ -65,6 +65,7 @@ public class FileBasedQueryMaker extends AbstractQueryMaker implements QueryMake
}
}
if (reader != null) {
try {
BufferedReader buffered = new BufferedReader(reader);
String line = null;
int lineNum = 0;
@ -83,9 +84,13 @@ public class FileBasedQueryMaker extends AbstractQueryMaker implements QueryMake
}
lineNum++;
}
} finally {
reader.close();
}
} else {
System.err.println("No Reader available for: " + fileName);
}
}
Query [] result = (Query[]) qq.toArray(new Query[qq.size()]) ;
return result;