You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Uwe Schindler (Issue Comment Edited) (JIRA)" <ji...@apache.org> on 2011/11/14 12:12:51 UTC
[jira] [Issue Comment Edited] (LUCENE-3089) CachingTokenFilter can
cause close() to be called twice.
[ https://issues.apache.org/jira/browse/LUCENE-3089?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13149571#comment-13149571 ]
Uwe Schindler edited comment on LUCENE-3089 at 11/14/11 11:11 AM:
------------------------------------------------------------------
I disagree, removing the Closeable interface makes it stupid to use in Java 7 (try-with-resources).
was (Author: thetaphi):
I disagree, removing the Closeable interface makes it stupid to use in Java 7 (close-with-resources).
> CachingTokenFilter can cause close() to be called twice.
> --------------------------------------------------------
>
> Key: LUCENE-3089
> URL: https://issues.apache.org/jira/browse/LUCENE-3089
> Project: Lucene - Java
> Issue Type: Bug
> Reporter: Robert Muir
>
> In LUCENE-3064, we added some state and checks to MockTokenizer to validate that consumers
> are properly using the tokenstream workflow (described here: http://lucene.apache.org/java/3_0_3/api/core/org/apache/lucene/analysis/TokenStream.html)
> One problem I noticed in TestTermVectorsWriter.testEndOffsetPositionWithCachingTokenFilter is that providing a CachingTOkenFilter directly will result
> in close() being called twice on the underlying tokenstream... this seems wrong.
> Some ideas to fix this could be:
> # CachingTokenFilter overrides close() and we document that you must close the underlying stream yourself. I think this is what the queryparser does anyway.
> # CachingTokenFilter does something tricky to ensure it only closes the underlying stream once.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org