LUCENE-2944: fix java6 oops and add proper consumer behavior to NTS reflection

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1083788 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2011-03-21 14:03:22 +00:00
parent e67bf6b089
commit 99c13a4e29
2 changed files with 3 additions and 3 deletions

View File

@ -186,7 +186,7 @@ public final class NumericTokenStream extends TokenStream {
@Override
public void reflectWith(AttributeReflector reflector) {
fillBytesRef();
reflector.reflect(TermToBytesRefAttribute.class, "bytes", bytes);
reflector.reflect(TermToBytesRefAttribute.class, "bytes", new BytesRef(bytes));
reflector.reflect(NumericTermAttribute.class, "shift", shift);
reflector.reflect(NumericTermAttribute.class, "rawValue", getRawValue());
reflector.reflect(NumericTermAttribute.class, "valueSize", valueSize);

View File

@ -79,12 +79,12 @@ public class CharTermAttributeImpl extends AttributeImpl implements CharTermAttr
// *** TermToBytesRefAttribute interface ***
private BytesRef bytes = new BytesRef(MIN_BUFFER_SIZE);
@Override
// not until java 6 @Override
public int fillBytesRef() {
return UnicodeUtil.UTF16toUTF8WithHash(termBuffer, 0, termLength, bytes);
}
@Override
// not until java 6 @Override
public BytesRef getBytesRef() {
return bytes;
}