svn commit: r1804847 - /ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/GiftCertificateServices.java

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

svn commit: r1804847 - /ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/GiftCertificateServices.java

jleroux@apache.org
Author: jleroux
Date: Fri Aug 11 19:41:32 2017
New Revision: 1804847

URL: http://svn.apache.org/viewvc?rev=1804847&view=rev
Log:
Fixed: [FB] Package org.apache.ofbiz.accounting.payment (Additional Bugs)
(OFBIZ-9529)

GiftCertificateServices.java:229, DLS_DEAD_LOCAL_STORE
GiftCertificateServices.java:306, DLS_DEAD_LOCAL_STORE
DLS: Dead store to balance in
GiftCertificateServices.addFundsToGiftCertificate(DispatchContext, Map)
This instruction assigns a value to a local variable, but the value is not read
or used in any subsequent instruction. Often, this indicates an error,
because the value computed is never used.

Thanks: Kyra Pritzel-Hentley

Modified:
    ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/GiftCertificateServices.java

Modified: ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/GiftCertificateServices.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/GiftCertificateServices.java?rev=1804847&r1=1804846&r2=1804847&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/GiftCertificateServices.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/GiftCertificateServices.java Fri Aug 11 19:41:32 2017
@@ -226,7 +226,7 @@ public class GiftCertificateServices {
         }
 
         // create the transaction
-        BigDecimal balance = ZERO;
+        BigDecimal balance;
         String refNum = null;
         try {
             refNum = GiftCertificateServices.createTransaction(delegator, dispatcher, userLogin, amount, productStoreId, partyId,
@@ -303,7 +303,7 @@ public class GiftCertificateServices {
         // check the actual balance (excluding authorized amounts) and create the transaction if it is sufficient
         BigDecimal previousBalance = finAccount.get("actualBalance") == null ? BigDecimal.ZERO : finAccount.getBigDecimal("actualBalance");
 
-        BigDecimal balance = BigDecimal.ZERO;
+        BigDecimal balance;
         String refNum = null;
         Boolean procResult;
         if (previousBalance.compareTo(amount) >= 0) {