svn commit: r778358 - in /ofbiz/trunk: applications/accounting/src/org/ofbiz/accounting/finaccount/ applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ applications/product/src/org/ofbiz/product/product/ framework/base/src/org/ofbiz/base...

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

svn commit: r778358 - in /ofbiz/trunk: applications/accounting/src/org/ofbiz/accounting/finaccount/ applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ applications/product/src/org/ofbiz/product/product/ framework/base/src/org/ofbiz/base...

lektran
Author: lektran
Date: Mon May 25 09:00:39 2009
New Revision: 778358

URL: http://svn.apache.org/viewvc?rev=778358&view=rev
Log:
Searched for and fixed any other code incorrectly using BigDecimal.equals() as reported by Hans for r778302

Modified:
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java
    ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
    ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductEvents.java
    ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearch.java
    ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilMisc.java

Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java?rev=778358&r1=778357&r2=778358&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java Mon May 25 09:00:39 2009
@@ -346,7 +346,7 @@
             BigDecimal actualBalance = finAccount.getBigDecimal("actualBalance");
 
             // if they do not match, then there are outstanding authorizations which need to be settled first
-            if (!actualBalance.equals(availableBalance)) {
+            if (actualBalance.compareTo(availableBalance) != 0) {
                 return ServiceUtil.returnError("Available balance does not match the actual balance; pending authorizations; cannot refund FinAccount at this time.");
             }
 

Modified: ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java?rev=778358&r1=778357&r2=778358&view=diff
==============================================================================
--- ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java (original)
+++ ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java Mon May 25 09:00:39 2009
@@ -466,7 +466,7 @@
                 }
 
                 BigDecimal quantity = (BigDecimal) context.get("quantity");
-                if (quantity != null &&  ! quantity.equals(productionRun.getQuantity())) {
+                if (quantity != null &&  quantity.compareTo(productionRun.getQuantity()) != 0) {
                     productionRun.setQuantity(quantity);
                 }
 

Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductEvents.java?rev=778358&r1=778357&r2=778358&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductEvents.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductEvents.java Mon May 25 09:00:39 2009
@@ -540,7 +540,7 @@
         // go through each; need to remove? do it now
         boolean foundOneEqual = false;
         for (GenericValue typeUomProductFeatureAndAppl: typeUomProductFeatureAndApplList) {
-            if ((numberSpecified != null) && (numberSpecified.equals(typeUomProductFeatureAndAppl.getBigDecimal("numberSpecified")))) {
+            if ((numberSpecified != null) && (numberSpecified.compareTo(typeUomProductFeatureAndAppl.getBigDecimal("numberSpecified")) == 0)) {
                 foundOneEqual = true;
             } else {
                 // remove the PFA...

Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearch.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearch.java?rev=778358&r1=778357&r2=778358&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearch.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearch.java Mon May 25 09:00:39 2009
@@ -1609,7 +1609,7 @@
                         return false;
                     }
                 } else {
-                    if (!this.lowPrice.equals(that.lowPrice)) {
+                    if (this.lowPrice.compareTo(that.lowPrice) != 0) {
                         return false;
                     }
                 }
@@ -1618,7 +1618,7 @@
                         return false;
                     }
                 } else {
-                    if (!this.highPrice.equals(that.highPrice)) {
+                    if (this.highPrice.compareTo(that.highPrice) != 0) {
                         return false;
                     }
                 }

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilMisc.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilMisc.java?rev=778358&r1=778357&r2=778358&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilMisc.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilMisc.java Mon May 25 09:00:39 2009
@@ -285,7 +285,7 @@
             throw new IllegalArgumentException("In addToBigDecimalInMap found a Map value of a type not supported: " + currentNumberObj.getClass().getName());
         }
 
-        if (addNumber == null || ZERO_BD.equals(addNumber)) {
+        if (addNumber == null || ZERO_BD.compareTo(addNumber) == 0) {
             return currentNumber;
         }
         currentNumber = currentNumber.add(addNumber);