lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENE-1926) Back compat break with old next() consumer API
Date Fri, 25 Sep 2009 15:27:16 GMT

    [ https://issues.apache.org/jira/browse/LUCENE-1926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12759573#action_12759573
] 

Uwe Schindler commented on LUCENE-1926:
---------------------------------------

bq. Uwe, yes. I expect that if I added a stemmer, or reversetokenfilter, or something it would
modify my termAttribute. What i didnt expect is that the back compat layer would modify my
termAttribute.

OK, but this was the same with next(Token) (see above). You could not rely on the fact that
the reusableToken is preserved, it could even be changed by the consumer or whatever.

You can implement you TokenFilter with next(reusableToken) and will have the same problems
if you rely on the reusableToken is preserved from the last call.

> Back compat break with old next() consumer API
> ----------------------------------------------
>
>                 Key: LUCENE-1926
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1926
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Analysis
>    Affects Versions: 2.9
>            Reporter: Robert Muir
>         Attachments: CaptureStateTestcase.java
>
>
> There is a bug that causes tokenstreams to return different results, depending upon whether
they are consumed with the incrementToken() api or the next() api.
> I found this because the Solr analysis tool in the admin page uses the next() api, and
i was seeing strange results.
> I've created a test case to show the problem. when calling captureState(),  the current
state is erased, but only when consuming with the next() api.
> If I consume with incrementToken(), things work. 
> {code}
> State tempState = captureState(); // after we capture state here, things get strange.
> String right = termAtt.term(); // when using old consumer API, this value is wrong!!!!
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message