remove 2 nocommits, add 1

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene4547@1439721 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2013-01-29 00:40:14 +00:00
parent 38a1db697a
commit 905cf63c0e
2 changed files with 4 additions and 11 deletions

View File

@ -110,20 +110,10 @@ public abstract class SortedDocValues extends BinaryDocValues {
} else if (cmp > 0) {
high = mid - 1;
} else {
// nocommit: we shouldnt have to set spare at all if its actually a spare, but its not!
// ant test -Dtestcase=TestFieldCacheRewriteMethod -Dtests.method=testRegexps -Dtests.seed=AFC4A08B212CE143 -Dtests.slow=true -Dtests.locale=th -Dtests.timezone=Canada/Mountain -Dtests.file.encoding=ISO-8859-1
spare.bytes = BytesRef.EMPTY_BYTES;
spare.offset = 0;
spare.length = 0;
return mid; // key found
}
}
// nocommit: we shouldnt have to set spare at all if its actually a spare, but its not!
// ant test -Dtestcase=TestFieldCacheRewriteMethod -Dtests.method=testRegexps -Dtests.seed=AFC4A08B212CE143 -Dtests.slow=true -Dtests.locale=th -Dtests.timezone=Canada/Mountain -Dtests.file.encoding=ISO-8859-1
spare.bytes = BytesRef.EMPTY_BYTES;
spare.offset = 0;
spare.length = 0;
return -(low + 1); // key not found.
}
}

View File

@ -42,6 +42,10 @@ public class SortedDocValuesTermsEnum extends TermsEnum {
if (ord >= 0) {
currentOrd = ord;
term.offset = 0;
// nocommit is there cleaner way ...
// term.bytes may be pointing to codec-private byte[]
// storage, so we must force new byte[] allocation:
term.bytes = new byte[text.length];
term.copyBytes(text);
return SeekStatus.FOUND;
} else {
@ -60,7 +64,6 @@ public class SortedDocValuesTermsEnum extends TermsEnum {
public boolean seekExact(BytesRef text, boolean useCache) throws IOException {
int ord = values.lookupTerm(text, term);
if (ord >= 0) {
term.copyBytes(text);
currentOrd = ord;
return true;
} else {