Fix constant to not use the default codec name since it can change in tests

This commit is contained in:
Simon Willnauer 2014-11-05 22:10:36 +01:00
parent 610ce078fb
commit 687705364d
2 changed files with 2 additions and 2 deletions

View File

@ -61,7 +61,7 @@ public class Lucene {
public static final Version QUERYPARSER_VERSION = VERSION;
public static final String LATEST_DOC_VALUES_FORMAT = "Lucene50";
public static final String LATEST_POSTINGS_FORMAT = "Lucene50";
public static final String LATEST_CODEC = Codec.getDefault().getName();
public static final String LATEST_CODEC = "Lucene50";
static {
Deprecated annotation = PostingsFormat.forName(LATEST_POSTINGS_FORMAT).getClass().getAnnotation(Deprecated.class);

View File

@ -46,7 +46,7 @@ public class PerFieldMappingPostingFormatCodec extends Lucene50Codec {
private final DocValuesFormat defaultDocValuesFormat;
static {
assert Codec.forName(Lucene.LATEST_CODEC).getClass().isAssignableFrom(PerFieldMappingPostingFormatCodec.class) : "PerFieldMappingPostingFormatCodec must subclass default codec";
assert Codec.forName(Lucene.LATEST_CODEC).getClass().isAssignableFrom(PerFieldMappingPostingFormatCodec.class) : "PerFieldMappingPostingFormatCodec must subclass the latest lucene codec: " + Lucene.LATEST_CODEC;
}
public PerFieldMappingPostingFormatCodec(MapperService mapperService, PostingsFormat defaultPostingFormat, DocValuesFormat defaultDocValuesFormat, ESLogger logger) {