Fix problem with open files on windows (this was not caused by Robert's commits, it just did never happen because GC was faster)...

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1624837 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2014-09-14 11:10:21 +00:00
parent 535454eb25
commit 023f541b51
2 changed files with 7 additions and 2 deletions

View File

@ -32,7 +32,7 @@ import org.apache.lucene.benchmark.byTask.tasks.TaskSequence;
/** /**
* Test algorithm, as read from file * Test algorithm, as read from file
*/ */
public class Algorithm { public class Algorithm implements AutoCloseable {
private TaskSequence sequence; private TaskSequence sequence;
private final String[] taskPackages; private final String[] taskPackages;
@ -359,5 +359,10 @@ public class Algorithm {
} }
} }
@Override
public void close() throws Exception {
sequence.close();
}
} }

View File

@ -133,7 +133,7 @@ public class TestPerfTasksParse extends LuceneTestCase {
config.set("query.maker", MockQueryMaker.class.getName()); config.set("query.maker", MockQueryMaker.class.getName());
} }
PerfRunData data = new PerfRunData(config); PerfRunData data = new PerfRunData(config);
new Algorithm(data); try (Algorithm algo = new Algorithm(data)) {}
foundFiles = true; foundFiles = true;
} }
} }