You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2013/10/07 08:24:42 UTC

[jira] [Commented] (LUCENE-5259) convert analysis consumers to try-with-resources

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

ASF subversion and git services commented on LUCENE-5259:
---------------------------------------------------------

Commit 1529770 from [~rcmuir] in branch 'dev/trunk'
[ https://svn.apache.org/r1529770 ]

LUCENE-5259: convert analysis consumers to try-with-resources

> convert analysis consumers to try-with-resources
> ------------------------------------------------
>
>                 Key: LUCENE-5259
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5259
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Robert Muir
>         Attachments: LUCENE-5259.patch
>
>
> Most of these consumers' exception handling is questionable at best.
> if you do it with try-with-resources, then its obvious its correct:
> {code}
> try (TokenStream stream = analyzer.tokenStream("body", "testing")) {
>   stream.reset();
>   while (stream.incrementToken()) {
>     ...
>   }
>   stream.end();
> }
> {code}
> For trunk we should change the consumers to work this way. For 4.x we can simulate it with IOUtils



--
This message was sent by Atlassian JIRA
(v6.1#6144)

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