add TODOs

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1311097 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2012-04-08 20:44:58 +00:00
parent 78b4be5dc6
commit b5103519f0
2 changed files with 12 additions and 0 deletions

View File

@ -40,10 +40,18 @@ public class OffsetAttributeImpl extends AttributeImpl implements OffsetAttribut
/** Set the starting and ending offset.
@see #startOffset() and #endOffset()*/
public void setOffset(int startOffset, int endOffset) {
// TODO: we could assert that this is set-once, ie,
// current values are -1? Very few token filters should
// change offsets once set by the tokenizer... and
// tokenizer should call clearAtts before re-using
// OffsetAtt
// TODO: check that these are valid! IE, each should be
// >= 0, and endOffset should be >= startOffset.
// Problem is this could "break" existing
// tokenizers/filters.
this.startOffset = startOffset;
this.endOffset = endOffset;
}
@ -59,6 +67,8 @@ public class OffsetAttributeImpl extends AttributeImpl implements OffsetAttribut
@Override
public void clear() {
// TODO: we could use -1 as default here? Then we can
// assert in setOffset...
startOffset = 0;
endOffset = 0;
}

View File

@ -439,6 +439,8 @@ public abstract class BaseTokenStreamTestCase extends LuceneTestCase {
try {
checkAnalysisConsistency(random, a, useCharFilter, text);
} catch (Throwable t) {
// TODO: really we should pass a random seed to
// checkAnalysisConsistency then print it here too:
System.err.println("TEST FAIL: useCharFilter=" + useCharFilter + " text='" + escape(text) + "'");
Rethrow.rethrow(t);
}