[jira] [Comment Edited] (OFBIZ-11827) Merge identical catch blocks in single catch block

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

[jira] [Comment Edited] (OFBIZ-11827) Merge identical catch blocks in single catch block

Nicolas Malin (Jira)

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

Pawan Verma edited comment on OFBIZ-11827 at 6/25/20, 5:46 PM:
---------------------------------------------------------------

[~jleroux]

What I was thinking, Should we break down big patches into component-wise subtasks, this will create some managing burden but definitely improve our review process, Or continue doing it as we are doing now, WDYT? 


was (Author: pawan.verma):
[~jleroux]

What I was thinking, Should we break down big patches into component-wise subtasks, this will create some managing burden but definately improve our review process, WDYT? 

> Merge identical catch blocks in single catch block
> ---------------------------------------------------
>
>                 Key: OFBIZ-11827
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-11827
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: ALL COMPONENTS
>    Affects Versions: Trunk
>            Reporter: Pawan Verma
>            Assignee: Pawan Verma
>            Priority: Minor
>         Attachments: OFBIZ-11827-plugins.patch, OFBIZ-11827.patch
>
>
> In Java SE 7 and later, a single catch block can handle more than one type of exception. This feature can reduce code duplication and lessen the temptation to catch an overly broad exception.
> For more details: https://docs.oracle.com/javase/8/docs/technotes/guides/language/catch-multiple.html
> Example:
> {code:java}
> catch (IOException ex) {
>     logger.log(ex);
>     throw ex;
> } catch (SQLException ex) {
>     logger.log(ex);
>     throw ex;
> }{code}
> Can be written as, which is valid in Java SE 7 and later, eliminates the duplicated code:
>  
> {code:java}
> catch (IOException | SQLException ex) {
>     logger.log(ex);
>     throw ex;
> }{code}
>  



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