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

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

Commit cc52b981510caeed57ae4cb0d70f13c0017d4445 in ofbiz-framework's branch 
refs/heads/trunk from Suraj Khurana
[ https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=cc52b98 ]

Improved: Defects reported by code analysis tool.
(OFBIZ-10571)

Following refactoring done -
-- Refactored code to fall in line with some java standards.
-- Based on FindBugs suggestion, refactored some classes to have static nested 
classes instead of inner class.

Thanks Girish Vasmatkar for reporting the issue and providing the patch.


> [FB] Package org.apache.ofbiz.minilang
> --------------------------------------
>
>                 Key: OFBIZ-10571
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-10571
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: ALL APPLICATIONS
>    Affects Versions: Trunk
>            Reporter: Girish Vasmatkar
>            Assignee: Suraj Khurana
>            Priority: Minor
>         Attachments: OFBIZ-10571.patch
>
>
> * [Should be a static inner 
> class|http://findbugs.sourceforge.net/bugDescriptions.html#SIC_INNER_SHOULD_BE_STATIC]
> This class is an inner class, but does not use its embedded reference to the 
> object which created it.  This reference makes the instances of the class 
> larger, and may keep the reference to the creator object alive longer than 
> necessary.  If possible, the class should be made static.
> *Bug kind and pattern: SIC - SIC_INNER_SHOULD_BE_STATIC*
> *org.apache.ofbiz.minilang.method.callops.CallService***
>  
>  * [Could be refactored into a named static inner 
> class|http://findbugs.sourceforge.net/bugDescriptions.html#SIC_INNER_SHOULD_BE_STATIC_ANON]
> This class is an inner class, but does not use its embedded reference to the 
> object which created it.  This reference makes the instances of the class 
> larger, and may keep the reference to the creator object alive longer than 
> necessary.  If possible, the class should be made into a _static_ inner 
> class. Since anonymous inner classes cannot be marked as static, doing this 
> will require refactoring the inner class so that it is a named inner class.
> *Bug kind and pattern: SIC - SIC_INNER_SHOULD_BE_STATIC_ANON*
> *org.apache.ofbiz.minilang.method.conditional.CombinedConditional*
>  
>  * [Boxing/unboxing to parse a 
> primitive|http://findbugs.sourceforge.net/bugDescriptions.html#DM_BOXED_PRIMITIVE_FOR_PARSING]
> A boxed primitive is created from a String, just to extract the unboxed 
> primitive value. It is more efficient to just call the static parseXXX method.
> **
> *Bug kind and pattern: Bx - DM_BOXED_PRIMITIVE_FOR_PARSING*
> *org.apache.ofbiz.minilang.method.otherops.Calculate*



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

Reply via email to