ofbiz-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dennis Balkir (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (OFBIZ-9724) [FB] Package org.apache.ofbiz.widget
Date Fri, 15 Sep 2017 08:47:00 GMT

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

Dennis Balkir updated OFBIZ-9724:
    Attachment: OFBIZ-No_org.apache.ofbiz.widget_bugfixes.patch

- Diamond Operators fixed

class WidgetFactory:
- Line 102: logged the Exception with {{logError}}

class WidgetWorker:
- removed unnecessary else
- Line 90: deleted the unnecessary else if, since the else after that, which will be executed
if this else if is’n’t, actually does the exact same thing
- Line 160: deleted the declaration of {{wholeFormContext}} since it is never used again,
so there doesn’t have to be another value written in it
- Line 150: added a null-check for {{modelFormField}}
- Line 155: deleted the now unnecessary null-check

- Line 351: changed the String # to a char, since it is only a char, that’s being passed
- Line 366: changed the String # to a char, since it is only a char, that’s being passed
- Line 338: removed {{return „anchor“;}} since this is exactly what happens two lines
after this

> [FB] Package org.apache.ofbiz.widget
> ------------------------------------
>                 Key: OFBIZ-9724
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-9724
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: framework
>    Affects Versions: Trunk
>            Reporter: Dennis Balkir
>            Priority: Minor
>         Attachments: OFBIZ-No_org.apache.ofbiz.widget_bugfixes.patch
> - WidgetFactory.java:102, REC_CATCH_EXCEPTION
> REC: Exception is caught when Exception is not thrown in org.apache.ofbiz.widget.WidgetFactory.loadStandardWidgets()
> 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 ...
>   }
> - WidgetFactory.java:102, DE_MIGHT_IGNORE
> DE: org.apache.ofbiz.widget.WidgetFactory.loadStandardWidgets() might ignore java.lang.Exception
> This method might ignore an exception.  In general, exceptions should be handled or reported
in some way, or they should be thrown out of the method.
> - WidgetWorker.java:89, DB_DUPLICATE_BRANCHES
> DB: org.apache.ofbiz.widget.WidgetWorker.buildHyperlinkUrl(Appendable, String, String,
Map, String, boolean, boolean, boolean, HttpServletRequest, HttpServletResponse, Map) uses
the same code for two branches
> This method uses the same code to implement two branches of a conditional branch. Check
to ensure that this isn't a coding mistake.
> - WidgetWorker.java:166, NP_NULL_PARAM_DEREF
> NP: Null passed for nonnull parameter of makeHiddenFormLinkForm(Appendable, String, String,
String, Map, ModelFormField, HttpServletRequest, HttpServletResponse, Map) in org.apache.ofbiz.widget.WidgetWorker.makeHyperlinkByType(Appendable,
String, String, String, String, Map, String, String, String, ModelFormField, HttpServletRequest,
HttpServletResponse, Map)
> This method call passes a null value for a non-null method parameter. Either the parameter
is annotated as a parameter that should always be non-null, or analysis has shown that it
will always be dereferenced.

This message was sent by Atlassian JIRA

View raw message