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

Jacques Le Roux closed OFBIZ-9567.
----------------------------------
       Resolution: Fixed
    Fix Version/s: Release Branch 13.07
                   Release Branch 14.12
                   Release Branch 15.12
                   16.11.04

Thanks Dennis,

Because of possible errors, I consider this a fix and not an improvement.

Your patch is in 
trunk r1804656  
R16.11 r1804657
R15.12, R14.12, R13.07 r1804658


> [FB] Package org.apache.ofbiz.base.metrics
> ------------------------------------------
>
>                 Key: OFBIZ-9567
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-9567
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: base
>    Affects Versions: Trunk
>            Reporter: Dennis Balkir
>            Assignee: Jacques Le Roux
>            Priority: Minor
>             Fix For: 16.11.04, Release Branch 15.12, Release Branch 14.12, 
> Release Branch 13.07
>
>         Attachments: OFBIZ-9567_org.apache.ofbiz.base.metrics_bugfixes.patch
>
>
> - MetricsFactory.java:236, ICAST_IDIV_CAST_TO_DOUBLE
> ICAST: Integral division result cast to double or float in 
> org.apache.ofbiz.base.metrics.MetricsFactory$MetricsImpl.recordServiceRate(int,
>  long)
> This code casts the result of an integral division (e.g., int or long 
> division) operation to double or float. Doing division on integers truncates 
> the result to the integer value closest to zero. The fact that the result was 
> cast to double suggests that this precision should have been retained. What 
> was probably meant was to cast one or both of the operands to double before 
> performing the division. Here is an example:
> int x = 2;
> int y = 5;
> // Wrong: yields result 0.0
> double value1 =  x / y;
> // Right: yields result 0.4
> double value2 =  x / (double) y;



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to