You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Alan Woodward (JIRA)" <ji...@apache.org> on 2015/12/02 15:46:12 UTC

[jira] [Updated] (LUCENE-6916) BaseDirectoryTestCase should use try-with-resources for its Directories

     [ https://issues.apache.org/jira/browse/LUCENE-6916?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alan Woodward updated LUCENE-6916:
----------------------------------
    Attachment: LUCENE-6916.patch

Patch.  I've only wrapped Directory usage with try-with-resources for now, but it could be extended to all the input and outputstreams as well.

> BaseDirectoryTestCase should use try-with-resources for its Directories
> -----------------------------------------------------------------------
>
>                 Key: LUCENE-6916
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6916
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Alan Woodward
>            Assignee: Alan Woodward
>            Priority: Minor
>         Attachments: LUCENE-6916.patch
>
>
> I'm playing around with writing a nio2 FileSystem implementation for HDFS that will work with Directory, and it currently leaks threads everywhere because if a BaseDirectoryTestCase test fails it doesn't close its Directory.  This obviously won't be a problem if everything passes, but it will probably be a while before that's true and it makes iterative development a bit of a pain.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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