Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0006477
TypeCategorySeverityReproducibilityDate SubmittedLast Update
backport[Openbravo ERP] A. Platformmajoralways2008-12-11 09:402009-03-03 17:16
ReportermtaalView Statuspublic 
Assigned Tovmromanos 
PriorityhighResolutionfixedFixed in Version
StatusclosedFix in branch2.40Fixed in SCM revision11782
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0006477: Use of double instead of BigDecimal, double is very inprecise

DescriptionThere are a few cases in Openbravo source code where a double type is used. A double is far more in-precise than a BigDecimal. Always a BigDecimal should be used.
See for example this code in the ReportGeneralLedger class:
        double amount = 0.0;
        for (int i=0;data2!=null && i<data2.length;i++){
          if (data2[i].factAcctId.equals(data[0].factAcctId)) {
            if (log4j.isDebugEnabled()) log4j.debug("break i:"+i);
            break;
          };
          // if (data2[i].id.equals(data[0].id))
          if ((data2[i].partner.equals(data[0].partner) && (!(strcBpartnerId.equals("")&&(strAll.equals("")))))||(strcBpartnerId.equals("")&&(strAll.equals(""))))
            amount += Double.valueOf(data2[i].total).doubleValue();
        }

Here a BigDecimal should be used.

Search for the use of double in the source tree and repair the incorrect uses.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 00045122.50 closedvmromanos Float Point Errors 
blocks defect 0006284 closedDowid Use of double instead of BigDecimal, double is very inprecise 

-  Notes
(0012070)
svnbot (reporter)
2009-01-09 18:34

Repository: openbravo
Revision: 11782
Author: vmromanos
Date: 2009-01-09 18:34:48 +0100 (Fri, 09 Jan 2009)

Fixed bug 6477: Use of double instead of BigDecimal, double is very imprecise (Float Point Errors)

---
U branches/r2.40/src/org/openbravo/erpCommon/ad_actionButton/CopyFromOrder.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_actionButton/CopyFromPOOrder.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_actionButton/CreateVatRegisters.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_actionButton/ExpenseSOrder.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_callouts/SE_Invoice_BPartner.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_callouts/SE_Order_BPartner.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_callouts/SL_Conversion_Rate.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_callouts/SL_CreateFromMultiple_Conversion.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_callouts/SL_GlobalUse_Conversion.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_callouts/SL_InOut_BPartner.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_callouts/SL_InOut_Conversion.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_callouts/SL_Internal_Consumption_Conversion.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_callouts/SL_Inventory_Conversion.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_callouts/SL_InvoiceTax_Amt.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_callouts/SL_Invoice_Amt.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_callouts/SL_Invoice_Conversion.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_callouts/SL_MachineCost.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_callouts/SL_Movement_Conversion.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_callouts/SL_Order_Amt.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_callouts/SL_Order_Conversion.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_callouts/SL_Order_DocType.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_callouts/SL_Order_Product.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_callouts/SL_Production_Conversion.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_callouts/SL_Project_Margin.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_callouts/SL_Project_Planned.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_callouts/SL_RequisitionLine_Amt.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_callouts/SL_RequisitionLine_Conversion.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_callouts/SL_RequisitionLine_Product.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_callouts/SL_SequenceProduct_Conversion.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_forms/DocInvoice.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_forms/DocPayment.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_forms/MatchingPOReceiptInvoice.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_process/CreateAccountingReport.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_process/CreateTaxReport.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_process/ExpenseAPInvoice.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_process/ImportOrder.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_reports/MInOutTraceReports.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_reports/ReportCashFlow.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_reports/ReportTrialBalance.java
U branches/r2.40/src/org/openbravo/erpCommon/businessUtility/AccountTree.java
U branches/r2.40/src/org/openbravo/erpCommon/ws/externalSales/ExternalSalesImpl.java
U branches/r2.40/src/org/openbravo/erpCommon/ws/externalSales/OrderLine.java
U branches/r2.40/src/org/openbravo/erpCommon/ws/externalSales/Payment.java
U branches/r2.40/src/org/openbravo/erpCommon/ws/externalSales/Product.java
U branches/r2.40/src/org/openbravo/erpCommon/ws/externalSales/ProductPlus.java
U branches/r2.40/src/org/openbravo/erpCommon/ws/externalSales/Tax.java
---

https://dev.openbravo.com/websvn/openbravo/?rev=11782&sc=1 [^]

- Issue History
Date Modified Username Field Change
2008-12-11 09:40 Dowid New Issue
2008-12-11 09:40 Dowid Assigned To => Dowid
2008-12-11 09:40 Dowid Status new => scheduled
2009-01-08 10:28 Dowid Assigned To Dowid => vmromanos
2009-01-09 18:22 vmromanos Relationship added related to 0004512
2009-01-09 18:34 svnbot Checkin
2009-01-09 18:34 svnbot Note Added: 0012070
2009-01-09 18:34 svnbot Status scheduled => resolved
2009-01-09 18:34 svnbot Resolution open => fixed
2009-01-09 18:34 svnbot svn_revision => 11782
2009-03-03 17:16 psarobe Status resolved => closed


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker