fix test bug (and fix IWC to fail immediately if you do this)

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene4547@1439519 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2013-01-28 17:41:21 +00:00
parent dc57c8eb7c
commit 4cfc012bfa
3 changed files with 7 additions and 1 deletions

View File

@ -288,6 +288,9 @@ public final class IndexWriterConfig extends LiveIndexWriterConfig implements Cl
* Only takes effect when IndexWriter is first created.
*/
public IndexWriterConfig setCodec(Codec codec) {
if (codec == null) {
throw new NullPointerException();
}
this.codec = codec;
return this;
}

View File

@ -116,6 +116,9 @@ public class LiveIndexWriterConfig {
writeLockTimeout = IndexWriterConfig.WRITE_LOCK_TIMEOUT;
indexingChain = DocumentsWriterPerThread.defaultIndexingChain;
codec = Codec.getDefault();
if (codec == null) {
throw new NullPointerException();
}
infoStream = InfoStream.getDefault();
mergePolicy = new TieredMergePolicy();
flushPolicy = new FlushByRamOrCountsPolicy();

View File

@ -55,8 +55,8 @@ public class TestPerFieldDocValuesFormat extends BaseDocValuesFormatTestCase {
@Override
public void setUp() throws Exception {
super.setUp();
codec = new RandomCodec(new Random(random().nextLong()), Collections.<String>emptySet());
super.setUp();
}
@Override