[
https://issues.apache.org/jira/browse/OFBIZ-11827?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17139423#comment-17139423 ]
Jacques Le Roux commented on OFBIZ-11827:
-----------------------------------------
I'm reviewing this one step by step...
> 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)