[jira] [Updated] (OFBIZ-9682) [FB] Package org.apache.ofbiz.service.config.model

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

[jira] [Updated] (OFBIZ-9682) [FB] Package org.apache.ofbiz.service.config.model

JIRA jira@apache.org

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

Julian Leichert updated OFBIZ-9682:
    Attachment: OFBIZ-9682_org.apache.ofbiz.service.config.model_bugfixes.patch

Hi Michael,
I corrected the exception messages.

> [FB] Package org.apache.ofbiz.service.config.model
> --------------------------------------------------
>                 Key: OFBIZ-9682
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-9682
>             Project: OFBiz
>          Issue Type: Sub-task
>    Affects Versions: Trunk
>            Reporter: Julian Leichert
>            Assignee: Michael Brohl
>            Priority: Minor
>         Attachments: OFBIZ-9682_org.apache.ofbiz.service.config.model_bugfixes.patch, OFBIZ-9682_org.apache.ofbiz.service.config.model_bugfixes.patch
> ThreadPool.java:135, REC_CATCH_EXCEPTION
> REC: Exception is caught when Exception is not thrown in new org.apache.ofbiz.service.config.model.ThreadPool(Element)
> This method uses a try-catch block that catches Exception objects, but Exception is not thrown within the try block, and RuntimeException is not explicitly caught. It is a common bug pattern to say try { ... } catch (Exception e) { something } as a shorthand for catching a number of types of exception each of whose catch blocks is identical, but this construct also accidentally catches RuntimeException as well, masking potential bugs.
> A better approach is to either explicitly catch the specific exceptions that are thrown, or to explicitly catch RuntimeException exception, rethrow it, and then catch all non-Runtime Exceptions, as shown below:
>   try {
>     ...
>   } catch (RuntimeException e) {
>     throw e;
>   } catch (Exception e) {
>     ... deal with all non-runtime exceptions ...
>   }

This message was sent by Atlassian JIRA