[jira] [Commented] (OFBIZ-11826) Replace try-finally with try with resources

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-11826) Replace try-finally with try with resources

Nicolas Malin (Jira)

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

ASF subversion and git services commented on OFBIZ-11826:
---------------------------------------------------------

Commit 2a4a617d0d63dd288cca5dd1f657c16d83d36240 in ofbiz-framework's branch refs/heads/trunk from Pawan Verma
[ https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=2a4a617 ]

Improved: Replace try-finally with try with resources(OFBIZ-11826)

Set checkstyleMain.maxErrors to 26678 (-4)

Thanks: Jacques for the review.


> Replace try-finally with try with resources
> -------------------------------------------
>
>                 Key: OFBIZ-11826
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-11826
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: ALL COMPONENTS
>    Affects Versions: Trunk
>            Reporter: Pawan Verma
>            Assignee: Pawan Verma
>            Priority: Minor
>         Attachments: OFBIZ-11826-plugins.patch, OFBIZ-11826.patch
>
>
> Support for try-with-resources – introduced in Java 7 – allows us to declare resources to be used in a try block with the assurance that the resources will be closed when after the execution of that block.
> To do so, you must open and use the resource within a Java try-with-resources block. When the execution leaves the try-with-resources block, any resource opened within the try-with-resources block is automatically closed, regardless of whether any exceptions are thrown either from inside the try-with-resources block, or when attempting to close the resources.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)