LUCENE-1359: FrenchAnalyzer tokenstream does not honor the contract of Analyzer

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@828298 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2009-10-22 04:03:12 +00:00
parent 1d7866a0b9
commit d1fc6bece6
3 changed files with 3 additions and 22 deletions

View File

@ -41,6 +41,9 @@ Bug fixes
* LUCENE-2001: Wordnet Syns2Index incorrectly parses synonyms that
contain a single quote. (Parag H. Dave via Robert Muir)
* LUCENE-1359: French analyzer did not support null field names.
(Andrew Lynch via Robert Muir)
New features
* LUCENE-1924: Added BalancedSegmentMergePolicy to contrib/misc,

View File

@ -138,10 +138,6 @@ public final class FrenchAnalyzer extends Analyzer {
* {@link FrenchStemFilter} and {@link LowerCaseFilter}
*/
public final TokenStream tokenStream(String fieldName, Reader reader) {
if (fieldName == null) throw new IllegalArgumentException("fieldName must not be null");
if (reader == null) throw new IllegalArgumentException("reader must not be null");
TokenStream result = new StandardTokenizer(reader);
result = new StandardFilter(result);
result = new StopFilter(false, result, stoptable);

View File

@ -34,24 +34,6 @@ public class TestFrenchAnalyzer extends BaseTokenStreamTestCase {
public void testAnalyzer() throws Exception {
FrenchAnalyzer fa = new FrenchAnalyzer();
// test null reader
boolean iaeFlag = false;
try {
fa.tokenStream("dummy", null);
} catch (IllegalArgumentException iae) {
iaeFlag = true;
}
assertEquals(iaeFlag, true);
// test null fieldname
iaeFlag = false;
try {
fa.tokenStream(null, new StringReader("dummy"));
} catch (IllegalArgumentException iae) {
iaeFlag = true;
}
assertEquals(iaeFlag, true);
assertAnalyzesTo(fa, "", new String[] {
});