use IWC's codecprovider consistently for all operations

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1149319 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2011-07-21 19:08:28 +00:00
parent 7fb6c2ecfe
commit cf1120f744
1 changed files with 2 additions and 2 deletions

View File

@ -114,12 +114,12 @@ public final class IndexUpgrader {
}
public void upgrade() throws IOException {
if (!IndexReader.indexExists(dir)) {
if (!IndexReader.indexExists(dir, iwc.getCodecProvider())) {
throw new IndexNotFoundException(dir.toString());
}
if (!deletePriorCommits) {
final Collection<IndexCommit> commits = IndexReader.listCommits(dir);
final Collection<IndexCommit> commits = DirectoryReader.listCommits(dir, iwc.getCodecProvider());
if (commits.size() > 1) {
throw new IllegalArgumentException("This tool was invoked to not delete prior commit points, but the following commits were found: " + commits);
}