add assert

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1226801 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2012-01-03 15:05:25 +00:00
parent 6fb676d1a2
commit 560ffefcf7
1 changed files with 2 additions and 0 deletions

View File

@ -20,6 +20,7 @@ package org.apache.lucene.util;
import java.io.IOException;
import java.util.Arrays;
import org.apache.lucene.store.CompoundFileDirectory;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.IOContext;
import org.apache.lucene.store.IndexInput;
@ -218,6 +219,7 @@ public final class BitVector implements Cloneable, Bits {
<code>d</code>, in a format that can be read by the constructor {@link
#BitVector(Directory, String, IOContext)}. */
public final void write(Directory d, String name, IOContext context) throws IOException {
assert !(d instanceof CompoundFileDirectory);
IndexOutput output = d.createOutput(name, context);
try {
output.writeInt(-2);