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

Stevo Slavic commented on AVRO-1577:
------------------------------------

Attached patch makes use of {{IOUtils.closeQuietly(Closable)}} from 
{{commons-io}} - it's Apache, and only for tests.

If not upgrade target JVM to 1.7 and use {{try-with-resources}}, another 
alternative is using [Google Guava's 
Closer|https://code.google.com/p/guava-libraries/wiki/ClosingResourcesExplained].

> TestSpecificCompiler is not closing resources
> ---------------------------------------------
>
>                 Key: AVRO-1577
>                 URL: https://issues.apache.org/jira/browse/AVRO-1577
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.7.7
>         Environment: Windows
>            Reporter: Stevo Slavic
>             Fix For: 1.8.0
>
>         Attachments: AVRO-1577.patch
>
>
> Test methods in {{TestSpecificCompiler}} are opening various {{Closable}} 
> resources, but they are not closing them. Because of this, file deletion in 
> {{tearDown}} silently fails (on platforms like Windows which are locking 
> files that are being used). This causes few test methods to fail since they 
> are using same temp file as output file - they generate new file content but 
> only if file is not already present, and then assertions comparing actual and 
> expected output content fail.



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

Reply via email to