You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by mr...@apache.org on 2011/03/13 12:09:39 UTC
svn commit: r1081075 - in
/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting: payment/
tax/ thirdparty/gosoftware/ thirdparty/valuelink/ thirdparty/worldpay/ util/
Author: mrisaliti
Date: Sun Mar 13 11:09:38 2011
New Revision: 1081075
URL: http://svn.apache.org/viewvc?rev=1081075&view=rev
Log:
Remove some reduntant cast warning in accounting component (OFBIZ-4102)
Modified:
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/PcChargeServices.java
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/RitaApi.java
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/RitaServices.java
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkApi.java
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkServices.java
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/worldpay/WorldPayEvents.java
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java
Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java?rev=1081075&r1=1081074&r2=1081075&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java Sun Mar 13 11:09:38 2011
@@ -800,7 +800,7 @@ public class GiftCertificateServices {
if (responseAnswers != null) {
Iterator<GenericValue> rai = responseAnswers.iterator();
while (rai.hasNext()) {
- GenericValue answer = (GenericValue) rai.next();
+ GenericValue answer = rai.next();
GenericValue question = null;
try {
question = answer.getRelatedOne("SurveyQuestion");
@@ -893,7 +893,7 @@ public class GiftCertificateServices {
if (productStoreEmail == null) {
Debug.logError("No gift card purchase email setting found for this store; cannot send gift card information", module);
} else {
- ResourceBundleMapWrapper uiLabelMap = (ResourceBundleMapWrapper) UtilProperties.getResourceBundleMap("EcommerceUiLabels", locale);
+ ResourceBundleMapWrapper uiLabelMap = UtilProperties.getResourceBundleMap("EcommerceUiLabels", locale);
uiLabelMap.addBottomResourceBundle("OrderUiLabels");
uiLabelMap.addBottomResourceBundle("CommonUiLabels");
answerMap.put("uiLabelMap", uiLabelMap);
@@ -1038,7 +1038,7 @@ public class GiftCertificateServices {
if (responseAnswers != null) {
Iterator<GenericValue> rai = responseAnswers.iterator();
while (rai.hasNext()) {
- GenericValue answer = (GenericValue) rai.next();
+ GenericValue answer = rai.next();
GenericValue question = null;
try {
question = answer.getRelatedOne("SurveyQuestion");
@@ -1140,7 +1140,7 @@ public class GiftCertificateServices {
if (productStoreEmail == null) {
Debug.logError("No gift card purchase email setting found for this store; cannot send gift card information", module);
} else {
- ResourceBundleMapWrapper uiLabelMap = (ResourceBundleMapWrapper) UtilProperties.getResourceBundleMap("EcommerceUiLabels", locale);
+ ResourceBundleMapWrapper uiLabelMap = UtilProperties.getResourceBundleMap("EcommerceUiLabels", locale);
uiLabelMap.addBottomResourceBundle("OrderUiLabels");
uiLabelMap.addBottomResourceBundle("CommonUiLabels");
answerMap.put("uiLabelMap", uiLabelMap);
Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java?rev=1081075&r1=1081074&r2=1081075&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java Sun Mar 13 11:09:38 2011
@@ -112,7 +112,7 @@ public class TaxAuthorityServices {
// add up amounts from adjustments (amount OR exemptAmount, sourcePercentage)
Iterator<GenericValue> taxAdustmentIter = taxAdustmentList.iterator();
while (taxAdustmentIter.hasNext()) {
- GenericValue taxAdjustment = (GenericValue) taxAdustmentIter.next();
+ GenericValue taxAdjustment = taxAdustmentIter.next();
if ("SALES_TAX".equals(taxAdjustment.getString("orderAdjustmentTypeId"))) {
taxPercentage = taxPercentage.add(taxAdjustment.getBigDecimal("sourcePercentage"));
BigDecimal adjAmount = taxAdjustment.getBigDecimal("amount");
@@ -208,11 +208,11 @@ public class TaxAuthorityServices {
// Loop through the products; get the taxCategory; and lookup each in the cache.
for (int i = 0; i < itemProductList.size(); i++) {
- GenericValue product = (GenericValue) itemProductList.get(i);
- BigDecimal itemAmount = (BigDecimal) itemAmountList.get(i);
- BigDecimal itemPrice = (BigDecimal) itemPriceList.get(i);
- BigDecimal itemQuantity = itemQuantityList != null ? (BigDecimal) itemQuantityList.get(i) : null;
- BigDecimal shippingAmount = (BigDecimal) itemShippingList.get(i);
+ GenericValue product = itemProductList.get(i);
+ BigDecimal itemAmount = itemAmountList.get(i);
+ BigDecimal itemPrice = itemPriceList.get(i);
+ BigDecimal itemQuantity = itemQuantityList != null ? itemQuantityList.get(i) : null;
+ BigDecimal shippingAmount = itemShippingList.get(i);
List<GenericValue> taxList = null;
if (shippingAddress != null) {
taxList = getTaxAdjustments(delegator, product, productStore, payToPartyId, billToPartyId, taxAuthoritySet, itemPrice, itemQuantity, itemAmount, shippingAmount, ZERO_BASE);
@@ -300,7 +300,7 @@ public class TaxAuthorityServices {
Iterator<GenericValue> taxAuthorityIter = taxAuthoritySet.iterator();
while (taxAuthorityIter.hasNext()) {
- GenericValue taxAuthority = (GenericValue) taxAuthorityIter.next();
+ GenericValue taxAuthority = taxAuthorityIter.next();
EntityCondition taxAuthCond = EntityCondition.makeCondition(
EntityCondition.makeCondition("taxAuthPartyId", EntityOperator.EQUALS, taxAuthority.getString("taxAuthPartyId")),
EntityOperator.AND,
@@ -334,7 +334,7 @@ public class TaxAuthorityServices {
pcmList = EntityUtil.filterByDate(pcmList, true);
Iterator<GenericValue> pcmIter = pcmList.iterator();
while (pcmIter.hasNext()) {
- GenericValue pcm = (GenericValue) pcmIter.next();
+ GenericValue pcm = pcmIter.next();
productCategoryIdSet.add(pcm.getString("productCategoryId"));
}
@@ -398,7 +398,7 @@ public class TaxAuthorityServices {
// find the right entry(s) based on purchase amount
Iterator<GenericValue> flIt = filteredList.iterator();
while (flIt.hasNext()) {
- GenericValue taxAuthorityRateProduct = (GenericValue) flIt.next();
+ GenericValue taxAuthorityRateProduct = flIt.next();
BigDecimal taxRate = taxAuthorityRateProduct.get("taxPercentage") != null ? taxAuthorityRateProduct.getBigDecimal("taxPercentage") : ZERO_BASE;
BigDecimal taxable = ZERO_BASE;
@@ -480,7 +480,7 @@ public class TaxAuthorityServices {
List<GenericValue> partyRelationshipList = EntityUtil.filterByDate(delegator.findByAndCache("PartyRelationship", UtilMisc.toMap("partyIdTo", billToPartyId, "partyRelationshipTypeId", "GROUP_ROLLUP")), true);
Iterator<GenericValue> partyRelationshipIter = partyRelationshipList.iterator();
while (partyRelationshipIter.hasNext()) {
- GenericValue partyRelationship = (GenericValue) partyRelationshipIter.next();
+ GenericValue partyRelationship = partyRelationshipIter.next();
billToPartyIdSet.add(partyRelationship.getString("partyIdFrom"));
}
handlePartyTaxExempt(taxAdjValue, billToPartyIdSet, taxAuthGeoId, taxAuthPartyId, taxAmount, nowTimestamp, delegator);
@@ -558,7 +558,7 @@ public class TaxAuthorityServices {
boolean foundExemption = false;
if (partyTaxInfos.size() > 0) {
- GenericValue partyTaxInfo = (GenericValue) partyTaxInfos.get(0);
+ GenericValue partyTaxInfo = partyTaxInfos.get(0);
adjValue.set("customerReferenceId", partyTaxInfo.get("partyTaxId"));
if ("Y".equals(partyTaxInfo.getString("isExempt"))) {
adjValue.set("amount", BigDecimal.ZERO);
Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/PcChargeServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/PcChargeServices.java?rev=1081075&r1=1081074&r2=1081075&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/PcChargeServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/PcChargeServices.java Sun Mar 13 11:09:38 2011
@@ -325,8 +325,8 @@ public class PcChargeServices {
GenericValue creditCard = (GenericValue) context.get("creditCard");
if (creditCard != null) {
List<String> expDateList = StringUtil.split(creditCard.getString("expireDate"), "/");
- String month = (String) expDateList.get(0);
- String year = (String) expDateList.get(1);
+ String month = expDateList.get(0);
+ String year = expDateList.get(1);
String y2d = year.substring(2);
String expDate = month + y2d;
Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/RitaApi.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/RitaApi.java?rev=1081075&r1=1081074&r2=1081075&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/RitaApi.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/RitaApi.java Sun Mar 13 11:09:38 2011
@@ -146,15 +146,15 @@ public class RitaApi {
throw new IllegalArgumentException("Field [" + name + "] is not a valid OUT parameter");
}
- return (String) document.get(name);
+ return document.get(name);
}
@Override
public String toString() {
StringBuilder buf = new StringBuilder();
for (Map.Entry<String, String> entry : document.entrySet()) {
- String name = (String) entry.getKey();
- String value = (String) entry.getValue();
+ String name = entry.getKey();
+ String value = entry.getValue();
buf.append(name);
buf.append(" ");
buf.append(value);
Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/RitaServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/RitaServices.java?rev=1081075&r1=1081074&r2=1081075&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/RitaServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/RitaServices.java Sun Mar 13 11:09:38 2011
@@ -409,8 +409,8 @@ public class RitaServices {
}
if (creditCard != null) {
List<String> expDateList = StringUtil.split(creditCard.getString("expireDate"), "/");
- String month = (String) expDateList.get(0);
- String year = (String) expDateList.get(1);
+ String month = expDateList.get(0);
+ String year = expDateList.get(1);
String y2d = year.substring(2);
String title = creditCard.getString("titleOnCard");
Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkApi.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkApi.java?rev=1081075&r1=1081074&r2=1081075&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkApi.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkApi.java Sun Mar 13 11:09:38 2011
@@ -1000,7 +1000,7 @@ public class ValueLinkApi {
// create a List of Maps for each set of values
List<Map<String, String>> valueMap = FastList.newInstance();
for (int i = 0; i < valueList.size(); i++) {
- valueMap.add(StringUtil.createMap(StringUtil.split(keys, "|"), StringUtil.split((String) valueList.get(i), "|")));
+ valueMap.add(StringUtil.createMap(StringUtil.split(keys, "|"), StringUtil.split(valueList.get(i), "|")));
}
if (debug) {
Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkServices.java?rev=1081075&r1=1081074&r2=1081075&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkServices.java Sun Mar 13 11:09:38 2011
@@ -1157,7 +1157,7 @@ public class ValueLinkServices {
if (responseAnswers != null) {
Iterator<GenericValue> rai = responseAnswers.iterator();
while (rai.hasNext()) {
- GenericValue answer = (GenericValue) rai.next();
+ GenericValue answer = rai.next();
GenericValue question = null;
try {
question = answer.getRelatedOne("SurveyQuestion");
@@ -1270,7 +1270,7 @@ public class ValueLinkServices {
if (productStoreEmail == null) {
Debug.logError("No gift card purchase email setting found for this store; cannot send gift card information", module);
} else {
- ResourceBundleMapWrapper uiLabelMap = (ResourceBundleMapWrapper) UtilProperties.getResourceBundleMap("EcommerceUiLabels", locale);
+ ResourceBundleMapWrapper uiLabelMap = UtilProperties.getResourceBundleMap("EcommerceUiLabels", locale);
uiLabelMap.addBottomResourceBundle("OrderUiLabels");
uiLabelMap.addBottomResourceBundle("CommonUiLabels");
answerMap.put("uiLabelMap", uiLabelMap);
@@ -1414,7 +1414,7 @@ public class ValueLinkServices {
if (responseAnswers != null) {
Iterator<GenericValue> rai = responseAnswers.iterator();
while (rai.hasNext()) {
- GenericValue answer = (GenericValue) rai.next();
+ GenericValue answer = rai.next();
GenericValue question = null;
try {
question = answer.getRelatedOne("SurveyQuestion");
@@ -1525,7 +1525,7 @@ public class ValueLinkServices {
Debug.logError("No gift card purchase email setting found for this store; cannot send gift card information", module);
} else {
Map<String, Object> emailCtx = FastMap.newInstance();
- ResourceBundleMapWrapper uiLabelMap = (ResourceBundleMapWrapper) UtilProperties.getResourceBundleMap("EcommerceUiLabels", locale);
+ ResourceBundleMapWrapper uiLabelMap = UtilProperties.getResourceBundleMap("EcommerceUiLabels", locale);
uiLabelMap.addBottomResourceBundle("OrderUiLabels");
uiLabelMap.addBottomResourceBundle("CommonUiLabels");
answerMap.put("uiLabelMap", uiLabelMap);
Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/worldpay/WorldPayEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/worldpay/WorldPayEvents.java?rev=1081075&r1=1081074&r2=1081075&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/worldpay/WorldPayEvents.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/worldpay/WorldPayEvents.java Sun Mar 13 11:09:38 2011
@@ -319,7 +319,7 @@ public class WorldPayEvents {
Set<String> keySet = parametersMap.keySet();
Iterator<String> i = keySet.iterator();
while (i.hasNext()) {
- String name = (String) i.next();
+ String name = i.next();
String value = request.getParameter(name);
Debug.logError("### Param: " + name + " => " + value, module);
}
@@ -422,7 +422,7 @@ public class WorldPayEvents {
if (paymentPrefs.size() > 0) {
Iterator<GenericValue> i = paymentPrefs.iterator();
while (i.hasNext()) {
- GenericValue pref = (GenericValue) i.next();
+ GenericValue pref = i.next();
boolean okay = setPaymentPreference(dispatcher, userLogin, pref, request);
if (!okay) {
return false;
Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java?rev=1081075&r1=1081074&r2=1081075&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java Sun Mar 13 11:09:38 2011
@@ -127,7 +127,7 @@ public class UtilAccounting {
List<GenericValue> glAccountClassChildren = glAccountClass.getRelatedCache("ChildGlAccountClass");
Iterator<GenericValue> glAccountClassChildrenIt = glAccountClassChildren.iterator();
while (glAccountClassChildrenIt.hasNext()) {
- GenericValue glAccountClassChild = (GenericValue) glAccountClassChildrenIt.next();
+ GenericValue glAccountClassChild = glAccountClassChildrenIt.next();
getGlAccountClassChildren(glAccountClassChild, glAccountClassIds);
}
}