lucene 4: Fixed compile error

This commit is contained in:
Martijn van Groningen 2012-10-30 11:36:02 +01:00 committed by Shay Banon
parent fcc4fe263e
commit 3269e0c88e
2 changed files with 4 additions and 3 deletions

View File

@ -34,6 +34,7 @@ import org.elasticsearch.index.AbstractIndexComponent;
import org.elasticsearch.index.Index;
import org.elasticsearch.index.cache.id.IdCache;
import org.elasticsearch.index.cache.id.IdReaderCache;
import org.elasticsearch.index.mapper.Uid;
import org.elasticsearch.index.mapper.internal.ParentFieldMapper;
import org.elasticsearch.index.mapper.internal.UidFieldMapper;
import org.elasticsearch.index.settings.IndexSettings;
@ -121,7 +122,7 @@ public class SimpleIdCache extends AbstractIndexComponent implements IdCache, Se
TermsEnum termsEnum = terms.iterator(null);
DocsEnum docsEnum = null;
for (BytesRef term = termsEnum.next(); term != null; term = termsEnum.term()) {
HashedBytesArray[] typeAndId = splitUidIntoTypeAndId(term);
HashedBytesArray[] typeAndId = Uid.splitUidIntoTypeAndId(term);
TypeBuilder typeBuilder = readerBuilder.get(typeAndId[0].toUtf8());
if (typeBuilder == null) {
typeBuilder = new TypeBuilder(reader);
@ -156,7 +157,7 @@ public class SimpleIdCache extends AbstractIndexComponent implements IdCache, Se
TermsEnum termsEnum = terms.iterator(null);
DocsEnum docsEnum = null;
for (BytesRef term = termsEnum.next(); term != null; term = termsEnum.term()) {
HashedBytesArray[] typeAndId = splitUidIntoTypeAndId(term);
HashedBytesArray[] typeAndId = Uid.splitUidIntoTypeAndId(term);
TypeBuilder typeBuilder = readerBuilder.get(typeAndId[0].toUtf8());
if (typeBuilder == null) {

View File

@ -107,7 +107,7 @@ public final class Uid {
}
// LUCENE 4 UPGRADE: HashedBytesArray or BytesRef as return type?
private static HashedBytesArray[] splitUidIntoTypeAndId(BytesRef uid) {
public static HashedBytesArray[] splitUidIntoTypeAndId(BytesRef uid) {
int loc = -1;
for (int i = uid.offset; i < uid.length; i++) {
if (uid.bytes[i] == 0x23) { // 0x23 is equal to '#'