[ https://issues.apache.org/jira/browse/LUCENE-1636?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12709369#action_12709369 ]
Uwe Schindler commented on LUCENE-1636: --------------------------------------- Hi Wouter, I tend to say, this is Won't fix: - You use TokenFilter in an undocumented way. I suspect, that you set the delegate stream later, correct? To prevent this, the protected "input" member should normally be "final", as this is not possible (but worked with old analyzers) - ok, this was an error, to not make the delegate strean final (but we shoudl fix this *now*) - The main problem of changing the non-final delegate stream later lies in the fact, that with 2.9 a new TokenStream API (setUseNewAPI()) was added. This new API does not use the Token class anymore, but uses Attributes. The stream's attributes list must be reused in the TokenFilters. If you initialize a TokenFilter with a specific delegate, the attribute instances are copied. If you change the delegate stream later, the filter still uses the attributes of the original stream and will update the wrong ones, it will not work anymore. So we cannot support this wrong behaviour of TokenFilter anymore. But we should fix the final accessor of "input", I will attach a patch. > TokenFilters with a null value in the constructor fail > ------------------------------------------------------ > > Key: LUCENE-1636 > URL: https://issues.apache.org/jira/browse/LUCENE-1636 > Project: Lucene - Java > Issue Type: Bug > Affects Versions: 2.9 > Reporter: Wouter Heijke > Attachments: LUCENE-1636.patch > > > While migrating from 2.4.x to 2.9-dev I found a lot of failing unittests. > One problem is with TokenFilters that do a super(null) in the constructor. > I fixed it by changing the constructor to super(new EmptyTokenStream()) > This will cause problems and frustration to others while migrating to 2.9. -- 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-unsubscr...@lucene.apache.org For additional commands, e-mail: java-dev-h...@lucene.apache.org