Fix some warnings with try-with-resources

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1648736 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2014-12-31 17:10:31 +00:00
parent 2d422a995a
commit 994c32db1a
4 changed files with 2 additions and 2 deletions

View File

@ -129,7 +129,6 @@ public class ReutersContentSource extends ContentSource {
while ((line = reader.readLine()) != null) { while ((line = reader.readLine()) != null) {
bodyBuf.append(line).append(' '); bodyBuf.append(line).append(' ');
} }
reader.close();
addBytes(Files.size(f)); addBytes(Files.size(f));

View File

@ -32,6 +32,7 @@ import org.apache.lucene.benchmark.byTask.tasks.TaskSequence;
/** /**
* Test algorithm, as read from file * Test algorithm, as read from file
*/ */
@SuppressWarnings("try")
public class Algorithm implements AutoCloseable { public class Algorithm implements AutoCloseable {
private TaskSequence sequence; private TaskSequence sequence;

View File

@ -111,6 +111,7 @@ public class TestPerfTasksParse extends LuceneTestCase {
} }
/** Test the parsing of example scripts **/ /** Test the parsing of example scripts **/
@SuppressWarnings("try")
public void testParseExamples() throws Exception { public void testParseExamples() throws Exception {
// hackedy-hack-hack // hackedy-hack-hack
boolean foundFiles = false; boolean foundFiles = false;

View File

@ -80,7 +80,6 @@ public class LikeThisQueryBuilder implements QueryBuilder {
stopWordsSet.add(termAtt.toString()); stopWordsSet.add(termAtt.toString());
} }
ts.end(); ts.end();
ts.close();
} catch (IOException ioe) { } catch (IOException ioe) {
throw new ParserException("IoException parsing stop words list in " throw new ParserException("IoException parsing stop words list in "
+ getClass().getName() + ":" + ioe.getLocalizedMessage()); + getClass().getName() + ":" + ioe.getLocalizedMessage());