From 47f43a302afcd3cd7bea4e5cebfad7f41c5a4b29 Mon Sep 17 00:00:00 2001 From: Scott Gray Date: Sun, 12 Dec 2010 21:31:27 +0000 Subject: [PATCH] Remove unnecessary casts git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1044931 13f79535-47bb-0310-9956-ffa450edef68 --- .../accounting/invoice/InvoiceWorker.java | 4 +- .../payment/PaymentGatewayServices.java | 54 +++++------ .../authorizedotnet/AIMPaymentServices.java | 6 +- .../thirdparty/paypal/PayPalEvents.java | 6 +- .../ofbiz/content/content/ContentWorker.java | 18 ++-- .../ftl/LimitedSubContentCacheTransform.java | 8 +- .../webapp/ftl/RenderContentAsText.java | 2 +- .../webapp/ftl/RenderContentTransform.java | 2 +- .../ftl/RenderSubContentCacheTransform.java | 2 +- .../ftl/TraverseSubContentCacheTransform.java | 8 +- .../ftl/TraverseSubContentTransform.java | 8 +- .../mrp/InventoryEventPlannedServices.java | 2 +- .../src/org/ofbiz/sfa/vcard/VCard.java | 6 +- .../org/ofbiz/order/OrderManagerEvents.java | 4 +- .../order/finaccount/FinAccountHelper.java | 4 +- .../order/order/OrderLookupServices.java | 4 +- .../order/order/OrderReturnServices.java | 2 +- .../org/ofbiz/order/order/OrderServices.java | 2 +- .../requirement/RequirementServices.java | 2 +- .../order/shoppingcart/CheckOutEvents.java | 2 +- .../order/shoppingcart/ShoppingCart.java | 18 ++-- .../shoppingcart/ShoppingCartHelper.java | 2 +- .../order/shoppingcart/ShoppingCartItem.java | 4 +- .../shoppingcart/ShoppingCartServices.java | 10 +- .../shipping/ShippingEstimateWrapper.java | 2 +- .../shoppinglist/ShoppingListServices.java | 2 +- .../src/org/ofbiz/order/task/TaskEvents.java | 2 +- .../party/contact/ContactMechServices.java | 2 +- .../product/config/ProductConfigWorker.java | 6 +- .../product/config/ProductConfigWrapper.java | 2 +- .../feature/ProductFeatureServices.java | 2 +- .../org/ofbiz/product/image/ScaleImage.java | 8 +- .../product/inventory/InventoryServices.java | 4 +- .../ofbiz/product/price/PriceServices.java | 2 +- .../ofbiz/product/product/ProductSearch.java | 2 +- .../product/product/ProductSearchEvents.java | 6 +- .../product/product/ProductSearchSession.java | 10 +- .../product/product/ProductServices.java | 20 ++-- .../product/product/ProductUtilServices.java | 2 +- .../ImportProductServices.java | 4 +- .../product/store/ProductStoreWorker.java | 4 +- .../shipment/packing/PackingServices.java | 4 +- .../shipment/shipment/ShipmentWorker.java | 4 +- .../shipment/thirdparty/ups/UpsServices.java | 2 +- .../ofbiz/securityext/login/LoginEvents.java | 2 +- .../workeffort/workeffort/ICalConverter.java | 2 +- .../workeffort/workeffort/ICalWorker.java | 2 +- .../workeffort/WorkEffortSearch.java | 2 +- .../workeffort/WorkEffortSearchSession.java | 2 +- .../src/org/ofbiz/base/json/JSONWriter.java | 2 +- .../org/ofbiz/base/json/test/JSONTests.java | 8 +- .../src/org/ofbiz/base/util/TimeDuration.java | 8 +- .../src/org/ofbiz/base/util/UtilHttp.java | 6 +- .../src/org/ofbiz/base/util/UtilNumber.java | 2 +- .../src/org/ofbiz/base/util/UtilObject.java | 2 +- .../org/ofbiz/base/util/UtilProperties.java | 2 +- .../src/org/ofbiz/base/util/UtilTimer.java | 4 +- .../base/util/template/XslTransform.java | 2 +- .../base/util/test/IndentingWriterTests.java | 4 +- .../common/src/org/ofbiz/common/Captcha.java | 6 +- .../src/org/ofbiz/common/CommonEvents.java | 2 +- .../src/org/ofbiz/common/CommonServices.java | 2 +- .../src/org/ofbiz/common/FindServices.java | 4 +- .../org/ofbiz/common/KeywordSearchUtil.java | 2 +- .../preferences/PreferenceServices.java | 2 +- .../src/org/ofbiz/datafile/Record.java | 2 +- .../cache/AbstractEntityConditionCache.java | 2 +- .../ofbiz/entity/datasource/GenericDAO.java | 2 +- .../org/ofbiz/entity/jdbc/DatabaseUtil.java | 4 +- .../org/ofbiz/entity/model/ModelReader.java | 6 +- .../org/ofbiz/entity/sql/EntityPlanner.java | 2 +- .../data/EntityDataLoadContainer.java | 2 +- .../permission/EntityPermissionChecker.java | 8 +- .../geronimo/GeronimoTransactionFactory.java | 2 +- .../src/org/ofbiz/guiapp/xui/XuiSession.java | 2 +- .../minilang/method/envops/StringAppend.java | 4 +- .../method/ifops/CheckPermission.java | 2 +- .../minilang/method/otherops/Calculate.java | 2 +- .../service/calendar/RecurrenceRule.java | 2 +- .../service/config/ServiceConfigUtil.java | 2 +- .../org/ofbiz/service/group/GroupModel.java | 2 +- .../service/semaphore/ServiceSemaphore.java | 2 +- .../ofbiz/webapp/control/ConfigXMLReader.java | 2 +- .../org/ofbiz/webapp/control/LoginWorker.java | 4 +- .../webapp/control/ProtectViewWorker.java | 4 +- .../ofbiz/webapp/event/WfsEventHandler.java | 4 +- .../webapp/event/XmlRpcEventHandler.java | 2 +- .../ofbiz/webapp/region/RegionManager.java | 2 +- .../org/ofbiz/webapp/stats/ServerHitBin.java | 28 +++--- .../org/ofbiz/webtools/WebToolsServices.java | 12 +-- .../ControllerRequestArtifactInfo.java | 2 +- .../artifactinfo/ServiceArtifactInfo.java | 4 +- .../webtools/labelmanager/LabelInfo.java | 2 +- .../ofbiz/widget/form/MacroFormRenderer.java | 2 +- .../ofbiz/widget/html/HtmlFormWrapper.java | 2 +- .../ofbiz/widget/html/HtmlMenuWrapper.java | 2 +- .../ofbiz/widget/html/HtmlScreenRenderer.java | 2 +- .../ofbiz/widget/html/HtmlTreeRenderer.java | 4 +- .../org/ofbiz/widget/menu/ModelMenuItem.java | 2 +- .../widget/screen/MacroScreenRenderer.java | 22 ++--- .../widget/screen/MacroScreenViewHandler.java | 2 +- .../ofbiz/widget/screen/ScreenFactory.java | 2 +- .../src/org/ofbiz/widget/tree/ModelTree.java | 4 +- .../org/ofbiz/widget/tree/TreeFactory.java | 4 +- .../assetmaint/FixedAssetMaintServices.java | 2 +- .../ebay/src/org/ofbiz/ebay/EbayHelper.java | 20 ++-- .../src/org/ofbiz/ebay/EbayOrderServices.java | 88 +++++++++--------- .../org/ofbiz/ebay/ImportOrdersFromEbay.java | 92 +++++++++---------- .../src/org/ofbiz/ebaystore/EbayEvents.java | 14 +-- .../src/org/ofbiz/ebaystore/EbayStore.java | 26 +++--- .../ebaystore/EbayStoreAutoPreferences.java | 10 +- .../ebaystore/EbayStoreCategoryFacade.java | 2 +- .../org/ofbiz/ebaystore/EbayStoreHelper.java | 8 +- .../org/ofbiz/ebaystore/EbayStoreOptions.java | 2 +- .../org/ofbiz/ebaystore/EbayStoreOrder.java | 6 +- .../googlebase/GoogleBaseSearchEvents.java | 22 ++--- .../googlebase/ProductsExportToGoogle.java | 12 +-- ...zActiveDirectoryAuthenticationHandler.java | 2 +- .../OFBizLdapAuthenticationHandler.java | 2 +- .../ofbiz/oagis/OagisInventoryServices.java | 2 +- .../src/org/ofbiz/oagis/OagisServices.java | 2 +- .../ofbiz/oagis/OagisShipmentServices.java | 6 +- .../pos/src/org/ofbiz/pos/PosTransaction.java | 6 +- .../ofbiz/pos/adaptor/KeyboardAdaptor.java | 10 +- .../src/org/ofbiz/pos/component/Input.java | 8 +- .../src/org/ofbiz/pos/component/Journal.java | 2 +- .../org/ofbiz/pos/component/PosButton.java | 2 +- .../ofbiz/pos/component/PosButtonWrapper.java | 2 +- .../org/ofbiz/pos/device/DeviceLoader.java | 16 ++-- .../org/ofbiz/pos/event/ManagerEvents.java | 4 +- .../pos/jpos/service/KeyboardService.java | 2 +- .../ofbiz/pos/jpos/service/MsrKybService.java | 12 +-- .../pos/jpos/service/ScannerKybService.java | 2 +- .../org/ofbiz/pos/screen/ClientProfile.java | 10 +- .../org/ofbiz/pos/screen/ConfigureItem.java | 2 +- .../src/org/ofbiz/pos/screen/PaidInOut.java | 2 +- .../src/org/ofbiz/pos/screen/PosScreen.java | 2 +- .../ofbiz/workflow/WfApplicationServices.java | 2 +- .../src/org/ofbiz/workflow/WfFactory.java | 4 +- .../src/org/ofbiz/workflow/WfUtil.java | 2 +- .../ofbiz/workflow/client/WorkflowClient.java | 4 +- .../ofbiz/workflow/impl/ServiceCondition.java | 2 +- .../ofbiz/workflow/impl/WfActivityImpl.java | 4 +- .../impl/WfActivityToolImplementation.java | 2 +- .../ofbiz/workflow/impl/WfAssignmentImpl.java | 4 +- .../ofbiz/workflow/impl/WfProcessImpl.java | 2 +- .../ofbiz/workflow/impl/WfRequesterImpl.java | 2 +- 147 files changed, 464 insertions(+), 464 deletions(-) diff --git a/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java b/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java index c73bc0b8dc..cfe02d48ba 100644 --- a/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java +++ b/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java @@ -511,7 +511,7 @@ public class InvoiceWorker { // check if the invoice is posted and get the conversion from there List acctgTransEntries = invoice.getRelated("AcctgTrans"); if (UtilValidate.isNotEmpty(acctgTransEntries)) { - GenericValue acctgTransEntry = ((GenericValue) acctgTransEntries.get(0)).getRelated("AcctgTransEntry").get(0); + GenericValue acctgTransEntry = (acctgTransEntries.get(0)).getRelated("AcctgTransEntry").get(0); conversionRate = acctgTransEntry.getBigDecimal("amount").divide(acctgTransEntry.getBigDecimal("origAmount"), new MathContext(100)).setScale(decimals,rounding); } // check if a payment is applied and use the currency conversion from there @@ -532,7 +532,7 @@ public class InvoiceWorker { if (UtilValidate.isEmpty(conversionRate)) { List rates = EntityUtil.filterByDate(delegator.findByAnd("UomConversionDated", UtilMisc.toMap("uomIdTo", invoice.getString("currencyUomId"), "uomId", otherCurrencyUomId)), invoice.getTimestamp("invoiceDate")); if (UtilValidate.isNotEmpty(rates)) { - conversionRate = (BigDecimal.ONE).divide(((GenericValue) rates.get(0)).getBigDecimal("conversionFactor"), new MathContext(100)).setScale(decimals,rounding); + conversionRate = (BigDecimal.ONE).divide((rates.get(0)).getBigDecimal("conversionFactor"), new MathContext(100)).setScale(decimals,rounding); } else { Debug.logError("Could not find conversionrate for invoice: " + invoice.getString("invoiceId"), module); return new BigDecimal("1"); diff --git a/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java b/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java index d9f72c02be..8966aed2ef 100644 --- a/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java +++ b/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java @@ -221,7 +221,7 @@ public class PaymentGatewayServices { if (UtilValidate.isNotEmpty(otherPaymentMethodAndCreditCardList)) { Iterator otherPaymentMethodAndCreditCardIter = otherPaymentMethodAndCreditCardList.iterator(); while (otherPaymentMethodAndCreditCardIter.hasNext()) { - GenericValue otherPaymentMethodAndCreditCard = (GenericValue) otherPaymentMethodAndCreditCardIter.next(); + GenericValue otherPaymentMethodAndCreditCard = otherPaymentMethodAndCreditCardIter.next(); // change OrderPaymentPreference in memory only and call auth service orderPaymentPreference.set("paymentMethodId", otherPaymentMethodAndCreditCard.getString("paymentMethodId")); @@ -348,7 +348,7 @@ public class PaymentGatewayServices { List messages = FastList.newInstance(); Iterator payments = paymentPrefs.iterator(); while (payments.hasNext()) { - GenericValue paymentPref = (GenericValue) payments.next(); + GenericValue paymentPref = payments.next(); if (reAuth && "PAYMENT_AUTHORIZED".equals(paymentPref.getString("statusId"))) { String paymentConfig = null; // get the payment settings i.e. serviceName and config properties file name @@ -524,7 +524,7 @@ public class PaymentGatewayServices { } // try other expire dates if the expireDate is not after today, or if we called the auth service and resultBadExpire = true - if (tryOtherExpDates && (!UtilValidate.isDateAfterToday(creditCard.getString("expireDate")) || (processorResult != null && Boolean.TRUE.equals((Boolean) processorResult.get("resultBadExpire"))))) { + if (tryOtherExpDates && (!UtilValidate.isDateAfterToday(creditCard.getString("expireDate")) || (processorResult != null && Boolean.TRUE.equals(processorResult.get("resultBadExpire"))))) { // try adding 2, 3, 4 years later with the same month String expireDate = creditCard.getString("expireDate"); int dateSlash1 = expireDate.indexOf("/"); @@ -539,14 +539,14 @@ public class PaymentGatewayServices { processorResult = dispatcher.runSync(serviceName, processContext, TX_TIME, true); // note that these additional tries will only be done if the service return is not an error, in that case we let it pass through to the normal error handling - if (!ServiceUtil.isError(processorResult) && Boolean.TRUE.equals((Boolean) processorResult.get("resultBadExpire"))) { + if (!ServiceUtil.isError(processorResult) && Boolean.TRUE.equals(processorResult.get("resultBadExpire"))) { // okay, try one more year... year = StringUtil.addToNumberString(year, 1); creditCard.set("expireDate", month + "/" + year); processorResult = dispatcher.runSync(serviceName, processContext, TX_TIME, true); } - if (!ServiceUtil.isError(processorResult) && Boolean.TRUE.equals((Boolean) processorResult.get("resultBadExpire"))) { + if (!ServiceUtil.isError(processorResult) && Boolean.TRUE.equals(processorResult.get("resultBadExpire"))) { // okay, try one more year... and this is the last try year = StringUtil.addToNumberString(year, 1); creditCard.set("expireDate", month + "/" + year); @@ -554,7 +554,7 @@ public class PaymentGatewayServices { } // at this point if we have a successful result, let's save the new creditCard expireDate - if (!ServiceUtil.isError(processorResult) && Boolean.TRUE.equals((Boolean) processorResult.get("authResult"))) { + if (!ServiceUtil.isError(processorResult) && Boolean.TRUE.equals(processorResult.get("authResult"))) { // TODO: this is bad; we should be expiring the old card and creating a new one instead of editing it creditCard.store(); } @@ -662,7 +662,7 @@ public class PaymentGatewayServices { Collection emails = ContactHelper.getContactMech(billToPersonOrGroup.getRelatedOne("Party"), "PRIMARY_EMAIL", "EMAIL_ADDRESS", false); if (UtilValidate.isNotEmpty(emails)) { - billToEmail = (GenericValue) emails.iterator().next(); + billToEmail = emails.iterator().next(); } toContext.put("billToParty", billToPersonOrGroup); @@ -733,7 +733,7 @@ public class PaymentGatewayServices { List finished = FastList.newInstance(); Iterator payments = paymentPrefs.iterator(); while (payments.hasNext()) { - paymentPref = (GenericValue) payments.next(); + paymentPref = payments.next(); Map releaseContext = UtilMisc.toMap("userLogin", userLogin, "orderPaymentPreferenceId", paymentPref.getString("orderPaymentPreferenceId")); Map releaseResult = null; try { @@ -794,7 +794,7 @@ public class PaymentGatewayServices { while (i.hasNext()) { GenericValue respMsg = delegator.makeValue("PaymentGatewayRespMsg"); String respMsgId = delegator.getNextSeqId("PaymentGatewayRespMsg"); - String message = (String) i.next(); + String message = i.next(); respMsg.set("paymentGatewayRespMsgId", respMsgId); respMsg.set("paymentGatewayResponseId", responseId); respMsg.set("pgrMessage", message); @@ -819,7 +819,7 @@ public class PaymentGatewayServices { if (paymentList != null) { Iterator pi = paymentList.iterator(); while (pi.hasNext()) { - GenericValue pay = (GenericValue) pi.next(); + GenericValue pay = pi.next(); try { Map cancelResults = dispatcher.runSync("setPaymentStatus", UtilMisc.toMap("userLogin", userLogin, "paymentId", pay.get("paymentId"), "statusId", "PMNT_CANCELLED")); if (ServiceUtil.isError(cancelResults)) { @@ -985,7 +985,7 @@ public class PaymentGatewayServices { while (i.hasNext()) { GenericValue respMsg = delegator.makeValue("PaymentGatewayRespMsg"); String respMsgId = delegator.getNextSeqId("PaymentGatewayRespMsg"); - String message = (String) i.next(); + String message = i.next(); respMsg.set("paymentGatewayRespMsgId", respMsgId); respMsg.set("paymentGatewayResponseId", responseId); respMsg.set("pgrMessage", message); @@ -1011,7 +1011,7 @@ public class PaymentGatewayServices { if (paymentList != null) { Iterator pi = paymentList.iterator(); while (pi.hasNext()) { - GenericValue pay = (GenericValue) pi.next(); + GenericValue pay = pi.next(); try { Map cancelResults = dispatcher.runSync("setPaymentStatus", UtilMisc.toMap("userLogin", userLogin, "paymentId", pay.get("paymentId"), "statusId", "PMNT_CANCELLED")); if (ServiceUtil.isError(cancelResults)) { @@ -1072,7 +1072,7 @@ public class PaymentGatewayServices { if (orderItemBillings != null) { Iterator oii = orderItemBillings.iterator(); while (oii.hasNext()) { - GenericValue oib = (GenericValue) oii.next(); + GenericValue oib = oii.next(); String orderId = oib.getString("orderId"); if (testOrderId == null) { testOrderId = orderId; @@ -1169,7 +1169,7 @@ public class PaymentGatewayServices { if (UtilValidate.isNotEmpty(paymentPrefsBa)) { Iterator paymentsBa = paymentPrefsBa.iterator(); while (paymentsBa.hasNext()) { - GenericValue paymentPref = (GenericValue) paymentsBa.next(); + GenericValue paymentPref = paymentsBa.next(); BigDecimal authAmount = paymentPref.getBigDecimal("maxAmount"); if (authAmount == null) authAmount = ZERO; @@ -1539,7 +1539,7 @@ public class PaymentGatewayServices { // we have captured all the amount required break; } - GenericValue paymentApplication = (GenericValue)paymentApplicationsIt.next(); + GenericValue paymentApplication = paymentApplicationsIt.next(); GenericValue payment = paymentApplication.getRelatedOne("Payment"); if (payment.getString("paymentPreferenceId") != null) { // if the payment is reserved for a specific OrderPaymentPreference, @@ -1866,10 +1866,10 @@ public class PaymentGatewayServices { response.set("gatewayMessage", context.get("authMessage")); response.set("transactionDate", UtilDateTime.nowTimestamp()); - if (Boolean.TRUE.equals((Boolean) context.get("resultDeclined"))) response.set("resultDeclined", "Y"); - if (Boolean.TRUE.equals((Boolean) context.get("resultNsf"))) response.set("resultNsf", "Y"); - if (Boolean.TRUE.equals((Boolean) context.get("resultBadExpire"))) response.set("resultBadExpire", "Y"); - if (Boolean.TRUE.equals((Boolean) context.get("resultBadCardNumber"))) response.set("resultBadCardNumber", "Y"); + if (Boolean.TRUE.equals(context.get("resultDeclined"))) response.set("resultDeclined", "Y"); + if (Boolean.TRUE.equals(context.get("resultNsf"))) response.set("resultNsf", "Y"); + if (Boolean.TRUE.equals(context.get("resultBadExpire"))) response.set("resultBadExpire", "Y"); + if (Boolean.TRUE.equals(context.get("resultBadCardNumber"))) response.set("resultBadCardNumber", "Y"); // save the response savePgr(dctx, response); @@ -1881,7 +1881,7 @@ public class PaymentGatewayServices { while (i.hasNext()) { GenericValue respMsg = delegator.makeValue("PaymentGatewayRespMsg"); String respMsgId = delegator.getNextSeqId("PaymentGatewayRespMsg"); - String message = (String) i.next(); + String message = i.next(); respMsg.set("paymentGatewayRespMsgId", respMsgId); respMsg.set("paymentGatewayResponseId", responseId); respMsg.set("pgrMessage", message); @@ -1926,7 +1926,7 @@ public class PaymentGatewayServices { } creditCard.set("lastFailedAuthDate", nowTimestamp); - if (Boolean.TRUE.equals((Boolean) context.get("resultNsf"))) { + if (Boolean.TRUE.equals(context.get("resultNsf"))) { Long consecutiveFailedNsf = creditCard.getLong("consecutiveFailedNsf"); if (consecutiveFailedNsf == null) { creditCard.set("consecutiveFailedNsf", Long.valueOf(1)); @@ -1960,7 +1960,7 @@ public class PaymentGatewayServices { private static boolean needsNsfRetry(GenericValue orderPaymentPreference, Map processContext, Delegator delegator) throws GenericEntityException { boolean needsNsfRetry = false; - if (Boolean.TRUE.equals((Boolean) processContext.get("resultNsf"))) { + if (Boolean.TRUE.equals(processContext.get("resultNsf"))) { // only track this for auto-orders, since we will only not fail and re-try on those GenericValue orderHeader = orderPaymentPreference.getRelatedOne("OrderHeader"); if (UtilValidate.isNotEmpty(orderHeader.getString("autoOrderShoppingListId"))) { @@ -2190,7 +2190,7 @@ public class PaymentGatewayServices { while (i.hasNext()) { GenericValue respMsg = delegator.makeValue("PaymentGatewayRespMsg"); String respMsgId = delegator.getNextSeqId("PaymentGatewayRespMsg"); - String message = (String) i.next(); + String message = i.next(); respMsg.set("paymentGatewayRespMsgId", respMsgId); respMsg.set("paymentGatewayResponseId", responseId); respMsg.set("pgrMessage", message); @@ -2469,7 +2469,7 @@ public class PaymentGatewayServices { while (i.hasNext()) { GenericValue respMsg = delegator.makeValue("PaymentGatewayRespMsg"); String respMsgId = delegator.getNextSeqId("PaymentGatewayRespMsg"); - String message = (String) i.next(); + String message = i.next(); respMsg.set("paymentGatewayRespMsgId", respMsgId); respMsg.set("paymentGatewayResponseId", responseId); respMsg.set("pgrMessage", message); @@ -2613,7 +2613,7 @@ public class PaymentGatewayServices { if (eli != null) { Debug.logInfo("Processing failed order re-auth(s)", module); GenericValue value = null; - while (((value = (GenericValue) eli.next()) != null)) { + while (((value = eli.next()) != null)) { String orderId = value.getString("orderId"); if (!processList.contains(orderId)) { // just try each order once try { @@ -2662,7 +2662,7 @@ public class PaymentGatewayServices { if (eli != null) { Debug.logInfo("Processing failed order re-auth(s)", module); GenericValue value = null; - while (((value = (GenericValue) eli.next()) != null)) { + while (((value = eli.next()) != null)) { String orderId = value.getString("orderId"); if (!processList.contains(orderId)) { // just try each order once try { @@ -3382,7 +3382,7 @@ public class PaymentGatewayServices { String lastNumberStr = expireDate.substring(expireDate.length() - 1); int lastNumber = Integer.parseInt(lastNumberStr); - if ((float) lastNumber / 2.0 == 0.0) { + if (lastNumber / 2.0 == 0.0) { return alwaysBadExpireProcessor(dctx, context); } else { return alwaysApproveProcessor(dctx, context); diff --git a/applications/accounting/src/org/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java b/applications/accounting/src/org/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java index d2e6c9702f..0157a79f91 100644 --- a/applications/accounting/src/org/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java +++ b/applications/accounting/src/org/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java @@ -125,7 +125,7 @@ public class AIMPaymentServices { // CAPTURE_ONLY is a "force" transaction to be used if there is no prior authorization props.put("transType", "PRIOR_AUTH_CAPTURE"); //props.put("transType","CAPTURE_ONLY"); - props.put("cardtype", (String)creditCard.get("cardType")); + props.put("cardtype", creditCard.get("cardType")); buildCaptureTransaction(context,props,request); Map validateResults = validateRequest(context, props, request); String respMsg = (String)validateResults.get(ModelService.RESPONSE_MESSAGE); @@ -165,7 +165,7 @@ public class AIMPaymentServices { buildGatewayResponeConfig(context, props, request); buildEmailSettings(context, props, request); props.put("transType", "CREDIT"); - props.put("cardtype", (String)creditCard.get("cardType")); + props.put("cardtype", creditCard.get("cardType")); buildRefundTransaction(context, props, request); Map validateResults = validateRequest(context, props, request); String respMsg = (String)validateResults.get(ModelService.RESPONSE_MESSAGE); @@ -398,7 +398,7 @@ public class AIMPaymentServices { props.put("password", password); props.put("trankey", tranKey); if (cc != null) { - props.put("cardtype", (String)cc.get("cardType")); + props.put("cardtype", cc.get("cardType")); } if (AIMProperties == null) { AIMProperties = props; diff --git a/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalEvents.java b/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalEvents.java index bc67ce16e7..7cb99394f2 100644 --- a/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalEvents.java +++ b/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalEvents.java @@ -250,7 +250,7 @@ public class PayPalEvents { Set keySet = parametersMap.keySet(); Iterator 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); if (UtilValidate.isNotEmpty(name) && "payer_status".equalsIgnoreCase(name) && @@ -419,7 +419,7 @@ public class PayPalEvents { if (paymentPrefs.size() > 0) { Iterator 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; @@ -504,7 +504,7 @@ public class PayPalEvents { if ((results == null) || (results.get(ModelService.RESPONSE_MESSAGE).equals(ModelService.RESPOND_ERROR))) { Debug.logError((String) results.get(ModelService.ERROR_MESSAGE), module); - request.setAttribute("_ERROR_MESSAGE_", (String) results.get(ModelService.ERROR_MESSAGE)); + request.setAttribute("_ERROR_MESSAGE_", results.get(ModelService.ERROR_MESSAGE)); return false; } diff --git a/applications/content/src/org/ofbiz/content/content/ContentWorker.java b/applications/content/src/org/ofbiz/content/content/ContentWorker.java index 49857ea802..e6031b9305 100644 --- a/applications/content/src/org/ofbiz/content/content/ContentWorker.java +++ b/applications/content/src/org/ofbiz/content/content/ContentWorker.java @@ -437,19 +437,19 @@ public class ContentWorker implements org.ofbiz.widget.ContentWorkerInterface { List topicList = content.getRelatedByAnd("ToContentAssoc", UtilMisc.toMap("contentAssocTypeId", "TOPIC")); List topics = FastList.newInstance(); for (int i = 0; i < topicList.size(); i++) { - GenericValue assoc = (GenericValue) topicList.get(i); + GenericValue assoc = topicList.get(i); topics.add(assoc.getString("contentId")); } List keywordList = content.getRelatedByAnd("ToContentAssoc", UtilMisc.toMap("contentAssocTypeId", "KEYWORD")); List keywords = FastList.newInstance(); for (int i = 0; i < keywordList.size(); i++) { - GenericValue assoc = (GenericValue) keywordList.get(i); + GenericValue assoc = keywordList.get(i); keywords.add(assoc.getString("contentId")); } List purposeValueList = content.getRelatedCache("ContentPurpose"); List purposes = FastList.newInstance(); for (int i = 0; i < purposeValueList.size(); i++) { - GenericValue purposeValue = (GenericValue) purposeValueList.get(i); + GenericValue purposeValue = purposeValueList.get(i); purposes.add(purposeValue.getString("contentPurposeTypeId")); } List contentTypeAncestry = FastList.newInstance(); @@ -490,7 +490,7 @@ public class ContentWorker implements org.ofbiz.widget.ContentWorkerInterface { Map assocContext = FastMap.newInstance(); assocContext.put("related", relatedAssocs); while (it.hasNext()) { - GenericValue assocValue = (GenericValue) it.next(); + GenericValue assocValue = it.next(); contentAssocTypeId = (String) assocValue.get("contentAssocTypeId"); assocContext.put("contentAssocTypeId", contentAssocTypeId); //assocContext.put("contentTypeId", assocValue.get("contentTypeId")); @@ -530,7 +530,7 @@ public class ContentWorker implements org.ofbiz.widget.ContentWorkerInterface { return false; } - Map currentNode = (Map)nodeTrail.get(sz - 1); + Map currentNode = nodeTrail.get(sz - 1); Boolean isReturnAfter = (Boolean)currentNode.get("isReturnAfter"); if (isReturnAfter != null && isReturnAfter.booleanValue()) { return false; @@ -540,7 +540,7 @@ public class ContentWorker implements org.ofbiz.widget.ContentWorkerInterface { if (UtilValidate.isNotEmpty(kids)) { int idx = 0; while (idx < kids.size()) { - currentNode = (Map)kids.get(idx); + currentNode = kids.get(idx); ContentWorker.traceNodeTrail("12",nodeTrail); Boolean isPick = (Boolean)currentNode.get("isPick"); @@ -568,9 +568,9 @@ public class ContentWorker implements org.ofbiz.widget.ContentWorkerInterface { if (!inProgress) { // look for next sibling while (sz > 1) { - currentNode = (Map)nodeTrail.remove(--sz); + currentNode = nodeTrail.remove(--sz); ContentWorker.traceNodeTrail("15",nodeTrail); - Map parentNode = (Map) nodeTrail.get(sz - 1); + Map parentNode = nodeTrail.get(sz - 1); kids = (List>)parentNode.get("kids"); if (kids == null) { continue; @@ -578,7 +578,7 @@ public class ContentWorker implements org.ofbiz.widget.ContentWorkerInterface { int idx = kids.indexOf(currentNode); while (idx < (kids.size() - 1)) { - currentNode = (Map)kids.get(idx + 1); + currentNode = kids.get(idx + 1); Boolean isFollow = (Boolean)currentNode.get("isFollow"); if (isFollow == null || !isFollow.booleanValue()) { idx++; diff --git a/applications/content/src/org/ofbiz/content/webapp/ftl/LimitedSubContentCacheTransform.java b/applications/content/src/org/ofbiz/content/webapp/ftl/LimitedSubContentCacheTransform.java index bbc227f4a3..5d1ce7a67a 100644 --- a/applications/content/src/org/ofbiz/content/webapp/ftl/LimitedSubContentCacheTransform.java +++ b/applications/content/src/org/ofbiz/content/webapp/ftl/LimitedSubContentCacheTransform.java @@ -117,10 +117,10 @@ public class LimitedSubContentCacheTransform implements TemplateTransformModel { } Map whenMap = FastMap.newInstance(); - whenMap.put("followWhen", (String) templateRoot.get("followWhen")); - whenMap.put("pickWhen", (String) templateRoot.get("pickWhen")); - whenMap.put("returnBeforePickWhen", (String) templateRoot.get("returnBeforePickWhen")); - whenMap.put("returnAfterPickWhen", (String) templateRoot.get("returnAfterPickWhen")); + whenMap.put("followWhen", templateRoot.get("followWhen")); + whenMap.put("pickWhen", templateRoot.get("pickWhen")); + whenMap.put("returnBeforePickWhen", templateRoot.get("returnBeforePickWhen")); + whenMap.put("returnAfterPickWhen", templateRoot.get("returnAfterPickWhen")); templateRoot.put("whenMap", whenMap); String fromDateStr = (String) templateRoot.get("fromDateStr"); diff --git a/applications/content/src/org/ofbiz/content/webapp/ftl/RenderContentAsText.java b/applications/content/src/org/ofbiz/content/webapp/ftl/RenderContentAsText.java index 009a5f7b85..ad5a7533c4 100644 --- a/applications/content/src/org/ofbiz/content/webapp/ftl/RenderContentAsText.java +++ b/applications/content/src/org/ofbiz/content/webapp/ftl/RenderContentAsText.java @@ -223,7 +223,7 @@ public class RenderContentAsText implements TemplateTransformModel { } out.write("Edit"); diff --git a/applications/content/src/org/ofbiz/content/webapp/ftl/RenderContentTransform.java b/applications/content/src/org/ofbiz/content/webapp/ftl/RenderContentTransform.java index 067517ac7d..0ead79741e 100644 --- a/applications/content/src/org/ofbiz/content/webapp/ftl/RenderContentTransform.java +++ b/applications/content/src/org/ofbiz/content/webapp/ftl/RenderContentTransform.java @@ -138,7 +138,7 @@ public class RenderContentTransform implements TemplateTransformModel { } out.write("Edit"); diff --git a/applications/content/src/org/ofbiz/content/webapp/ftl/RenderSubContentCacheTransform.java b/applications/content/src/org/ofbiz/content/webapp/ftl/RenderSubContentCacheTransform.java index 814b97c7b2..12b01f409b 100644 --- a/applications/content/src/org/ofbiz/content/webapp/ftl/RenderSubContentCacheTransform.java +++ b/applications/content/src/org/ofbiz/content/webapp/ftl/RenderSubContentCacheTransform.java @@ -268,7 +268,7 @@ public class RenderSubContentCacheTransform implements TemplateTransformModel { if (Debug.infoOn()) Debug.logInfo("in Render(2), contentIdTo ." + contentIdTo , module); out.write("Edit"); diff --git a/applications/content/src/org/ofbiz/content/webapp/ftl/TraverseSubContentCacheTransform.java b/applications/content/src/org/ofbiz/content/webapp/ftl/TraverseSubContentCacheTransform.java index b08fae7472..ab4c0c2144 100644 --- a/applications/content/src/org/ofbiz/content/webapp/ftl/TraverseSubContentCacheTransform.java +++ b/applications/content/src/org/ofbiz/content/webapp/ftl/TraverseSubContentCacheTransform.java @@ -117,10 +117,10 @@ public class TraverseSubContentCacheTransform implements TemplateTransformModel final Map traverseContext = FastMap.newInstance(); traverseContext.put("delegator", delegator); Map whenMap = FastMap.newInstance(); - whenMap.put("followWhen", (String)templateRoot.get("followWhen")); - whenMap.put("pickWhen", (String)templateRoot.get("pickWhen")); - whenMap.put("returnBeforePickWhen", (String)templateRoot.get("returnBeforePickWhen")); - whenMap.put("returnAfterPickWhen", (String)templateRoot.get("returnAfterPickWhen")); + whenMap.put("followWhen", templateRoot.get("followWhen")); + whenMap.put("pickWhen", templateRoot.get("pickWhen")); + whenMap.put("returnBeforePickWhen", templateRoot.get("returnBeforePickWhen")); + whenMap.put("returnAfterPickWhen", templateRoot.get("returnAfterPickWhen")); traverseContext.put("whenMap", whenMap); env.setVariable("whenMap", FreeMarkerWorker.autoWrap(whenMap, env)); String fromDateStr = (String)templateRoot.get("fromDateStr"); diff --git a/applications/content/src/org/ofbiz/content/webapp/ftl/TraverseSubContentTransform.java b/applications/content/src/org/ofbiz/content/webapp/ftl/TraverseSubContentTransform.java index 53e65ccc16..1bd157bf7c 100644 --- a/applications/content/src/org/ofbiz/content/webapp/ftl/TraverseSubContentTransform.java +++ b/applications/content/src/org/ofbiz/content/webapp/ftl/TraverseSubContentTransform.java @@ -136,10 +136,10 @@ public class TraverseSubContentTransform implements TemplateTransformModel { final Map traverseContext = FastMap.newInstance(); traverseContext.put("delegator", delegator); Map whenMap = FastMap.newInstance(); - whenMap.put("followWhen", (String)templateCtx.get("followWhen")); - whenMap.put("pickWhen", (String)templateCtx.get("pickWhen")); - whenMap.put("returnBeforePickWhen", (String)templateCtx.get("returnBeforePickWhen")); - whenMap.put("returnAfterPickWhen", (String)templateCtx.get("returnAfterPickWhen")); + whenMap.put("followWhen", templateCtx.get("followWhen")); + whenMap.put("pickWhen", templateCtx.get("pickWhen")); + whenMap.put("returnBeforePickWhen", templateCtx.get("returnBeforePickWhen")); + whenMap.put("returnAfterPickWhen", templateCtx.get("returnAfterPickWhen")); traverseContext.put("whenMap", whenMap); String fromDateStr = (String)templateCtx.get("fromDateStr"); String thruDateStr = (String)templateCtx.get("thruDateStr"); diff --git a/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/InventoryEventPlannedServices.java b/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/InventoryEventPlannedServices.java index 0ef4adabba..ea07071076 100644 --- a/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/InventoryEventPlannedServices.java +++ b/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/InventoryEventPlannedServices.java @@ -72,7 +72,7 @@ public class InventoryEventPlannedServices { mrpEvent.put("isLate", (isLate? "Y": "N")); mrpEvent.create(); } else { - BigDecimal qties = newQuantity.add((BigDecimal)mrpEvent.getBigDecimal("quantity")); + BigDecimal qties = newQuantity.add(mrpEvent.getBigDecimal("quantity")); mrpEvent.put("quantity", qties.doubleValue()); if (!UtilValidate.isEmpty(eventName)) { String existingEventName = mrpEvent.getString("eventName"); diff --git a/applications/marketing/src/org/ofbiz/sfa/vcard/VCard.java b/applications/marketing/src/org/ofbiz/sfa/vcard/VCard.java index 95cb6c5c20..0474399e54 100644 --- a/applications/marketing/src/org/ofbiz/sfa/vcard/VCard.java +++ b/applications/marketing/src/org/ofbiz/sfa/vcard/VCard.java @@ -72,8 +72,8 @@ public class VCard { public static final String module = VCard.class.getName(); public static Map importVCard(DispatchContext dctx, Map context) { - LocalDispatcher dispatcher = (LocalDispatcher) dctx.getDispatcher(); - Delegator delegator = (Delegator) dctx.getDelegator(); + LocalDispatcher dispatcher = dctx.getDispatcher(); + Delegator delegator = dctx.getDelegator(); Map result = ServiceUtil.returnSuccess(); Address workAddress = null; String email = null; @@ -213,7 +213,7 @@ public class VCard { } public static Map exportVCard(DispatchContext dctx, Map context) { - Delegator delegator = (Delegator) dctx.getDelegator(); + Delegator delegator = dctx.getDelegator(); String partyId = (String) context.get("partyId"); File file = null; try { diff --git a/applications/order/src/org/ofbiz/order/OrderManagerEvents.java b/applications/order/src/org/ofbiz/order/OrderManagerEvents.java index 27df7745ba..9abd2a5be4 100644 --- a/applications/order/src/org/ofbiz/order/OrderManagerEvents.java +++ b/applications/order/src/org/ofbiz/order/OrderManagerEvents.java @@ -104,7 +104,7 @@ public class OrderManagerEvents { if ((results == null) || (results.get(ModelService.RESPONSE_MESSAGE).equals(ModelService.RESPOND_ERROR))) { Debug.logError((String) results.get(ModelService.ERROR_MESSAGE), module); - request.setAttribute("_ERROR_MESSAGE_", (String) results.get(ModelService.ERROR_MESSAGE)); + request.setAttribute("_ERROR_MESSAGE_", results.get(ModelService.ERROR_MESSAGE)); return "error"; } } @@ -229,7 +229,7 @@ public class OrderManagerEvents { if ((results == null) || (results.get(ModelService.RESPONSE_MESSAGE).equals(ModelService.RESPOND_ERROR))) { Debug.logError((String) results.get(ModelService.ERROR_MESSAGE), module); - request.setAttribute("_ERROR_MESSAGE_", (String) results.get(ModelService.ERROR_MESSAGE)); + request.setAttribute("_ERROR_MESSAGE_", results.get(ModelService.ERROR_MESSAGE)); return "error"; } } diff --git a/applications/order/src/org/ofbiz/order/finaccount/FinAccountHelper.java b/applications/order/src/org/ofbiz/order/finaccount/FinAccountHelper.java index 08ab984855..51ea2e6261 100644 --- a/applications/order/src/org/ofbiz/order/finaccount/FinAccountHelper.java +++ b/applications/order/src/org/ofbiz/order/finaccount/FinAccountHelper.java @@ -81,7 +81,7 @@ public class FinAccountHelper { */ public static BigDecimal addFirstEntryAmount(BigDecimal initialValue, List transactions, String fieldName, int decimals, int rounding) throws GenericEntityException { if ((transactions != null) && (transactions.size() == 1)) { - GenericValue firstEntry = (GenericValue) transactions.get(0); + GenericValue firstEntry = transactions.get(0); if (firstEntry.get(fieldName) != null) { BigDecimal valueToAdd = firstEntry.getBigDecimal(fieldName); return initialValue.add(valueToAdd).setScale(decimals, rounding); @@ -163,7 +163,7 @@ public class FinAccountHelper { Debug.logError("Multiple fin accounts found", module); return null; } else { - return (GenericValue) accounts.get(0); + return accounts.get(0); } } diff --git a/applications/order/src/org/ofbiz/order/order/OrderLookupServices.java b/applications/order/src/org/ofbiz/order/order/OrderLookupServices.java index 90e84a7563..361384cc61 100644 --- a/applications/order/src/org/ofbiz/order/order/OrderLookupServices.java +++ b/applications/order/src/org/ofbiz/order/order/OrderLookupServices.java @@ -278,8 +278,8 @@ public class OrderLookupServices { // Shipment Method String shipmentMethod = (String) context.get("shipmentMethod"); if (UtilValidate.isNotEmpty(shipmentMethod)) { - String carrierPartyId = (String) shipmentMethod.substring(0, shipmentMethod.indexOf("@")); - String ShippingMethodTypeId = (String) shipmentMethod.substring(shipmentMethod.indexOf("@")+1); + String carrierPartyId = shipmentMethod.substring(0, shipmentMethod.indexOf("@")); + String ShippingMethodTypeId = shipmentMethod.substring(shipmentMethod.indexOf("@")+1); dve.addMemberEntity("OISG", "OrderItemShipGroup"); dve.addAlias("OISG", "shipmentMethodTypeId"); dve.addAlias("OISG", "carrierPartyId"); diff --git a/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java b/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java index f97c547535..6b892a2533 100644 --- a/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java +++ b/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java @@ -260,7 +260,7 @@ public class OrderReturnServices { String xslfoAttachScreenLocation = productStoreEmail.getString("xslfoAttachScreenLocation"); sendMap.put("xslfoAttachScreenLocation", xslfoAttachScreenLocation); - ResourceBundleMapWrapper uiLabelMap = (ResourceBundleMapWrapper) UtilProperties.getResourceBundleMap("EcommerceUiLabels", locale); + ResourceBundleMapWrapper uiLabelMap = UtilProperties.getResourceBundleMap("EcommerceUiLabels", locale); uiLabelMap.addBottomResourceBundle("OrderUiLabels"); uiLabelMap.addBottomResourceBundle("CommonUiLabels"); diff --git a/applications/order/src/org/ofbiz/order/order/OrderServices.java b/applications/order/src/org/ofbiz/order/order/OrderServices.java index 446aeb9fa2..d7da7dca94 100644 --- a/applications/order/src/org/ofbiz/order/order/OrderServices.java +++ b/applications/order/src/org/ofbiz/order/order/OrderServices.java @@ -357,7 +357,7 @@ public class OrderServices { if (ServiceUtil.isError(invReqResult)) { errorMessages.add(invReqResult.get(ModelService.ERROR_MESSAGE)); errorMessages.addAll((List) invReqResult.get(ModelService.ERROR_MESSAGE_LIST)); - } else if (!"Y".equals((String) invReqResult.get("availableOrNotRequired"))) { + } else if (!"Y".equals(invReqResult.get("availableOrNotRequired"))) { String invErrMsg = UtilProperties.getMessage(resource_error, "product.out_of_stock", new Object[] { getProductName(product, itemName), currentProductId }, locale); Debug.logWarning(invErrMsg, module); diff --git a/applications/order/src/org/ofbiz/order/requirement/RequirementServices.java b/applications/order/src/org/ofbiz/order/requirement/RequirementServices.java index 3dee63a871..f1254b3a74 100644 --- a/applications/order/src/org/ofbiz/order/requirement/RequirementServices.java +++ b/applications/order/src/org/ofbiz/order/requirement/RequirementServices.java @@ -107,7 +107,7 @@ public class RequirementServices { // get an available supplier product, preferably the one with the smallest minimum quantity to order, followed by price String supplierKey = partyId + "^" + productId; - GenericValue supplierProduct = (GenericValue) suppliers.get(supplierKey); + GenericValue supplierProduct = suppliers.get(supplierKey); if (supplierProduct == null) { conditions = UtilMisc.toList( // TODO: it is possible to restrict to quantity > minimumOrderQuantity, but then the entire requirement must be skipped diff --git a/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java b/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java index f6af99b871..7778eb6b4d 100644 --- a/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java +++ b/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java @@ -637,7 +637,7 @@ public class CheckOutEvents { Delegator delegator = (Delegator) request.getAttribute("delegator"); ShoppingCart cart = ShoppingCartEvents.getCartObject(request); GenericValue productStore = ProductStoreWorker.getProductStore(cart.getProductStoreId(), delegator); - String paymentMethodTypeId = (String) request.getParameter("paymentMethodTypeId"); + String paymentMethodTypeId = request.getParameter("paymentMethodTypeId"); if ("EXT_PAYPAL".equals(paymentMethodTypeId) || cart.getPaymentMethodTypeIds().contains("EXT_PAYPAL")) { List payPalProdStorePaySettings = null; try { diff --git a/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java b/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java index dcc6bdce73..5b1c060291 100644 --- a/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java +++ b/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java @@ -498,7 +498,7 @@ public class ShoppingCart implements Iterable, Serializable { GenericValue supplierProduct = null; // Check for existing cart item. for (int i = 0; i < this.cartLines.size(); i++) { - ShoppingCartItem sci = (ShoppingCartItem) cartLines.get(i); + ShoppingCartItem sci = cartLines.get(i); if (sci.equals(productId, reservStart, reservLength, reservPersons, accommodationMapId, accommodationSpotId, features, attributes, prodCatalogId,selectedAmount, configWrapper, itemType, itemGroup, false)) { @@ -651,7 +651,7 @@ public class ShoppingCart implements Iterable, Serializable { public ShoppingCartItem findCartItem(String productId, Map features, Map attributes, String prodCatalogId, BigDecimal selectedAmount) { // Check for existing cart item. for (int i = 0; i < this.cartLines.size(); i++) { - ShoppingCartItem cartItem = (ShoppingCartItem) cartLines.get(i); + ShoppingCartItem cartItem = cartLines.get(i); if (cartItem.equals(productId, features, attributes, prodCatalogId, selectedAmount)) { return cartItem; @@ -713,7 +713,7 @@ public class ShoppingCart implements Iterable, Serializable { public void removeEmptyCartItems() { // Check for existing cart item. for (int i = 0; i < this.cartLines.size();) { - ShoppingCartItem cartItem = (ShoppingCartItem) cartLines.get(i); + ShoppingCartItem cartItem = cartLines.get(i); if (cartItem.getQuantity().compareTo(BigDecimal.ZERO) == 0) { this.clearItemShipInfo(cartItem); @@ -806,7 +806,7 @@ public class ShoppingCart implements Iterable, Serializable { public boolean containAnyWorkEffortCartItems() { // Check for existing cart item. for (int i = 0; i < this.cartLines.size(); i++) { - ShoppingCartItem cartItem = (ShoppingCartItem) cartLines.get(i); + ShoppingCartItem cartItem = cartLines.get(i); if (cartItem.getItemType().equals("RENTAL_ORDER_ITEM")) { // create workeffort items? return true; } @@ -817,7 +817,7 @@ public class ShoppingCart implements Iterable, Serializable { public boolean containAllWorkEffortCartItems() { // Check for existing cart item. for (int i = 0; i < this.cartLines.size(); i++) { - ShoppingCartItem cartItem = (ShoppingCartItem) cartLines.get(i); + ShoppingCartItem cartItem = cartLines.get(i); if (!cartItem.getItemType().equals("RENTAL_ORDER_ITEM")) { // not a item to create workefforts? return false; } @@ -831,7 +831,7 @@ public class ShoppingCart implements Iterable, Serializable { */ public boolean containOnlyDigitalGoods() { for (int i = 0; i < this.cartLines.size(); i++) { - ShoppingCartItem cartItem = (ShoppingCartItem) cartLines.get(i); + ShoppingCartItem cartItem = cartLines.get(i); GenericValue product = cartItem.getProduct(); try { GenericValue productType = product.getRelatedOneCache("ProductType"); @@ -879,14 +879,14 @@ public class ShoppingCart implements Iterable, Serializable { if (cartLines.size() <= index) { return null; } - return (ShoppingCartItem) cartLines.get(index); + return cartLines.get(index); } public ShoppingCartItem findCartItem(String orderItemSeqId) { if (orderItemSeqId != null) { for (int i = 0; i < this.cartLines.size(); i++) { - ShoppingCartItem cartItem = (ShoppingCartItem) cartLines.get(i); + ShoppingCartItem cartItem = cartLines.get(i); String itemSeqId = cartItem.getOrderItemSeqId(); if (itemSeqId != null && orderItemSeqId.equals(itemSeqId)) { return cartItem; @@ -908,7 +908,7 @@ public class ShoppingCart implements Iterable, Serializable { } if (index < 0) return; if (cartLines.size() <= index) return; - ShoppingCartItem item = (ShoppingCartItem) cartLines.remove(index); + ShoppingCartItem item = cartLines.remove(index); // set quantity to 0 to trigger necessary events item.setQuantity(BigDecimal.ZERO, dispatcher, this); diff --git a/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java b/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java index 6294985bf0..e3ea9a3868 100644 --- a/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java +++ b/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java @@ -504,7 +504,7 @@ public class ShoppingCartHelper { try { if (Debug.verboseOn()) Debug.logVerbose("Bulk Adding to cart requirement [" + quantity + "] of [" + productId + "]", module); int index = this.cart.addOrIncreaseItem(productId, null, quantity, null, null, null, requirement.getTimestamp("requiredByDate"), null, null, null, catalogId, null, null, itemGroupNumber, null, dispatcher); - ShoppingCartItem sci = (ShoppingCartItem)this.cart.items().get(index); + ShoppingCartItem sci = this.cart.items().get(index); sci.setRequirementId(requirementId); } catch (CartItemModifyException e) { return ServiceUtil.returnError(e.getMessage()); diff --git a/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java b/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java index 8a3ae04317..f62d53d228 100644 --- a/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java +++ b/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java @@ -924,7 +924,7 @@ public class ShoppingCartItem implements java.io.Serializable { while (BigDecimal.valueOf(dayCount).compareTo(reservLength) < 0) { GenericValue techDataCalendarExcDay = null; // find an existing Day exception record - Timestamp exceptionDateStartTime = new Timestamp((long) (reservStart.getTime() + (dayCount++ * 86400000))); + Timestamp exceptionDateStartTime = new Timestamp((reservStart.getTime() + (dayCount++ * 86400000))); try { techDataCalendarExcDay = delegator.findByPrimaryKey("TechDataCalendarExcDay", UtilMisc.toMap("calendarId", fixedAsset.get("calendarId"), "exceptionDateStartTime", exceptionDateStartTime)); @@ -976,7 +976,7 @@ public class ShoppingCartItem implements java.io.Serializable { Debug.logError("Error calling isStoreInventoryAvailableOrNotRequired service, result is: " + invReqResult, module); throw new CartItemModifyException((String) invReqResult.get(ModelService.ERROR_MESSAGE)); } - inventoryAvailable = "Y".equals((String) invReqResult.get("availableOrNotRequired")); + inventoryAvailable = "Y".equals(invReqResult.get("availableOrNotRequired")); } catch (GenericServiceException e) { String errMsg = "Fatal error calling inventory checking services: " + e.toString(); Debug.logError(e, errMsg, module); diff --git a/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java b/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java index 47398b70f3..376df16f13 100644 --- a/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java +++ b/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java @@ -276,7 +276,7 @@ public class ShoppingCartServices { if (UtilValidate.isNotEmpty(orderPaymentPrefs)) { Iterator oppi = orderPaymentPrefs.iterator(); while (oppi.hasNext()) { - GenericValue opp = (GenericValue) oppi.next(); + GenericValue opp = oppi.next(); String paymentId = opp.getString("paymentMethodId"); if (paymentId == null) { paymentId = opp.getString("paymentMethodTypeId"); @@ -560,7 +560,7 @@ public class ShoppingCartServices { // set the item's ship group info List shipGroupAssocs = orh.getOrderItemShipGroupAssocs(item); for (int g = 0; g < shipGroupAssocs.size(); g++) { - GenericValue sgAssoc = (GenericValue) shipGroupAssocs.get(g); + GenericValue sgAssoc = shipGroupAssocs.get(g); BigDecimal shipGroupQty = OrderReadHelper.getOrderItemShipGroupQuantity(sgAssoc); if (shipGroupQty == null) { shipGroupQty = BigDecimal.ZERO; @@ -720,7 +720,7 @@ public class ShoppingCartServices { // put them in a map: the key/values pairs are quoteItemSeqId/List of adjs Map> orderAdjsMap = FastMap.newInstance() ; for (GenericValue quoteAdj : quoteAdjs) { - List orderAdjs = (List)orderAdjsMap.get(UtilValidate.isNotEmpty(quoteAdj.getString("quoteItemSeqId")) ? quoteAdj.getString("quoteItemSeqId") : quoteId); + List orderAdjs = orderAdjsMap.get(UtilValidate.isNotEmpty(quoteAdj.getString("quoteItemSeqId")) ? quoteAdj.getString("quoteItemSeqId") : quoteId); if (orderAdjs == null) { orderAdjs = FastList.newInstance(); orderAdjsMap.put(UtilValidate.isNotEmpty(quoteAdj.getString("quoteItemSeqId")) ? quoteAdj.getString("quoteItemSeqId") : quoteId, orderAdjs); @@ -852,7 +852,7 @@ public class ShoppingCartServices { // If applyQuoteAdjustments is set to false then standard cart adjustments are used. if (applyQuoteAdjustments) { // The cart adjustments, derived from quote adjustments, are added to the cart - List adjs = (List)orderAdjsMap.get(quoteId); + List adjs = orderAdjsMap.get(quoteId); if (adjs != null) { cart.getAdjustments().addAll(adjs); } @@ -863,7 +863,7 @@ public class ShoppingCartServices { ShoppingCartItem item = (ShoppingCartItem) i.next(); String orderItemSeqId = item.getOrderItemSeqId(); if (orderItemSeqId != null) { - adjs = (List)orderAdjsMap.get(orderItemSeqId); + adjs = orderAdjsMap.get(orderItemSeqId); } else { adjs = null; } diff --git a/applications/order/src/org/ofbiz/order/shoppingcart/shipping/ShippingEstimateWrapper.java b/applications/order/src/org/ofbiz/order/shoppingcart/shipping/ShippingEstimateWrapper.java index 12cfad3934..fb8da975d0 100644 --- a/applications/order/src/org/ofbiz/order/shoppingcart/shipping/ShippingEstimateWrapper.java +++ b/applications/order/src/org/ofbiz/order/shoppingcart/shipping/ShippingEstimateWrapper.java @@ -116,7 +116,7 @@ public class ShippingEstimateWrapper { } public BigDecimal getShippingEstimate(GenericValue storeCarrierShipMethod) { - return (BigDecimal) shippingEstimates.get(storeCarrierShipMethod); + return shippingEstimates.get(storeCarrierShipMethod); } } diff --git a/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java b/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java index 0672594ec5..a5515125dc 100644 --- a/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java +++ b/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java @@ -135,7 +135,7 @@ public class ShoppingListServices { if (eli != null) { GenericValue shoppingList; - while (((shoppingList = (GenericValue) eli.next()) != null)) { + while (((shoppingList = eli.next()) != null)) { Timestamp lastOrder = shoppingList.getTimestamp("lastOrderedDate"); GenericValue recurrenceInfo = null; recurrenceInfo = shoppingList.getRelatedOne("RecurrenceInfo"); diff --git a/applications/order/src/org/ofbiz/order/task/TaskEvents.java b/applications/order/src/org/ofbiz/order/task/TaskEvents.java index 3c0e1d2135..3cf18f8fc6 100644 --- a/applications/order/src/org/ofbiz/order/task/TaskEvents.java +++ b/applications/order/src/org/ofbiz/order/task/TaskEvents.java @@ -74,7 +74,7 @@ public class TaskEvents { "fromDate", fromDate, "result", parameterMap, "userLogin", userLogin); result = dispatcher.runSync("wfCompleteAssignment", context); if (result.containsKey(ModelService.RESPOND_ERROR)) { - request.setAttribute("_ERROR_MESSAGE_", (String) result.get(ModelService.ERROR_MESSAGE)); + request.setAttribute("_ERROR_MESSAGE_", result.get(ModelService.ERROR_MESSAGE)); return "error"; } } catch (GenericServiceException e) { diff --git a/applications/party/src/org/ofbiz/party/contact/ContactMechServices.java b/applications/party/src/org/ofbiz/party/contact/ContactMechServices.java index a6c9e85ad6..fb2a655410 100644 --- a/applications/party/src/org/ofbiz/party/contact/ContactMechServices.java +++ b/applications/party/src/org/ofbiz/party/contact/ContactMechServices.java @@ -1041,7 +1041,7 @@ public class ContactMechServices { * Creates an EmailAddressVerification */ public static Map createEmailAddressVerification(DispatchContext dctx, Map context) { - Delegator delegator = (Delegator) dctx.getDelegator(); + Delegator delegator = dctx.getDelegator(); String emailAddress = (String) context.get("emailAddress"); String verifyHash = null; diff --git a/applications/product/src/org/ofbiz/product/config/ProductConfigWorker.java b/applications/product/src/org/ofbiz/product/config/ProductConfigWorker.java index 1c8fc6efe8..f5145cc678 100644 --- a/applications/product/src/org/ofbiz/product/config/ProductConfigWorker.java +++ b/applications/product/src/org/ofbiz/product/config/ProductConfigWorker.java @@ -112,7 +112,7 @@ public class ProductConfigWorker { try { cnt = Integer.parseInt(opt); String comments = null; - ProductConfigWrapper.ConfigItem question = (ProductConfigWrapper.ConfigItem) configWrapper.getQuestions().get(k); + ProductConfigWrapper.ConfigItem question = configWrapper.getQuestions().get(k); if (question.isSingleChoice()) { comments = request.getParameter("comments_" + k + "_" + "0"); } else { @@ -142,7 +142,7 @@ public class ProductConfigWorker { List selectedFeatures = FastList.newInstance(); Enumeration paramNames = UtilGenerics.cast(request.getParameterNames()); while (paramNames.hasMoreElements()) { - String paramName = (String)paramNames.nextElement(); + String paramName = paramNames.nextElement(); if (paramName.startsWith("FT" + k + "_" + cnt + "_" + variantIndex)) { selectedFeatures.add(request.getParameterValues(paramName)[0]); } @@ -342,7 +342,7 @@ public class ProductConfigWorker { List components = oneOption.getComponents(); for (GenericValue component: components) { if (oneOption.isVirtualComponent(component)) { - String componentOption = (String)oneOption.componentOptions.get(component.getString("productId")); + String componentOption = oneOption.componentOptions.get(component.getString("productId")); GenericValue configOptionProductOption = delegator.makeValue("ConfigOptionProductOption"); configOptionProductOption.put("configId", configId); configOptionProductOption.put("configItemId", configItemId); diff --git a/applications/product/src/org/ofbiz/product/config/ProductConfigWrapper.java b/applications/product/src/org/ofbiz/product/config/ProductConfigWrapper.java index 302d50f5d1..fdd8841e4e 100644 --- a/applications/product/src/org/ofbiz/product/config/ProductConfigWrapper.java +++ b/applications/product/src/org/ofbiz/product/config/ProductConfigWrapper.java @@ -242,7 +242,7 @@ public class ProductConfigWrapper implements Serializable { List avalOptions = ci.getOptions(); if (ci.isSingleChoice()) { for (int j = 0; j < avalOptions.size(); j++) { - ConfigOption oneOption = (ConfigOption)avalOptions.get(j); + ConfigOption oneOption = avalOptions.get(j); oneOption.setSelected(false); oneOption.setComments(null); } diff --git a/applications/product/src/org/ofbiz/product/feature/ProductFeatureServices.java b/applications/product/src/org/ofbiz/product/feature/ProductFeatureServices.java index 4aebeb28d1..6a15904943 100644 --- a/applications/product/src/org/ofbiz/product/feature/ProductFeatureServices.java +++ b/applications/product/src/org/ofbiz/product/feature/ProductFeatureServices.java @@ -270,7 +270,7 @@ public class ProductFeatureServices { // now figure out which of these combinations already have productIds associated with them for (Map combination: oldCombinations) { // Verify if the default code is already used, if so add a numeric suffix - if (defaultVariantProductIds.contains((String) combination.get("defaultVariantProductId"))) { + if (defaultVariantProductIds.contains(combination.get("defaultVariantProductId"))) { combination.put("defaultVariantProductId", combination.get("defaultVariantProductId") + "-" + (defaultCodeCounter < 10? "0" + defaultCodeCounter: "" + defaultCodeCounter)); defaultCodeCounter++; } diff --git a/applications/product/src/org/ofbiz/product/image/ScaleImage.java b/applications/product/src/org/ofbiz/product/image/ScaleImage.java index 699c662726..d276ea1ae3 100644 --- a/applications/product/src/org/ofbiz/product/image/ScaleImage.java +++ b/applications/product/src/org/ofbiz/product/image/ScaleImage.java @@ -89,7 +89,7 @@ public class ScaleImage { /* ImageProperties.xml */ String imgPropertyFullPath = System.getProperty("ofbiz.home") + "/applications/product/config/ImageProperties.xml"; - resultXMLMap.putAll((Map) ImageTransform.getXMLValue(imgPropertyFullPath, locale)); + resultXMLMap.putAll(ImageTransform.getXMLValue(imgPropertyFullPath, locale)); if (resultXMLMap.containsKey("responseMessage") && resultXMLMap.get("responseMessage").equals("success")) { imgPropertyMap.putAll(UtilGenerics.>>cast(resultXMLMap.get("xml"))); } else { @@ -136,8 +136,8 @@ public class ScaleImage { bufImg = (BufferedImage) resultBufImgMap.get("bufferedImage"); // get Dimensions - imgHeight = (double) bufImg.getHeight(); - imgWidth = (double) bufImg.getWidth(); + imgHeight = bufImg.getHeight(); + imgWidth = bufImg.getWidth(); if (imgHeight == 0.0 || imgWidth == 0.0) { String errMsg = UtilProperties.getMessage(resource, "ScaleImage.one_current_image_dimension_is_null", locale) + " : imgHeight = " + imgHeight + " ; imgWidth = " + imgWidth; Debug.logError(errMsg, module); @@ -187,7 +187,7 @@ public class ScaleImage { // write new image try { - ImageIO.write((RenderedImage) bufNewImg, imgExtension, new File(imageServerPath + "/" + newFilePathPrefix + filenameToUse)); + ImageIO.write(bufNewImg, imgExtension, new File(imageServerPath + "/" + newFilePathPrefix + filenameToUse)); } catch (IllegalArgumentException e) { String errMsg = UtilProperties.getMessage(resource, "ScaleImage.one_parameter_is_null", locale) + e.toString(); Debug.logError(errMsg, module); diff --git a/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java b/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java index 437dd51f8e..b12060c0ca 100644 --- a/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java +++ b/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java @@ -581,8 +581,8 @@ public class InventoryServices { List toBeStored = FastList.newInstance(); for (GenericValue orderItem: orderItems) { String orderItemSeqId = orderItem.getString("orderItemSeqId"); - Timestamp shipDate = (Timestamp) backOrderedItems.get(orderItemSeqId); - Timestamp cancelDate = (Timestamp) cancelItems.get(orderItemSeqId); + Timestamp shipDate = backOrderedItems.get(orderItemSeqId); + Timestamp cancelDate = cancelItems.get(orderItemSeqId); Timestamp currentCancelDate = orderItem.getTimestamp("autoCancelDate"); Debug.logError("OI: " + orderId + " SEQID: "+ orderItemSeqId + " cancelAll: " + cancelAll + " cancelDate: " + cancelDate, module); diff --git a/applications/product/src/org/ofbiz/product/price/PriceServices.java b/applications/product/src/org/ofbiz/product/price/PriceServices.java index bedd551ed6..03db4c6d58 100644 --- a/applications/product/src/org/ofbiz/product/price/PriceServices.java +++ b/applications/product/src/org/ofbiz/product/price/PriceServices.java @@ -679,7 +679,7 @@ public class PriceServices { return ServiceUtil.returnError("Error calculating VAT tax (with calcTaxForDisplay service)", null, null, calcTaxForDisplayResult); } // taxTotal, taxPercentage, priceWithTax - result.put("price", (BigDecimal) calcTaxForDisplayResult.get("priceWithTax")); + result.put("price", calcTaxForDisplayResult.get("priceWithTax")); // based on the taxPercentage calculate the other amounts, including: listPrice, defaultPrice, averageCost, promoPrice, competitivePrice BigDecimal taxPercentage = (BigDecimal) calcTaxForDisplayResult.get("taxPercentage"); diff --git a/applications/product/src/org/ofbiz/product/product/ProductSearch.java b/applications/product/src/org/ofbiz/product/product/ProductSearch.java index 559beffb8c..2e14b01f41 100644 --- a/applications/product/src/org/ofbiz/product/product/ProductSearch.java +++ b/applications/product/src/org/ofbiz/product/product/ProductSearch.java @@ -719,7 +719,7 @@ public class ProductSearch { productIds.add(searchResult.getString("mainProductId")); productIdSet.add(searchResult.getString("mainProductId")); - while ((maxResults == null || numRetreived < maxResults.intValue()) && ((searchResult = (GenericValue) eli.next()) != null)) { + while ((maxResults == null || numRetreived < maxResults.intValue()) && ((searchResult = eli.next()) != null)) { String productId = searchResult.getString("mainProductId"); if (!productIdSet.contains(productId)) { productIds.add(productId); diff --git a/applications/product/src/org/ofbiz/product/product/ProductSearchEvents.java b/applications/product/src/org/ofbiz/product/product/ProductSearchEvents.java index c2438acfa0..fc6a80b1e9 100644 --- a/applications/product/src/org/ofbiz/product/product/ProductSearchEvents.java +++ b/applications/product/src/org/ofbiz/product/product/ProductSearchEvents.java @@ -212,7 +212,7 @@ public class ProductSearchEvents { GenericValue searchResultView = null; int numAdded = 0; - while ((searchResultView = (GenericValue) eli.next()) != null) { + while ((searchResultView = eli.next()) != null) { String productId = searchResultView.getString("mainProductId"); GenericValue pcm=delegator.makeValue("ProductCategoryMember"); @@ -301,7 +301,7 @@ public class ProductSearchEvents { GenericValue searchResultView = null; int numAdded = 0; - while ((searchResultView = (GenericValue) eli.next()) != null) { + while ((searchResultView = eli.next()) != null) { String productId = searchResultView.getString("mainProductId"); GenericValue pfa=delegator.makeValue("ProductFeatureAppl"); pfa.set("productId", productId); @@ -360,7 +360,7 @@ public class ProductSearchEvents { GenericValue searchResultView = null; int numRemoved = 0; - while ((searchResultView = (GenericValue) eli.next()) != null) { + while ((searchResultView = eli.next()) != null) { String productId = searchResultView.getString("mainProductId"); numRemoved += delegator.removeByAnd("ProductFeatureAppl", UtilMisc.toMap("productId", productId, "productFeatureId", productFeatureId)); } diff --git a/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java b/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java index 09620996d5..a215dff216 100644 --- a/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java +++ b/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java @@ -598,7 +598,7 @@ public class ProductSearchSession { String keywordString = (String) parameters.get("SEARCH_STRING"); String searchOperator = (String) parameters.get("SEARCH_OPERATOR"); // defaults to true/Y, ie anything but N is true/Y - boolean anyPrefixSuffix = !"N".equals((String) parameters.get("SEARCH_ANYPRESUF")); + boolean anyPrefixSuffix = !"N".equals(parameters.get("SEARCH_ANYPRESUF")); searchAddConstraint(new ProductSearch.KeywordConstraint(keywordString, anyPrefixSuffix, anyPrefixSuffix, null, "AND".equals(searchOperator)), session); constraintsChanged = true; } @@ -622,7 +622,7 @@ public class ProductSearchSession { String keywordString = (String) parameters.get("SEARCH_STRING" + kwNum); String searchOperator = (String) parameters.get("SEARCH_OPERATOR" + kwNum); // defaults to true/Y, ie anything but N is true/Y - boolean anyPrefixSuffix = !"N".equals((String) parameters.get("SEARCH_ANYPRESUF" + kwNum)); + boolean anyPrefixSuffix = !"N".equals(parameters.get("SEARCH_ANYPRESUF" + kwNum)); searchAddConstraint(new ProductSearch.KeywordConstraint(keywordString, anyPrefixSuffix, anyPrefixSuffix, null, "AND".equals(searchOperator)), session); constraintsChanged = true; } @@ -1227,7 +1227,7 @@ public class ProductSearchSession { List> featureCountList = FastList.newInstance(); GenericValue searchResult = null; - while ((searchResult = (GenericValue) eli.next()) != null) { + while ((searchResult = eli.next()) != null) { featureCountList.add(UtilMisc.toMap("productFeatureId", (String) searchResult.get("pfacProductFeatureId"), "productFeatureTypeId", (String) searchResult.get("pfcProductFeatureTypeId"), "description", (String) searchResult.get("pfcDescription"), "featureCount", Long.toString((Long) searchResult.get("featureCount")))); } @@ -1305,7 +1305,7 @@ public class ProductSearchSession { GenericValue searchResult = null; Long priceRangeCount = Long.valueOf(0); - while ((searchResult = (GenericValue) eli.next()) != null) { + while ((searchResult = eli.next()) != null) { priceRangeCount = searchResult.getLong("priceRangeCount"); } @@ -1371,7 +1371,7 @@ public class ProductSearchSession { GenericValue searchResult = null; Long categoryCount = Long.valueOf(0); - while ((searchResult = (GenericValue) eli.next()) != null) { + while ((searchResult = eli.next()) != null) { categoryCount = searchResult.getLong("categoryCount"); } diff --git a/applications/product/src/org/ofbiz/product/product/ProductServices.java b/applications/product/src/org/ofbiz/product/product/ProductServices.java index 6106f78371..2db533c706 100644 --- a/applications/product/src/org/ofbiz/product/product/ProductServices.java +++ b/applications/product/src/org/ofbiz/product/product/ProductServices.java @@ -261,7 +261,7 @@ public class ProductServices { Map invReqResult = dispatcher.runSync("isStoreInventoryAvailableOrNotRequired", UtilMisc.toMap("productStoreId", productStoreId, "productId", productIdTo, "quantity", BigDecimal.ONE)); if (ServiceUtil.isError(invReqResult)) { return ServiceUtil.returnError("Error calling the isStoreInventoryRequired when building the variant product tree.", null, null, invReqResult); - } else if ("Y".equals((String) invReqResult.get("availableOrNotRequired"))) { + } else if ("Y".equals(invReqResult.get("availableOrNotRequired"))) { items.add(productIdTo); if (productTo.getString("isVirtual") != null && productTo.getString("isVirtual").equals("Y")) { virtualVariant.add(productIdTo); @@ -542,7 +542,7 @@ public class ProductServices { //List featureKey = FastList.newInstance(); Map> tempGroup = FastMap.newInstance(); Map group = new LinkedHashMap(); - String orderKey = (String) order.get(index); + String orderKey = order.get(index); if (featureList == null) { throw new IllegalArgumentException("Cannot build feature tree: featureList is null"); @@ -1050,14 +1050,14 @@ public class ProductServices { Map dataResourceCtx = FastMap.newInstance(); dataResourceCtx.put("objectInfo", imageUrl); - dataResourceCtx.put("dataResourceName", (String) context.get("_uploadedFile_fileName")); + dataResourceCtx.put("dataResourceName", context.get("_uploadedFile_fileName")); dataResourceCtx.put("userLogin", userLogin); Map productContentCtx = FastMap.newInstance(); productContentCtx.put("productId", productId); productContentCtx.put("productContentTypeId", productContentTypeId); - productContentCtx.put("fromDate", (Timestamp) context.get("fromDate")); - productContentCtx.put("thruDate", (Timestamp) context.get("thruDate")); + productContentCtx.put("fromDate", context.get("fromDate")); + productContentCtx.put("thruDate", context.get("thruDate")); productContentCtx.put("userLogin", userLogin); if (UtilValidate.isNotEmpty(contentId)) { @@ -1254,14 +1254,14 @@ public class ProductServices { if (UtilValidate.isNotEmpty(imageUrl) && imageUrl.length() > 0) { Map dataResourceCtx = FastMap.newInstance(); dataResourceCtx.put("objectInfo", imageUrl); - dataResourceCtx.put("dataResourceName", (String) context.get("_uploadedFile_fileName")); + dataResourceCtx.put("dataResourceName", context.get("_uploadedFile_fileName")); dataResourceCtx.put("userLogin", userLogin); Map productPromoContentCtx = FastMap.newInstance(); productPromoContentCtx.put("productPromoId", productPromoId); productPromoContentCtx.put("productPromoContentTypeId", productPromoContentTypeId); - productPromoContentCtx.put("fromDate", (Timestamp) context.get("fromDate")); - productPromoContentCtx.put("thruDate", (Timestamp) context.get("thruDate")); + productPromoContentCtx.put("fromDate", context.get("fromDate")); + productPromoContentCtx.put("thruDate", context.get("thruDate")); productPromoContentCtx.put("userLogin", userLogin); if (UtilValidate.isNotEmpty(contentId)) { @@ -1358,8 +1358,8 @@ public class ProductServices { productPromoContentCtx.put("productPromoId", productPromoId); productPromoContentCtx.put("productPromoContentTypeId", productPromoContentTypeId); productPromoContentCtx.put("contentId", contentId); - productPromoContentCtx.put("fromDate", (Timestamp) context.get("fromDate")); - productPromoContentCtx.put("thruDate", (Timestamp) context.get("thruDate")); + productPromoContentCtx.put("fromDate", context.get("fromDate")); + productPromoContentCtx.put("thruDate", context.get("thruDate")); productPromoContentCtx.put("userLogin", userLogin); try { dispatcher.runSync("updateProductPromoContent", productPromoContentCtx); diff --git a/applications/product/src/org/ofbiz/product/product/ProductUtilServices.java b/applications/product/src/org/ofbiz/product/product/ProductUtilServices.java index 7bb9bbec7a..48f084276e 100644 --- a/applications/product/src/org/ofbiz/product/product/ProductUtilServices.java +++ b/applications/product/src/org/ofbiz/product/product/ProductUtilServices.java @@ -669,7 +669,7 @@ while (allCatIter.hasNext()) { ), EntityOperator.AND); EntityListIterator productFeatureAndApplEli = delegator.find("ProductFeatureAndAppl", condition, null, null, null, null); GenericValue productFeatureAndAppl = null; - while ((productFeatureAndAppl = (GenericValue) productFeatureAndApplEli.next()) != null) { + while ((productFeatureAndAppl = productFeatureAndApplEli.next()) != null) { String productFeatureId = productFeatureAndAppl.getString("productFeatureId"); String productFeatureTypeId = productFeatureAndAppl.getString("productFeatureTypeId"); if (UtilValidate.isNotEmpty(productFeatureTypeIdsToInclude) && !productFeatureTypeIdsToInclude.contains(productFeatureTypeId)) { diff --git a/applications/product/src/org/ofbiz/product/spreadsheetimport/ImportProductServices.java b/applications/product/src/org/ofbiz/product/spreadsheetimport/ImportProductServices.java index 03f8db3ee9..7e1ff29f12 100644 --- a/applications/product/src/org/ofbiz/product/spreadsheetimport/ImportProductServices.java +++ b/applications/product/src/org/ofbiz/product/spreadsheetimport/ImportProductServices.java @@ -109,11 +109,11 @@ public class ImportProductServices { if (row != null) { // read productId from first column "sheet column index // starts from 0" - HSSFCell cell2 = row.getCell((int) 2); + HSSFCell cell2 = row.getCell(2); cell2.setCellType(HSSFCell.CELL_TYPE_STRING); String productId = cell2.getRichStringCellValue().toString(); // read QOH from ninth column - HSSFCell cell5 = row.getCell((int) 5); + HSSFCell cell5 = row.getCell(5); BigDecimal quantityOnHand = BigDecimal.ZERO; if (cell5 != null && cell5.getCellType() == HSSFCell.CELL_TYPE_NUMERIC) quantityOnHand = new BigDecimal(cell5.getNumericCellValue()); diff --git a/applications/product/src/org/ofbiz/product/store/ProductStoreWorker.java b/applications/product/src/org/ofbiz/product/store/ProductStoreWorker.java index 412b38166a..5c28676f51 100644 --- a/applications/product/src/org/ofbiz/product/store/ProductStoreWorker.java +++ b/applications/product/src/org/ofbiz/product/store/ProductStoreWorker.java @@ -610,7 +610,7 @@ public class ProductStoreWorker { Debug.logError("Error calling isStoreInventoryRequired service, result is: " + invReqResult, module); return false; } - requiredOkay = Boolean.valueOf(wantRequired.booleanValue() == "Y".equals((String) invReqResult.get("requireInventory"))); + requiredOkay = Boolean.valueOf(wantRequired.booleanValue() == "Y".equals(invReqResult.get("requireInventory"))); } Boolean availableOkay = null; @@ -620,7 +620,7 @@ public class ProductStoreWorker { Debug.logError("Error calling isStoreInventoryAvailable service, result is: " + invAvailResult, module); return false; } - availableOkay = Boolean.valueOf(wantAvailable.booleanValue() == "Y".equals((String) invAvailResult.get("available"))); + availableOkay = Boolean.valueOf(wantAvailable.booleanValue() == "Y".equals(invAvailResult.get("available"))); } if ((requiredOkay == null || requiredOkay.booleanValue()) && (availableOkay == null || availableOkay.booleanValue())) { diff --git a/applications/product/src/org/ofbiz/shipment/packing/PackingServices.java b/applications/product/src/org/ofbiz/shipment/packing/PackingServices.java index 8cb416b2d0..83fe9f8c9f 100644 --- a/applications/product/src/org/ofbiz/shipment/packing/PackingServices.java +++ b/applications/product/src/org/ofbiz/shipment/packing/PackingServices.java @@ -153,7 +153,7 @@ public class PackingServices { if (qtyStr == null) { quantities = new String[packages.length]; for (int p = 0; p < packages.length; p++) { - quantities[p] = (String) qtyInfo.get(rowKey + ":" + packages[p]); + quantities[p] = qtyInfo.get(rowKey + ":" + packages[p]); } if (quantities.length != packages.length) { return ServiceUtil.returnError("Packages and quantities do not match."); @@ -316,7 +316,7 @@ public class PackingServices { String packageSeqId = entry.getKey(); String packageWeightStr = entry.getValue(); if (UtilValidate.isNotEmpty(packageWeightStr)) { - BigDecimal packageWeight = new BigDecimal((String)packageWeights.get(packageSeqId)); + BigDecimal packageWeight = new BigDecimal(packageWeights.get(packageSeqId)); session.setPackageWeight(Integer.parseInt(packageSeqId), packageWeight); shippableWeight = shippableWeight.add(packageWeight); } else { diff --git a/applications/product/src/org/ofbiz/shipment/shipment/ShipmentWorker.java b/applications/product/src/org/ofbiz/shipment/shipment/ShipmentWorker.java index 44bae35395..37414804cb 100644 --- a/applications/product/src/org/ofbiz/shipment/shipment/ShipmentWorker.java +++ b/applications/product/src/org/ofbiz/shipment/shipment/ShipmentWorker.java @@ -138,7 +138,7 @@ public class ShipmentWorker { if (!addedToPackage) { BigDecimal packageWeight = calcPackageWeight(dctx, packageMap, shippableItemInfo, weight); if (packageWeight.compareTo(maxWeight) <= 0) { - BigDecimal qty = (BigDecimal) packageMap.get(productId); + BigDecimal qty = packageMap.get(productId); qty = UtilValidate.isEmpty(qty) ? BigDecimal.ZERO : qty; packageMap.put(productId, qty.add(partialQty)); addedToPackage = true; @@ -168,7 +168,7 @@ public class ShipmentWorker { String productId = entry.getKey(); Map productInfo = getProductItemInfo(shippableItemInfo, productId); BigDecimal productWeight = (BigDecimal) productInfo.get("weight"); - BigDecimal quantity = (BigDecimal) packageMap.get(productId); + BigDecimal quantity = packageMap.get(productId); String weightUomId = (String) productInfo.get("weightUomId"); diff --git a/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java b/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java index 506d5aeb93..cbd73ae950 100644 --- a/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java +++ b/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java @@ -1138,7 +1138,7 @@ public class UpsServices { if (shipmentPackageRouteSegIter.hasNext()) { errorList.add("Error: There are more Packages on this Shipment than there were PackageResults returned from UPS"); while (shipmentPackageRouteSegIter.hasNext()) { - GenericValue shipmentPackageRouteSeg = (GenericValue) shipmentPackageRouteSegIter.next(); + GenericValue shipmentPackageRouteSeg = shipmentPackageRouteSegIter.next(); errorList.add("Error: No PackageResults were returned for the Package [" + shipmentPackageRouteSeg.getString("shipmentPackageSeqId") + "]"); } } diff --git a/applications/securityext/src/org/ofbiz/securityext/login/LoginEvents.java b/applications/securityext/src/org/ofbiz/securityext/login/LoginEvents.java index 2edbef0e59..0f53ff5435 100644 --- a/applications/securityext/src/org/ofbiz/securityext/login/LoginEvents.java +++ b/applications/securityext/src/org/ofbiz/securityext/login/LoginEvents.java @@ -302,7 +302,7 @@ public class LoginEvents { try { Map result = dispatcher.runSync("sendMailFromScreen", serviceContext); - if (ModelService.RESPOND_ERROR.equals((String) result.get(ModelService.RESPONSE_MESSAGE))) { + if (ModelService.RESPOND_ERROR.equals(result.get(ModelService.RESPONSE_MESSAGE))) { Map messageMap = UtilMisc.toMap("errorMessage", result.get(ModelService.ERROR_MESSAGE)); errMsg = UtilProperties.getMessage(resource, "loginevents.error_unable_email_password_contact_customer_service_errorwas", messageMap, UtilHttp.getLocale(request)); request.setAttribute("_ERROR_MESSAGE_", errMsg); diff --git a/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalConverter.java b/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalConverter.java index b808b1cfc0..b3bb8895be 100644 --- a/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalConverter.java +++ b/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalConverter.java @@ -261,7 +261,7 @@ public class ICalConverter { if (iCalObj == null) { return null; } - return new Long((long)iCalObj.getPercentage()); + return new Long(iCalObj.getPercentage()); } protected static Double fromPriority(PropertyList propertyList) { diff --git a/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalWorker.java b/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalWorker.java index 6fc6942951..fc83621496 100644 --- a/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalWorker.java +++ b/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalWorker.java @@ -274,7 +274,7 @@ public class ICalWorker { } protected static void logInUser(HttpServletRequest request, HttpServletResponse response) throws GenericServiceException, GenericEntityException { - Map serviceMap = (Map) WebDavUtil.getCredentialsFromRequest(request); + Map serviceMap = WebDavUtil.getCredentialsFromRequest(request); if (serviceMap == null) { return; } diff --git a/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortSearch.java b/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortSearch.java index 4bedcd4a5f..0401b77acf 100644 --- a/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortSearch.java +++ b/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortSearch.java @@ -390,7 +390,7 @@ public class WorkEffortSearch { workEffortIds.add(searchResult.getString("workEffortId")); workEffortIdSet.add(searchResult.getString("workEffortId")); - while (((searchResult = (GenericValue) eli.next()) != null) && (maxResults == null || numRetreived < maxResults.intValue())) { + while (((searchResult = eli.next()) != null) && (maxResults == null || numRetreived < maxResults.intValue())) { String workEffortId = searchResult.getString("workEffortId"); if (!workEffortIdSet.contains(workEffortId)) { workEffortIds.add(workEffortId); diff --git a/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortSearchSession.java b/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortSearchSession.java index 68c08d9472..971a2cd098 100644 --- a/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortSearchSession.java +++ b/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortSearchSession.java @@ -238,7 +238,7 @@ public class WorkEffortSearchSession { String keywordString = (String) parameters.get("SEARCH_STRING"); String searchOperator = (String) parameters.get("SEARCH_OPERATOR"); // defaults to true/Y, ie anything but N is true/Y - boolean anyPrefixSuffix = !"N".equals((String) parameters.get("SEARCH_ANYPRESUF")); + boolean anyPrefixSuffix = !"N".equals(parameters.get("SEARCH_ANYPRESUF")); searchAddConstraint(new WorkEffortSearch.KeywordConstraint(keywordString, anyPrefixSuffix, anyPrefixSuffix, null, "AND".equals(searchOperator)), session); constraintsChanged = true; } diff --git a/framework/base/src/org/ofbiz/base/json/JSONWriter.java b/framework/base/src/org/ofbiz/base/json/JSONWriter.java index eae55664aa..576ace99d5 100644 --- a/framework/base/src/org/ofbiz/base/json/JSONWriter.java +++ b/framework/base/src/org/ofbiz/base/json/JSONWriter.java @@ -113,7 +113,7 @@ public class JSONWriter { writer.write(c); } else { writer.write("\\u"); - String n = Integer.toString((int) c, 16); + String n = Integer.toString(c, 16); for (int j = 4 - n.length(); j > 0; j--) writer.write('0'); writer.write(n); } diff --git a/framework/base/src/org/ofbiz/base/json/test/JSONTests.java b/framework/base/src/org/ofbiz/base/json/test/JSONTests.java index 4bf368fb8b..e97b1efc35 100644 --- a/framework/base/src/org/ofbiz/base/json/test/JSONTests.java +++ b/framework/base/src/org/ofbiz/base/json/test/JSONTests.java @@ -72,17 +72,17 @@ public class JSONTests extends GenericTestCaseBase { protected void assertSimpleJSONByte(byte n, String json) throws Exception { assertSimpleJSON("integer - byte", new Byte(n), json, new Long(n)); - assertSimpleJSONShort((short) n, json); + assertSimpleJSONShort(n, json); } protected void assertSimpleJSONShort(short n, String json) throws Exception { assertSimpleJSON("integer - short", new Integer(n), json, new Long(n)); - assertSimpleJSONInteger((int) n, json); + assertSimpleJSONInteger(n, json); } protected void assertSimpleJSONInteger(int n, String json) throws Exception { assertSimpleJSON("integer - int", new Short((short) n), json, new Long(n)); - assertSimpleJSONLong((long) n, json); + assertSimpleJSONLong(n, json); } protected void assertSimpleJSONLong(long n, String json) throws Exception { @@ -91,7 +91,7 @@ public class JSONTests extends GenericTestCaseBase { protected void assertSimpleJSONFloat(float n, String json) throws Exception { assertSimpleJSON("float - float", new Float(n), json, new Double(n)); - assertSimpleJSONDouble((double) n, json); + assertSimpleJSONDouble(n, json); } protected void assertSimpleJSONDouble(double n, String json) throws Exception { diff --git a/framework/base/src/org/ofbiz/base/util/TimeDuration.java b/framework/base/src/org/ofbiz/base/util/TimeDuration.java index 15a5784fbc..990174eab4 100644 --- a/framework/base/src/org/ofbiz/base/util/TimeDuration.java +++ b/framework/base/src/org/ofbiz/base/util/TimeDuration.java @@ -307,10 +307,10 @@ public class TimeDuration implements Serializable, Comparable { } long units = duration / 0x757B12C00L; int years = (int) units; - duration -= 0x757B12C00L * (long) years; + duration -= 0x757B12C00L * years; units = duration / 0x9CA41900L; int months = (int) units; - duration -= 0x9CA41900L * (long) months; + duration -= 0x9CA41900L * months; units = duration / 86400000; int days = (int) units; duration -= 86400000 * (long) days; @@ -373,8 +373,8 @@ public class TimeDuration implements Serializable, Comparable { */ public static long toLong(TimeDuration duration) { return - (0x757B12C00L * (long) duration.years) + - (0x9CA41900L * (long) duration.months) + + (0x757B12C00L * duration.years) + + (0x9CA41900L * duration.months) + (86400000 * (long) duration.days) + (3600000 * (long) duration.hours) + (60000 * (long) duration.minutes) + diff --git a/framework/base/src/org/ofbiz/base/util/UtilHttp.java b/framework/base/src/org/ofbiz/base/util/UtilHttp.java index 7dac119779..f4122d2a6b 100644 --- a/framework/base/src/org/ofbiz/base/util/UtilHttp.java +++ b/framework/base/src/org/ofbiz/base/util/UtilHttp.java @@ -118,7 +118,7 @@ public class UtilHttp { // add all the actual HTTP request parameters Enumeration e = UtilGenerics.cast(request.getParameterNames()); while (e.hasMoreElements()) { - String name = (String) e.nextElement(); + String name = e.nextElement(); if (nameSet != null && (onlyIncludeOrSkipPrim ^ nameSet.contains(name))) { continue; } @@ -248,7 +248,7 @@ public class UtilHttp { } else if (paramEntry.getValue() instanceof Collection) { List newList = FastList.newInstance(); for (String listEntry: UtilGenerics.checkCollection(paramEntry.getValue())) { - newList.add(canonicalizeParameter((String) listEntry)); + newList.add(canonicalizeParameter(listEntry)); } paramEntry.setValue(newList); } @@ -306,7 +306,7 @@ public class UtilHttp { // look at all request attributes Enumeration requestAttrNames = UtilGenerics.cast(request.getAttributeNames()); while (requestAttrNames.hasMoreElements()) { - String attrName = (String) requestAttrNames.nextElement(); + String attrName = requestAttrNames.nextElement(); if (namesToSkip != null && namesToSkip.contains(attrName)) continue; diff --git a/framework/base/src/org/ofbiz/base/util/UtilNumber.java b/framework/base/src/org/ofbiz/base/util/UtilNumber.java index 88822af356..d373d81de3 100644 --- a/framework/base/src/org/ofbiz/base/util/UtilNumber.java +++ b/framework/base/src/org/ofbiz/base/util/UtilNumber.java @@ -213,7 +213,7 @@ public class UtilNumber { * @return formatted string or an empty string if there was an error */ public static String formatRuleBasedAmount(double amount, String rule, Locale locale) { - String ruleSet = (String) rbnfRuleSets.get(locale); + String ruleSet = rbnfRuleSets.get(locale); if (ruleSet == null) { Debug.logWarning("Cannot format rule based amount for locale " + locale.toString() + " because rule set for that locale does not exist", module); return ""; diff --git a/framework/base/src/org/ofbiz/base/util/UtilObject.java b/framework/base/src/org/ofbiz/base/util/UtilObject.java index d652414455..b6f1423ed9 100644 --- a/framework/base/src/org/ofbiz/base/util/UtilObject.java +++ b/framework/base/src/org/ofbiz/base/util/UtilObject.java @@ -121,7 +121,7 @@ public final class UtilObject { ObjectOutputStream oos = new ObjectOutputStream(bos); oos.writeObject(obj); oos.flush(); - long size = (long) bos.size(); + long size = bos.size(); bos.close(); return size; } diff --git a/framework/base/src/org/ofbiz/base/util/UtilProperties.java b/framework/base/src/org/ofbiz/base/util/UtilProperties.java index 79e3a4cf0d..b98fca14d4 100644 --- a/framework/base/src/org/ofbiz/base/util/UtilProperties.java +++ b/framework/base/src/org/ofbiz/base/util/UtilProperties.java @@ -448,7 +448,7 @@ public class UtilProperties implements Serializable { String value = null; try { - value = (String) bundle.getString(name); + value = bundle.getString(name); } catch (Exception e) { //Debug.log(e, module); } diff --git a/framework/base/src/org/ofbiz/base/util/UtilTimer.java b/framework/base/src/org/ofbiz/base/util/UtilTimer.java index 55b3f9e807..d92b839e6d 100644 --- a/framework/base/src/org/ofbiz/base/util/UtilTimer.java +++ b/framework/base/src/org/ofbiz/base/util/UtilTimer.java @@ -124,14 +124,14 @@ public class UtilTimer { * @return The number of seconds since the timer started */ public double secondsSinceStart() { - return ((double) timeSinceStart()) / 1000.0; + return (timeSinceStart()) / 1000.0; } /** Returns the number of seconds since the last time timerString was called * @return The number of seconds since the last time timerString was called */ public double secondsSinceLast() { - return ((double) timeSinceLast()) / 1000.0; + return (timeSinceLast()) / 1000.0; } /** Returns the number of milliseconds since the timer started diff --git a/framework/base/src/org/ofbiz/base/util/template/XslTransform.java b/framework/base/src/org/ofbiz/base/util/template/XslTransform.java index 85fe6a20b6..e19850238c 100644 --- a/framework/base/src/org/ofbiz/base/util/template/XslTransform.java +++ b/framework/base/src/org/ofbiz/base/util/template/XslTransform.java @@ -123,7 +123,7 @@ public final class XslTransform { Transformer transformer = translet.newTransformer(); if (params != null) { for (Map.Entry entry: params.entrySet()) { - String key = (String)entry.getKey(); + String key = entry.getKey(); Object val = entry.getValue(); transformer.setParameter(key, val); } diff --git a/framework/base/src/org/ofbiz/base/util/test/IndentingWriterTests.java b/framework/base/src/org/ofbiz/base/util/test/IndentingWriterTests.java index 591c4ecda9..ba5a9312ef 100644 --- a/framework/base/src/org/ofbiz/base/util/test/IndentingWriterTests.java +++ b/framework/base/src/org/ofbiz/base/util/test/IndentingWriterTests.java @@ -48,13 +48,13 @@ public class IndentingWriterTests extends GenericTestCaseBase { } else { iw = new IndentingWriter(sw); } - iw.write((int) 'a'); + iw.write('a'); iw.push(); iw.write("b\nm"); iw.newline(); iw.write(new char[] {'1', '\n', '2'}); iw.space(); - iw.write((int) '\n'); + iw.write('\n'); iw.pop(); iw.write("e"); iw.close(); diff --git a/framework/common/src/org/ofbiz/common/Captcha.java b/framework/common/src/org/ofbiz/common/Captcha.java index 74001982ef..71381c9860 100644 --- a/framework/common/src/org/ofbiz/common/Captcha.java +++ b/framework/common/src/org/ofbiz/common/Captcha.java @@ -107,7 +107,7 @@ public class Captcha { // we can rotate it independently int charWidth = fontMetrics.charWidth(characterToShow.charAt(i)); int charDim = Math.max(maxAdvance, fontHeight); - int halfCharDim = (int) (charDim / 2); + int halfCharDim = (charDim / 2); BufferedImage charImage = new BufferedImage(charDim, charDim, BufferedImage.TYPE_INT_ARGB); @@ -121,10 +121,10 @@ public class Captcha { int charX = (int) (0.5 * charDim - 0.5 * charWidth); charGraphics.drawString("" + characterToShow.charAt(i), charX, - (int) ((charDim - fontMetrics.getAscent()) / 2 + fontMetrics.getAscent())); + ((charDim - fontMetrics.getAscent()) / 2 + fontMetrics.getAscent())); float x = horizMargin + spacePerChar * (i) - charDim / 2.0f; - int y = (int) ((height - charDim) / 2); + int y = ((height - charDim) / 2); g.drawImage(charImage, (int) x, y, charDim, charDim, null, null); diff --git a/framework/common/src/org/ofbiz/common/CommonEvents.java b/framework/common/src/org/ofbiz/common/CommonEvents.java index 455e203f93..6584e7f8e5 100644 --- a/framework/common/src/org/ofbiz/common/CommonEvents.java +++ b/framework/common/src/org/ofbiz/common/CommonEvents.java @@ -137,7 +137,7 @@ public class CommonEvents { String followSessionId = request.getParameter("followSid"); Map follow = appletSessions.get(followSessionId); if (follow == null) follow = FastMap.newInstance(); - String followerListStr = (String) follow.get("followers"); + String followerListStr = follow.get("followers"); if (followerListStr == null) { followerListStr = followerSessionId; } else { diff --git a/framework/common/src/org/ofbiz/common/CommonServices.java b/framework/common/src/org/ofbiz/common/CommonServices.java index d79b06a5e9..28b938b134 100644 --- a/framework/common/src/org/ofbiz/common/CommonServices.java +++ b/framework/common/src/org/ofbiz/common/CommonServices.java @@ -452,7 +452,7 @@ public class CommonServices { Map mapOfStrings = checkMap(context.get("mapOfStrings"), String.class, String.class); for (String str: listOfStrings) { - String v = (String) mapOfStrings.get(str); + String v = mapOfStrings.get(str); Debug.log("SimpleMapListTest: " + str + " -> " + v, module); } diff --git a/framework/common/src/org/ofbiz/common/FindServices.java b/framework/common/src/org/ofbiz/common/FindServices.java index 1474877a9d..109b28bafc 100644 --- a/framework/common/src/org/ofbiz/common/FindServices.java +++ b/framework/common/src/org/ofbiz/common/FindServices.java @@ -593,8 +593,8 @@ public class FindServices { String entityName = (String) context.get("entityName"); EntityConditionList entityConditionList = (EntityConditionList) context.get("entityConditionList"); List orderByList = checkList(context.get("orderByList"), String.class); - boolean noConditionFind = "Y".equals((String) context.get("noConditionFind")); - boolean distinct = "Y".equals((String) context.get("distinct")); + boolean noConditionFind = "Y".equals(context.get("noConditionFind")); + boolean distinct = "Y".equals(context.get("distinct")); List fieldList = UtilGenerics.checkList(context.get("fieldList")); Set fieldSet = null; if (fieldList != null) { diff --git a/framework/common/src/org/ofbiz/common/KeywordSearchUtil.java b/framework/common/src/org/ofbiz/common/KeywordSearchUtil.java index d57b9cf5b0..b2577833fe 100644 --- a/framework/common/src/org/ofbiz/common/KeywordSearchUtil.java +++ b/framework/common/src/org/ofbiz/common/KeywordSearchUtil.java @@ -164,7 +164,7 @@ public class KeywordSearchUtil { } // group by word, add up weight - Long curWeight = (Long) keywords.get(token); + Long curWeight = keywords.get(token); if (curWeight == null) { keywords.put(token, Long.valueOf(1)); } else { diff --git a/framework/common/src/org/ofbiz/common/preferences/PreferenceServices.java b/framework/common/src/org/ofbiz/common/preferences/PreferenceServices.java index f24bb7f5ef..15f97db1fb 100644 --- a/framework/common/src/org/ofbiz/common/preferences/PreferenceServices.java +++ b/framework/common/src/org/ofbiz/common/preferences/PreferenceServices.java @@ -171,7 +171,7 @@ public class PreferenceServices { String userLoginId = PreferenceWorker.getUserLoginId(context, false); String userPrefTypeId = (String) context.get("userPrefTypeId"); - Object userPrefValue = (String) context.get("userPrefValue"); + Object userPrefValue = context.get("userPrefValue"); if (UtilValidate.isEmpty(userLoginId) || UtilValidate.isEmpty(userPrefTypeId) || userPrefValue == null) { return ServiceUtil.returnError(UtilProperties.getMessage(resource, "setPreference.invalidArgument", locale)); } diff --git a/framework/datafile/src/org/ofbiz/datafile/Record.java b/framework/datafile/src/org/ofbiz/datafile/Record.java index 091e912e7c..6938fcb6b3 100644 --- a/framework/datafile/src/org/ofbiz/datafile/Record.java +++ b/framework/datafile/src/org/ofbiz/datafile/Record.java @@ -199,7 +199,7 @@ public class Record implements Serializable { (long)(byteArray[3]&0xff) << 24 | (long)(byteArray[2]&0xff) << 16 | (long)(byteArray[1]&0xff) << 8 | - (long)(byteArray[0]&0xff); + (byteArray[0]&0xff); } /** Sets the named field to the passed value, converting the value from a String to the current type using Type.valueOf() diff --git a/framework/entity/src/org/ofbiz/entity/cache/AbstractEntityConditionCache.java b/framework/entity/src/org/ofbiz/entity/cache/AbstractEntityConditionCache.java index 1b4c34daba..c5d5197914 100644 --- a/framework/entity/src/org/ofbiz/entity/cache/AbstractEntityConditionCache.java +++ b/framework/entity/src/org/ofbiz/entity/cache/AbstractEntityConditionCache.java @@ -150,7 +150,7 @@ public abstract class AbstractEntityConditionCache extends AbstractCache> convert(boolean isPK, String targetEntityName, GenericEntity entity) { if (isNull(entity)) return null; if (isPK) { - return entity.getModelEntity().convertToViewValues(targetEntityName, (GenericPK) entity); + return entity.getModelEntity().convertToViewValues(targetEntityName, entity); } else { return entity.getModelEntity().convertToViewValues(targetEntityName, entity); } diff --git a/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java b/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java index a6b87a281d..33101d0687 100644 --- a/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java +++ b/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java @@ -439,7 +439,7 @@ public class GenericDAO { } } else if (meResult.size() == 1) { // Update existing value - meGenericValue = (GenericValue) meResult.iterator().next(); + meGenericValue = meResult.iterator().next(); } else { throw new GenericEntityException("Found more than one result for member entity " + meName + " in view " + modelViewEntity.getEntityName() + " - this is no updatable view"); } diff --git a/framework/entity/src/org/ofbiz/entity/jdbc/DatabaseUtil.java b/framework/entity/src/org/ofbiz/entity/jdbc/DatabaseUtil.java index 36e082dfd0..38eed1dcfb 100644 --- a/framework/entity/src/org/ofbiz/entity/jdbc/DatabaseUtil.java +++ b/framework/entity/src/org/ofbiz/entity/jdbc/DatabaseUtil.java @@ -356,7 +356,7 @@ public class DatabaseUtil { // -list all fields that do not have a corresponding column for (String colName: fieldColNames.keySet()) { - ModelField field = (ModelField) fieldColNames.get(colName); + ModelField field = fieldColNames.get(colName); String message = "Field [" + field.getName() + "] of entity [" + entity.getEntityName() + "] is missing its corresponding column [" + field.getColName() + "]" + (field.getIsPk() ? " (and it is a PRIMARY KEY FIELD)" : ""); Debug.logWarning(message, module); @@ -2105,7 +2105,7 @@ public class DatabaseUtil { String entityName = fieldInfo.substring(0, fieldInfo.indexOf('.')); String fieldName = fieldInfo.substring(fieldInfo.indexOf('.') + 1); - ModelEntity modelEntity = (ModelEntity) modelEntities.get(entityName); + ModelEntity modelEntity = modelEntities.get(entityName); ModelField modelField = modelEntity.getField(fieldName); repairColumnSize(modelEntity, modelField, messages); } diff --git a/framework/entity/src/org/ofbiz/entity/model/ModelReader.java b/framework/entity/src/org/ofbiz/entity/model/ModelReader.java index 26e305c263..11c2c8c386 100644 --- a/framework/entity/src/org/ofbiz/entity/model/ModelReader.java +++ b/framework/entity/src/org/ofbiz/entity/model/ModelReader.java @@ -259,7 +259,7 @@ public class ModelReader implements Serializable { // all entity elements in, now go through extend-entity elements and add their stuff for (Element extendEntityElement: tempExtendEntityElementList) { String entityName = UtilXml.checkEmpty(extendEntityElement.getAttribute("entity-name")); - ModelEntity modelEntity = (ModelEntity) entityCache.get(entityName); + ModelEntity modelEntity = entityCache.get(entityName); if (modelEntity == null) throw new GenericEntityConfException("Entity to extend does not exist: " + entityName); modelEntity.addExtendEntity(this, extendEntityElement); } @@ -271,7 +271,7 @@ public class ModelReader implements Serializable { curViewEntity.populateFields(this); for (ModelViewEntity.ModelMemberEntity mve: curViewEntity.getAllModelMemberEntities()) { - ModelEntity me = (ModelEntity) entityCache.get(mve.getEntityName()); + ModelEntity me = entityCache.get(mve.getEntityName()); if (me == null) throw new GenericEntityConfException("View " + curViewEntity.getEntityName() + " references non-existant entity: " + mve.getEntityName()); me.addViewEntity(curViewEntity); } @@ -498,7 +498,7 @@ public class ModelReader implements Serializable { //put the entityNames TreeSets in a HashMap by packageName Iterator ecIter = this.getEntityNames().iterator(); while (ecIter.hasNext()) { - String entityName = (String) ecIter.next(); + String entityName = ecIter.next(); ModelEntity entity = this.getModelEntity(entityName); String packageName = entity.getPackageName(); diff --git a/framework/entity/src/org/ofbiz/entity/sql/EntityPlanner.java b/framework/entity/src/org/ofbiz/entity/sql/EntityPlanner.java index 9effb85f67..e1446cc871 100644 --- a/framework/entity/src/org/ofbiz/entity/sql/EntityPlanner.java +++ b/framework/entity/src/org/ofbiz/entity/sql/EntityPlanner.java @@ -121,7 +121,7 @@ public class EntityPlanner extends Planner attributes = FastMap.newInstance(); protected String id = null; protected final boolean IS_SAME_LOGIN = UtilProperties.propertyValueEqualsIgnoreCase("xui.properties", "isSameLogin", "true"); - private Locale locale = (Locale) Locale.getDefault(); + private Locale locale = Locale.getDefault(); public XuiSession(String id, Delegator delegator, LocalDispatcher dispatcher, XuiContainer container) { this.id = id; diff --git a/framework/minilang/src/org/ofbiz/minilang/method/envops/StringAppend.java b/framework/minilang/src/org/ofbiz/minilang/method/envops/StringAppend.java index 7aba6cb06f..88e1ea886b 100644 --- a/framework/minilang/src/org/ofbiz/minilang/method/envops/StringAppend.java +++ b/framework/minilang/src/org/ofbiz/minilang/method/envops/StringAppend.java @@ -76,10 +76,10 @@ public class StringAppend extends MethodOperation { mapAcsr.put(methodContext, toMap); } - String oldValue = (String) fieldAcsr.get(toMap, methodContext); + String oldValue = fieldAcsr.get(toMap, methodContext); fieldAcsr.put(toMap, this.appendString(oldValue, methodContext), methodContext); } else { - String oldValue = (String) fieldAcsr.get(methodContext); + String oldValue = fieldAcsr.get(methodContext); fieldAcsr.put(methodContext, this.appendString(oldValue, methodContext)); } diff --git a/framework/minilang/src/org/ofbiz/minilang/method/ifops/CheckPermission.java b/framework/minilang/src/org/ofbiz/minilang/method/ifops/CheckPermission.java index a0c91c0d7b..df7991c83e 100644 --- a/framework/minilang/src/org/ofbiz/minilang/method/ifops/CheckPermission.java +++ b/framework/minilang/src/org/ofbiz/minilang/method/ifops/CheckPermission.java @@ -122,7 +122,7 @@ public class CheckPermission extends MethodOperation { } if (!hasPermission && acceptUlPartyIdEnvNameAcsr != null) { - String acceptPartyId = (String) acceptUlPartyIdEnvNameAcsr.get(methodContext); + String acceptPartyId = acceptUlPartyIdEnvNameAcsr.get(methodContext); if (UtilValidate.isEmpty(acceptPartyId)) { // try the parameters Map Map parameters = methodContext.getEnv("parameters"); diff --git a/framework/minilang/src/org/ofbiz/minilang/method/otherops/Calculate.java b/framework/minilang/src/org/ofbiz/minilang/method/otherops/Calculate.java index 1beb570593..6e8c17c067 100644 --- a/framework/minilang/src/org/ofbiz/minilang/method/otherops/Calculate.java +++ b/framework/minilang/src/org/ofbiz/minilang/method/otherops/Calculate.java @@ -245,7 +245,7 @@ public class Calculate extends MethodOperation { public BigDecimal calcValue(MethodContext methodContext, int scale, int roundingMode) { String valueStr = methodContext.expandString(this.valueStr); - Locale locale = (Locale) methodContext.getLocale(); + Locale locale = methodContext.getLocale(); if (locale == null) locale = Locale.getDefault(); diff --git a/framework/service/src/org/ofbiz/service/calendar/RecurrenceRule.java b/framework/service/src/org/ofbiz/service/calendar/RecurrenceRule.java index bf73a5d95f..d5b56137f4 100644 --- a/framework/service/src/org/ofbiz/service/calendar/RecurrenceRule.java +++ b/framework/service/src/org/ofbiz/service/calendar/RecurrenceRule.java @@ -171,7 +171,7 @@ public class RecurrenceRule { Debug.logVerbose("Stamp value: " + stamp, module); if (stamp != null) { - long nanos = (long) stamp.getNanos(); + long nanos = stamp.getNanos(); time = stamp.getTime(); time += (nanos / 1000000); } diff --git a/framework/service/src/org/ofbiz/service/config/ServiceConfigUtil.java b/framework/service/src/org/ofbiz/service/config/ServiceConfigUtil.java index 0ba4257d45..1553e382c1 100644 --- a/framework/service/src/org/ofbiz/service/config/ServiceConfigUtil.java +++ b/framework/service/src/org/ofbiz/service/config/ServiceConfigUtil.java @@ -161,7 +161,7 @@ public class ServiceConfigUtil implements Serializable { for (int index = 0; index < params.getLength(); index++) { Element param = (Element) params.item(index); if (param != null && name.equals(param.getAttribute("name"))) { - return (String) param.getAttribute("value"); + return param.getAttribute("value"); } } } diff --git a/framework/service/src/org/ofbiz/service/group/GroupModel.java b/framework/service/src/org/ofbiz/service/group/GroupModel.java index 246500d10f..5b36af5a80 100644 --- a/framework/service/src/org/ofbiz/service/group/GroupModel.java +++ b/framework/service/src/org/ofbiz/service/group/GroupModel.java @@ -127,7 +127,7 @@ public class GroupModel { } else if (this.getSendMode().equals("round-robin")) { return runIndex(dispatcher, localName, context, (++lastServiceRan % services.size())); } else if (this.getSendMode().equals("random")) { - int randomIndex = (int) (Math.random() * (double) (services.size())); + int randomIndex = (int) (Math.random() * (services.size())); return runIndex(dispatcher, localName, context, randomIndex); } else if (this.getSendMode().equals("first-available")) { return runOne(dispatcher, localName, context); diff --git a/framework/service/src/org/ofbiz/service/semaphore/ServiceSemaphore.java b/framework/service/src/org/ofbiz/service/semaphore/ServiceSemaphore.java index 5c41dbb2ba..6238aef8d9 100644 --- a/framework/service/src/org/ofbiz/service/semaphore/ServiceSemaphore.java +++ b/framework/service/src/org/ofbiz/service/semaphore/ServiceSemaphore.java @@ -100,7 +100,7 @@ public class ServiceSemaphore { } } if (timedOut) { - double waitTimeSec = ((double) (System.currentTimeMillis() - lockTime.getTime()) / 1000.0); + double waitTimeSec = ((System.currentTimeMillis() - lockTime.getTime()) / 1000.0); String errMsg = "Service [" + model.name + "] with wait semaphore exceeded wait timeout, waited [" + waitTimeSec + "], wait started at " + lockTime; Debug.logWarning(errMsg, module); throw new SemaphoreWaitException(errMsg); diff --git a/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java b/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java index f67970297b..0efbc3c5a6 100644 --- a/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java +++ b/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java @@ -428,7 +428,7 @@ public class ConfigXMLReader { } String cacheId = controllerPartialPath != null ? controllerPartialPath : "NOPARTIALPATH"; - List controllerConfigs = (List) controllerSearchResultsCache.get(cacheId); + List controllerConfigs = controllerSearchResultsCache.get(cacheId); if (controllerConfigs == null) { try { diff --git a/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java b/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java index aefb6a569c..217af9ab09 100644 --- a/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java +++ b/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java @@ -851,7 +851,7 @@ public class LoginWorker { Map x500Map = KeyStoreUtil.getCertX500Map(clientCerts[i]); if (i == 0) { - String cn = (String) x500Map.get("CN"); + String cn = x500Map.get("CN"); cn = cn.replaceAll("\\\\", ""); Matcher m = pattern.matcher(cn); if (m.matches()) { @@ -933,7 +933,7 @@ public class LoginWorker { String externalKey = request.getParameter(LoginWorker.EXTERNAL_LOGIN_KEY_ATTR); if (externalKey == null) return "success"; - GenericValue userLogin = (GenericValue) LoginWorker.externalLoginKeys.get(externalKey); + GenericValue userLogin = LoginWorker.externalLoginKeys.get(externalKey); if (userLogin != null) { //to check it's the right tenant //in case username and password are the same in different tenants diff --git a/framework/webapp/src/org/ofbiz/webapp/control/ProtectViewWorker.java b/framework/webapp/src/org/ofbiz/webapp/control/ProtectViewWorker.java index 4e7c286afb..e5537161d7 100644 --- a/framework/webapp/src/org/ofbiz/webapp/control/ProtectViewWorker.java +++ b/framework/webapp/src/org/ofbiz/webapp/control/ProtectViewWorker.java @@ -87,13 +87,13 @@ public class ProtectViewWorker { } GenericValue protectedView = protectedViews.get(0); // 1st hit ? - Long curMaxHits = (Long) hitsByViewAccessed.get(viewNameUserLoginId); + Long curMaxHits = hitsByViewAccessed.get(viewNameUserLoginId); if (UtilValidate.isEmpty(curMaxHits)) { hitsByViewAccessed.put(viewNameUserLoginId, one); Long maxHitsDuration = (Long) protectedView.get("maxHitsDuration") * 1000; durationByViewAccessed.put(viewNameUserLoginId, now + maxHitsDuration); } else { - Long maxDuration = (Long) durationByViewAccessed.get(viewNameUserLoginId); + Long maxDuration = durationByViewAccessed.get(viewNameUserLoginId); Long newMaxHits = (Long) curMaxHits + one; hitsByViewAccessed.put(viewNameUserLoginId, newMaxHits); // Are we in a period of time where we need to check if there was too much hits ? diff --git a/framework/webapp/src/org/ofbiz/webapp/event/WfsEventHandler.java b/framework/webapp/src/org/ofbiz/webapp/event/WfsEventHandler.java index 0b2588c29b..a8f72e631c 100644 --- a/framework/webapp/src/org/ofbiz/webapp/event/WfsEventHandler.java +++ b/framework/webapp/src/org/ofbiz/webapp/event/WfsEventHandler.java @@ -88,10 +88,10 @@ public class WfsEventHandler implements EventHandler { Element queryElem = null; try { - typeName = (String)request.getParameter("typename"); + typeName = request.getParameter("typename"); //determine if "get" or "post" and get "filter" param accordingly if (UtilValidate.isNotEmpty(typeName)) { - String queryFieldCoded = (String)request.getParameter("filter"); + String queryFieldCoded = request.getParameter("filter"); String queryFieldDecoded = UtilFormatOut.decodeQueryValue(queryFieldCoded); Document doc = UtilXml.readXmlDocument(queryFieldDecoded); queryElem = doc.getDocumentElement(); diff --git a/framework/webapp/src/org/ofbiz/webapp/event/XmlRpcEventHandler.java b/framework/webapp/src/org/ofbiz/webapp/event/XmlRpcEventHandler.java index 50ecadc6ac..e2e55f8022 100644 --- a/framework/webapp/src/org/ofbiz/webapp/event/XmlRpcEventHandler.java +++ b/framework/webapp/src/org/ofbiz/webapp/event/XmlRpcEventHandler.java @@ -300,7 +300,7 @@ public class XmlRpcEventHandler extends XmlRpcHttpServer implements EventHandler context = checkMap(param, String.class, Object.class); } else { if (model.getDefinedInCount() == 1) { - String paramName = (String) model.getInParamNames().iterator().next(); + String paramName = model.getInParamNames().iterator().next(); context.put(paramName, xmlRpcReq.getParameter(0)); } else { throw new XmlRpcException("More than one parameter defined on service; cannot call via RPC with parameter list"); diff --git a/framework/webapp/src/org/ofbiz/webapp/region/RegionManager.java b/framework/webapp/src/org/ofbiz/webapp/region/RegionManager.java index c34676c4f9..3666892f6c 100644 --- a/framework/webapp/src/org/ofbiz/webapp/region/RegionManager.java +++ b/framework/webapp/src/org/ofbiz/webapp/region/RegionManager.java @@ -117,7 +117,7 @@ public class RegionManager { newRegion = new Region(idAttr, templateAttr, null); } else { if (UtilValidate.isNotEmpty(regionAttr)) { - Region parentRegion = (Region) regions.get(regionAttr); + Region parentRegion = regions.get(regionAttr); if (parentRegion == null) { throw new IllegalArgumentException("can't find page definition attribute with this key: " + regionAttr); diff --git a/framework/webapp/src/org/ofbiz/webapp/stats/ServerHitBin.java b/framework/webapp/src/org/ofbiz/webapp/stats/ServerHitBin.java index 0fe3b9a4ef..c10b6bbcfa 100644 --- a/framework/webapp/src/org/ofbiz/webapp/stats/ServerHitBin.java +++ b/framework/webapp/src/org/ofbiz/webapp/stats/ServerHitBin.java @@ -247,23 +247,23 @@ public class ServerHitBin { // save in global, and try to get bin by id switch (type) { case REQUEST: - bin = (ServerHitBin) requestSinceStarted.get(id); + bin = requestSinceStarted.get(id); break; case EVENT: - bin = (ServerHitBin) eventSinceStarted.get(id); + bin = eventSinceStarted.get(id); break; case VIEW: - bin = (ServerHitBin) viewSinceStarted.get(id); + bin = viewSinceStarted.get(id); break; case ENTITY: - bin = (ServerHitBin) entitySinceStarted.get(id); + bin = entitySinceStarted.get(id); break; case SERVICE: - bin = (ServerHitBin) serviceSinceStarted.get(id); + bin = serviceSinceStarted.get(id); break; } @@ -271,23 +271,23 @@ public class ServerHitBin { synchronized (ServerHitBin.class) { switch (type) { case REQUEST: - bin = (ServerHitBin) requestSinceStarted.get(id); + bin = requestSinceStarted.get(id); break; case EVENT: - bin = (ServerHitBin) eventSinceStarted.get(id); + bin = eventSinceStarted.get(id); break; case VIEW: - bin = (ServerHitBin) viewSinceStarted.get(id); + bin = viewSinceStarted.get(id); break; case ENTITY: - bin = (ServerHitBin) entitySinceStarted.get(id); + bin = entitySinceStarted.get(id); break; case SERVICE: - bin = (ServerHitBin) serviceSinceStarted.get(id); + bin = serviceSinceStarted.get(id); break; } @@ -477,7 +477,7 @@ public class ServerHitBin { /** returns (endTime - startTime)/60000 */ public double getBinLengthMinutes() { - return ((double) this.getBinLength()) / 60000.0; + return (this.getBinLength()) / 60000.0; } public long getNumberHits() { @@ -493,7 +493,7 @@ public class ServerHitBin { } public double getMinTimeSeconds() { - return ((double) this.minTime) / 1000.0; + return (this.minTime) / 1000.0; } public long getMaxTime() { @@ -501,7 +501,7 @@ public class ServerHitBin { } public double getMaxTimeSeconds() { - return ((double) this.maxTime) / 1000.0; + return (this.maxTime) / 1000.0; } public double getAvgTime() { @@ -514,7 +514,7 @@ public class ServerHitBin { /** return the hits per minute using the entire length of the bin as returned by getBinLengthMinutes() */ public double getHitsPerMinute() { - return ((double) this.numberHits) / this.getBinLengthMinutes(); + return (this.numberHits) / this.getBinLengthMinutes(); } synchronized void addHit(long startTime, long runningTime) { diff --git a/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java b/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java index 81a631aead..6017cfcc08 100644 --- a/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java +++ b/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java @@ -319,10 +319,10 @@ public class WebToolsServices { String readers = (String) context.get("readers"); String overrideDelegator = (String) context.get("overrideDelegator"); String overrideGroup = (String) context.get("overrideGroup"); - boolean useDummyFks = "true".equals((String) context.get("createDummyFks")); - boolean maintainTxs = "true".equals((String) context.get("maintainTimeStamps")); - boolean tryInserts = "true".equals((String) context.get("mostlyInserts")); - boolean checkDataOnly = "true".equals((String) context.get("checkDataOnly")); + boolean useDummyFks = "true".equals(context.get("createDummyFks")); + boolean maintainTxs = "true".equals(context.get("maintainTimeStamps")); + boolean tryInserts = "true".equals(context.get("mostlyInserts")); + boolean checkDataOnly = "true".equals(context.get("checkDataOnly")); Integer txTimeoutInt = (Integer) context.get("txTimeout"); int txTimeout = txTimeoutInt != null ? txTimeoutInt.intValue() : -1; @@ -513,7 +513,7 @@ public class WebToolsServices { //Don't bother writing the file if there's nothing //to put into it - GenericValue value = (GenericValue) values.next(); + GenericValue value = values.next(); if (value != null) { PrintWriter writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(outdir, curEntityName +".xml")), "UTF-8"))); writer.println(""); @@ -526,7 +526,7 @@ public class WebToolsServices { TransactionUtil.commit(beganTx); beganTx = TransactionUtil.begin(); } - } while ((value = (GenericValue) values.next()) != null); + } while ((value = values.next()) != null); writer.println(""); writer.close(); results.add("["+fileNumber +"] [" + numberWritten + "] " + curEntityName + " wrote " + numberWritten + " records"); diff --git a/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ControllerRequestArtifactInfo.java b/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ControllerRequestArtifactInfo.java index f77d260767..c2030e53d4 100644 --- a/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ControllerRequestArtifactInfo.java +++ b/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ControllerRequestArtifactInfo.java @@ -68,7 +68,7 @@ public class ControllerRequestArtifactInfo extends ArtifactInfoBase { // populate serviceCalledByRequestEvent, requestsThatAreResponsesToThisRequest, viewsThatAreResponsesToThisRequest and related reverse maps if (this.requestInfoMap.event != null && this.requestInfoMap.event.type != null && (this.requestInfoMap.event.type.indexOf("service") >= 0)) { - String serviceName = (String) this.requestInfoMap.event.invoke; + String serviceName = this.requestInfoMap.event.invoke; try { this.serviceCalledByRequestEvent = this.aif.getServiceArtifactInfo(serviceName); if (this.serviceCalledByRequestEvent != null) { diff --git a/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ServiceArtifactInfo.java b/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ServiceArtifactInfo.java index 8ddbe4942d..bba2afbfe0 100644 --- a/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ServiceArtifactInfo.java +++ b/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ServiceArtifactInfo.java @@ -85,7 +85,7 @@ public class ServiceArtifactInfo extends ArtifactInfoBase { SimpleMethod simpleMethodToCall = null; try { Map simpleMethods = SimpleMethod.getSimpleMethods(this.modelService.location, null); - simpleMethodToCall = (SimpleMethod) simpleMethods.get(this.modelService.invoke); + simpleMethodToCall = simpleMethods.get(this.modelService.invoke); } catch (MiniLangException e) { Debug.logWarning("Error getting Simple-method [" + this.modelService.invoke + "] in [" + this.modelService.location + "] referenced in service [" + this.modelService.name + "]: " + e.toString(), module); } @@ -146,7 +146,7 @@ public class ServiceArtifactInfo extends ArtifactInfoBase { SimpleMethod simpleMethodToCall = null; try { Map simpleMethods = SimpleMethod.getSimpleMethods(this.modelService.location, null); - simpleMethodToCall = (SimpleMethod) simpleMethods.get(this.modelService.invoke); + simpleMethodToCall = simpleMethods.get(this.modelService.invoke); } catch (MiniLangException e) { Debug.logWarning("Error getting Simple-method [" + this.modelService.invoke + "] in [" + this.modelService.location + "] referenced in service [" + this.modelService.name + "]: " + e.toString(), module); } diff --git a/framework/webtools/src/org/ofbiz/webtools/labelmanager/LabelInfo.java b/framework/webtools/src/org/ofbiz/webtools/labelmanager/LabelInfo.java index c1152c5234..d595328026 100644 --- a/framework/webtools/src/org/ofbiz/webtools/labelmanager/LabelInfo.java +++ b/framework/webtools/src/org/ofbiz/webtools/labelmanager/LabelInfo.java @@ -59,7 +59,7 @@ public class LabelInfo { } public LabelValue getLabelValue(String localeStr) { - return (LabelValue)labelValues.get(localeStr); + return labelValues.get(localeStr); } public int getLabelValueSize() { diff --git a/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java b/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java index 537f5fbf54..a32e4dbeb4 100644 --- a/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java +++ b/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java @@ -239,7 +239,7 @@ public class MacroFormRenderer implements FormStringRenderer { while (fieldIterator.hasNext()) { count++; Entry field = fieldIterator.next(); - extraParameter += (String) field.getKey() + ":'" + (String) field.getValue() + "'"; + extraParameter += field.getKey() + ":'" + (String) field.getValue() + "'"; if (count < fieldSet.size()) { extraParameter += ','; } diff --git a/framework/widget/src/org/ofbiz/widget/html/HtmlFormWrapper.java b/framework/widget/src/org/ofbiz/widget/html/HtmlFormWrapper.java index 7c445dc3fe..22cc3ec360 100644 --- a/framework/widget/src/org/ofbiz/widget/html/HtmlFormWrapper.java +++ b/framework/widget/src/org/ofbiz/widget/html/HtmlFormWrapper.java @@ -92,7 +92,7 @@ public class HtmlFormWrapper { } // if a parameter was passed saying this is an error, it is an error - if ("true".equals((String) parameterMap.get("isError"))) { + if ("true".equals(parameterMap.get("isError"))) { context.put("isError", Boolean.TRUE); } diff --git a/framework/widget/src/org/ofbiz/widget/html/HtmlMenuWrapper.java b/framework/widget/src/org/ofbiz/widget/html/HtmlMenuWrapper.java index b8f1cc83b7..dcb589823b 100644 --- a/framework/widget/src/org/ofbiz/widget/html/HtmlMenuWrapper.java +++ b/framework/widget/src/org/ofbiz/widget/html/HtmlMenuWrapper.java @@ -93,7 +93,7 @@ public class HtmlMenuWrapper { } // if a parameter was passed saying this is an error, it is an error - if ("true".equals((String) parameterMap.get("isError"))) { + if ("true".equals(parameterMap.get("isError"))) { context.put("isError", Boolean.TRUE); } } diff --git a/framework/widget/src/org/ofbiz/widget/html/HtmlScreenRenderer.java b/framework/widget/src/org/ofbiz/widget/html/HtmlScreenRenderer.java index e386e7a57d..d627a6b02b 100644 --- a/framework/widget/src/org/ofbiz/widget/html/HtmlScreenRenderer.java +++ b/framework/widget/src/org/ofbiz/widget/html/HtmlScreenRenderer.java @@ -287,7 +287,7 @@ public class HtmlScreenRenderer extends HtmlWidgetRenderer implements ScreenStri if (uiLabelMap == null) { Debug.logWarning("Could not find uiLabelMap in context", module); } else { - ofLabel = (String) uiLabelMap.get("CommonOf"); + ofLabel = uiLabelMap.get("CommonOf"); ofLabel = ofLabel.toLowerCase(); } diff --git a/framework/widget/src/org/ofbiz/widget/html/HtmlTreeRenderer.java b/framework/widget/src/org/ofbiz/widget/html/HtmlTreeRenderer.java index b71e6bd4f0..103cbd5439 100644 --- a/framework/widget/src/org/ofbiz/widget/html/HtmlTreeRenderer.java +++ b/framework/widget/src/org/ofbiz/widget/html/HtmlTreeRenderer.java @@ -77,7 +77,7 @@ public class HtmlTreeRenderer extends HtmlWidgetRenderer implements TreeStringRe String targetEntityId = null; List targetNodeTrail = UtilGenerics.toList(context.get("targetNodeTrail")); if (depth < targetNodeTrail.size()) { - targetEntityId = (String)targetNodeTrail.get(depth); + targetEntityId = targetNodeTrail.get(depth); } int openDepth = node.getModelTree().getOpenDepth(); @@ -102,7 +102,7 @@ public class HtmlTreeRenderer extends HtmlWidgetRenderer implements TreeStringRe } else { context.put("processChildren", Boolean.TRUE); //expandCollapseLink.setText(" - "); - String lastContentId = (String)currentNodeTrail.remove(currentNodeTrail.size() - 1); + String lastContentId = currentNodeTrail.remove(currentNodeTrail.size() - 1); currentNodeTrailPiped = StringUtil.join(currentNodeTrail, "|"); if (currentNodeTrailPiped == null) { currentNodeTrailPiped = ""; diff --git a/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java b/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java index 88f05912f2..745d804fc0 100644 --- a/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java +++ b/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java @@ -199,7 +199,7 @@ public class ModelMenuItem { public ModelMenuItem addUpdateMenuItem(ModelMenuItem modelMenuItem) { // not a conditional item, see if a named item exists in Map - ModelMenuItem existingMenuItem = (ModelMenuItem) this.menuItemMap.get(modelMenuItem.getName()); + ModelMenuItem existingMenuItem = this.menuItemMap.get(modelMenuItem.getName()); if (existingMenuItem != null) { // does exist, update the item by doing a merge/override existingMenuItem.mergeOverrideModelMenuItem(modelMenuItem); diff --git a/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java b/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java index c4dba57967..25f9992727 100644 --- a/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java +++ b/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java @@ -688,7 +688,7 @@ public class MacroScreenRenderer implements ScreenStringRenderer { if (uiLabelMap == null) { Debug.logWarning("Could not find uiLabelMap in context", module); } else { - ofLabel = (String) uiLabelMap.get("CommonOf"); + ofLabel = uiLabelMap.get("CommonOf"); ofLabel = ofLabel.toLowerCase(); } @@ -790,8 +790,8 @@ public class MacroScreenRenderer implements ScreenStringRenderer { if (uiLabelMap == null) { Debug.logWarning("Could not find uiLabelMap in context", module); } else { - addColumnLabel = (String) uiLabelMap.get("CommonAddColumn"); - addColumnHint = (String) uiLabelMap.get("CommonAddAColumnToThisPortalPage"); + addColumnLabel = uiLabelMap.get("CommonAddColumn"); + addColumnHint = uiLabelMap.get("CommonAddAColumnToThisPortalPage"); } StringWriter sr = new StringWriter(); @@ -835,13 +835,13 @@ public class MacroScreenRenderer implements ScreenStringRenderer { if (uiLabelMap == null) { Debug.logWarning("Could not find uiLabelMap in context", module); } else { - delColumnLabel = (String) uiLabelMap.get("CommonDeleteColumn"); - delColumnHint = (String) uiLabelMap.get("CommonDeleteThisColumn"); + delColumnLabel = uiLabelMap.get("CommonDeleteColumn"); + delColumnHint = uiLabelMap.get("CommonDeleteThisColumn"); - addPortletLabel = (String) uiLabelMap.get("CommonAddAPortlet"); - addPortletHint = (String) uiLabelMap.get("CommonAddPortletToPage"); - colWidthLabel = (String) uiLabelMap.get("CommonWidth"); - setColumnSizeHint = (String) uiLabelMap.get("CommonSetColumnWidth"); + addPortletLabel = uiLabelMap.get("CommonAddAPortlet"); + addPortletHint = uiLabelMap.get("CommonAddPortletToPage"); + colWidthLabel = uiLabelMap.get("CommonWidth"); + setColumnSizeHint = uiLabelMap.get("CommonSetColumnWidth"); } StringWriter sr = new StringWriter(); @@ -908,8 +908,8 @@ public class MacroScreenRenderer implements ScreenStringRenderer { if (uiLabelMap == null) { Debug.logWarning("Could not find uiLabelMap in context", module); } else { - delPortletHint = (String) uiLabelMap.get("CommonDeleteThisPortlet"); - editAttributeHint = (String) uiLabelMap.get("CommonEditPortletAttributes"); + delPortletHint = uiLabelMap.get("CommonDeleteThisPortlet"); + editAttributeHint = uiLabelMap.get("CommonEditPortletAttributes"); } StringWriter sr = new StringWriter(); diff --git a/framework/widget/src/org/ofbiz/widget/screen/MacroScreenViewHandler.java b/framework/widget/src/org/ofbiz/widget/screen/MacroScreenViewHandler.java index b5aca7456e..48b79064dd 100644 --- a/framework/widget/src/org/ofbiz/widget/screen/MacroScreenViewHandler.java +++ b/framework/widget/src/org/ofbiz/widget/screen/MacroScreenViewHandler.java @@ -79,7 +79,7 @@ public class MacroScreenViewHandler extends AbstractViewHandler { compressOutput = "true".equals(UtilProperties.getPropertyValue("widget", "compress.HTML")); } if (!compressOutput && this.servletContext != null) { - compressOutput = "true".equals((String) this.servletContext.getAttribute("compressHTML")); + compressOutput = "true".equals(this.servletContext.getAttribute("compressHTML")); } if (compressOutput) { // StandardCompress defaults to a 2k buffer. That could be increased diff --git a/framework/widget/src/org/ofbiz/widget/screen/ScreenFactory.java b/framework/widget/src/org/ofbiz/widget/screen/ScreenFactory.java index 2eec30c812..cfc8ecebc4 100644 --- a/framework/widget/src/org/ofbiz/widget/screen/ScreenFactory.java +++ b/framework/widget/src/org/ofbiz/widget/screen/ScreenFactory.java @@ -159,7 +159,7 @@ public class ScreenFactory { } } - ModelScreen modelScreen = (ModelScreen) modelScreenMap.get(screenName); + ModelScreen modelScreen = modelScreenMap.get(screenName); if (modelScreen == null) { throw new IllegalArgumentException("Could not find screen with name [" + screenName + "] in webapp resource [" + resourceName + "] in the webapp [" + webappName + "]"); } diff --git a/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java b/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java index 3001d16585..10b417c3e5 100644 --- a/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java +++ b/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java @@ -230,7 +230,7 @@ public class ModelTree extends ModelWidget { public void renderTreeString(StringBuffer buf, Map context, TreeStringRenderer treeStringRenderer) throws GeneralException { Map parameters = UtilGenerics.checkMap(context.get("parameters")); - ModelNode node = (ModelNode)nodeMap.get(rootNodeName); + ModelNode node = nodeMap.get(rootNodeName); String trailName = trailNameExdr.expandString(context); String treeString = (String)context.get(trailName); @@ -548,7 +548,7 @@ public class ModelTree extends ModelWidget { this.subNodeValues = FastList.newInstance(); for (ModelSubNode subNode: subNodeList) { String nodeName = subNode.getNodeName(context); - ModelNode node = (ModelNode)modelTree.nodeMap.get(nodeName); + ModelNode node = modelTree.nodeMap.get(nodeName); List subNodeActions = subNode.getActions(); //if (Debug.infoOn()) Debug.logInfo(" context.currentValue:" + context.get("currentValue"), module); ModelTreeAction.runSubActions(subNodeActions, context); diff --git a/framework/widget/src/org/ofbiz/widget/tree/TreeFactory.java b/framework/widget/src/org/ofbiz/widget/tree/TreeFactory.java index c7bda283f1..37aec3584d 100644 --- a/framework/widget/src/org/ofbiz/widget/tree/TreeFactory.java +++ b/framework/widget/src/org/ofbiz/widget/tree/TreeFactory.java @@ -69,7 +69,7 @@ public class TreeFactory { } } - ModelTree modelTree = (ModelTree) modelTreeMap.get(treeName); + ModelTree modelTree = modelTreeMap.get(treeName); if (modelTree == null) { throw new IllegalArgumentException("Could not find tree with name [" + treeName + "] in class resource [" + resourceName + "]"); } @@ -99,7 +99,7 @@ public class TreeFactory { } } - ModelTree modelTree = (ModelTree) modelTreeMap.get(treeName); + ModelTree modelTree = modelTreeMap.get(treeName); if (modelTree == null) { throw new IllegalArgumentException("Could not find tree with name [" + treeName + "] in webapp resource [" + resourceName + "] in the webapp [" + webappName + "]"); } diff --git a/specialpurpose/assetmaint/src/org/ofbiz/assetmaint/FixedAssetMaintServices.java b/specialpurpose/assetmaint/src/org/ofbiz/assetmaint/FixedAssetMaintServices.java index b4d37b4d8b..e8979e1351 100644 --- a/specialpurpose/assetmaint/src/org/ofbiz/assetmaint/FixedAssetMaintServices.java +++ b/specialpurpose/assetmaint/src/org/ofbiz/assetmaint/FixedAssetMaintServices.java @@ -87,7 +87,7 @@ public class FixedAssetMaintServices { List inventoryItems = delegator.findList("InventoryItem", ecl, null, null, null, false); //&& inventoryItems.size() > 0 Iterator itr = inventoryItems.iterator(); while (requestedQty > 0 && itr.hasNext()) { - GenericValue inventoryItem = (GenericValue)itr.next(); + GenericValue inventoryItem = itr.next(); String inventoryItemId = inventoryItem.getString("inventoryItemId"); atp = inventoryItem.getDouble("availableToPromiseTotal").doubleValue(); findCurrInventoryParams = UtilMisc.toMap("inventoryItemId", inventoryItemId); diff --git a/specialpurpose/ebay/src/org/ofbiz/ebay/EbayHelper.java b/specialpurpose/ebay/src/org/ofbiz/ebay/EbayHelper.java index 1783c2b461..a2a1772d54 100644 --- a/specialpurpose/ebay/src/org/ofbiz/ebay/EbayHelper.java +++ b/specialpurpose/ebay/src/org/ofbiz/ebay/EbayHelper.java @@ -194,7 +194,7 @@ public class EbayHelper { if (UtilValidate.isNotEmpty(paymentPreferences)) { Iterator i = paymentPreferences.iterator(); while (i.hasNext()) { - GenericValue pref = (GenericValue) i.next(); + GenericValue pref = i.next(); boolean okay = createPayment(dispatcher, userLogin, pref, orderId, externalId, orderDate, partyIdFrom); if (!okay) return false; @@ -304,10 +304,10 @@ public class EbayHelper { try { Map context = FastMap.newInstance(); context.put("partyId", partyId); - context.put("toName", (String) address.get("buyerName")); - context.put("address1", (String) address.get("shippingAddressStreet1")); - context.put("address2", (String) address.get("shippingAddressStreet2")); - context.put("postalCode", (String) address.get("shippingAddressPostalCode")); + context.put("toName", address.get("buyerName")); + context.put("address1", address.get("shippingAddressStreet1")); + context.put("address2", address.get("shippingAddressStreet2")); + context.put("postalCode", address.get("shippingAddressPostalCode")); context.put("userLogin", userLogin); context.put("contactMechPurposeTypeId", contactMechPurposeTypeId); @@ -469,7 +469,7 @@ public class EbayHelper { } Map result = ServiceUtil.returnSuccess(); - result.put("geoId", (String) geo.get("geoId")); + result.put("geoId", geo.get("geoId")); return result; } @@ -485,7 +485,7 @@ public class EbayHelper { // check them to see if one matches Iterator shippingLocationsIterator = shippingLocations.iterator(); while (shippingLocationsIterator.hasNext()) { - GenericValue shippingLocation = (GenericValue) shippingLocationsIterator.next(); + GenericValue shippingLocation = shippingLocationsIterator.next(); contactMechId = shippingLocation.getString("contactMechId"); GenericValue postalAddress; try { @@ -532,7 +532,7 @@ public class EbayHelper { // check them to see if one matches Iterator emailAddressesContactMechsIterator = emailAddressContactMechs.iterator(); while (emailAddressesContactMechsIterator.hasNext()) { - GenericValue emailAddressContactMech = (GenericValue) emailAddressesContactMechsIterator.next(); + GenericValue emailAddressContactMech = emailAddressesContactMechsIterator.next(); contactMechId = emailAddressContactMech.getString("contactMechId"); // now compare values. If one matches, that's our email address. // Return the related contact mech id. @@ -557,7 +557,7 @@ public class EbayHelper { // check them to see if one matches Iterator phoneNumbersIterator = phoneNumbers.iterator(); while (phoneNumbersIterator.hasNext()) { - GenericValue phoneNumberContactMech = (GenericValue) phoneNumbersIterator.next(); + GenericValue phoneNumberContactMech = phoneNumbersIterator.next(); contactMechId = phoneNumberContactMech.getString("contactMechId"); GenericValue phoneNumber; try { @@ -587,7 +587,7 @@ public class EbayHelper { // First try to get an exact match: title == internalName List products = delegator.findByAnd("Product", UtilMisc.toMap("internalName", title)); if (UtilValidate.isNotEmpty(products) && products.size() == 1) { - productId = (String) ((GenericValue)products.get(0)).get("productId"); + productId = (String) (products.get(0)).get("productId"); } // If it fails, attempt to get the product id from the first word of the title if (UtilValidate.isEmpty(productId)) { diff --git a/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java b/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java index a04744b006..7a10b78887 100644 --- a/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java +++ b/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java @@ -172,7 +172,7 @@ public class EbayOrderServices { Element orderIdArrayElem = UtilXml.addChildElement(transElem, "OrderIDArray", transDoc); Iterator orderIdListIter = getSellerTransactionsContainingOrderList.iterator(); while (orderIdListIter.hasNext()) { - String orderId = (String) orderIdListIter.next(); + String orderId = orderIdListIter.next(); UtilXml.addChildElementValue(orderIdArrayElem, "OrderID", orderId, transDoc); } } else { @@ -285,7 +285,7 @@ public class EbayOrderServices { Debug.logInfo("The value of getMyeBaySellingList" + eBayDeletedOrdersAndTransactionList, module); Iterator> orderListIter = orderList.iterator(); while (orderListIter.hasNext()) { - Map orderCtx = (Map) orderListIter.next(); + Map orderCtx = orderListIter.next(); if (eBayDeletedOrdersAndTransactionList.contains(orderCtx.get("externalId"))) { // Now finally exclude orders & transaction that has been deleted from sold list. orderList.remove(orderCtx); @@ -442,7 +442,7 @@ public class EbayOrderServices { // retrieve transaction array Iterator orderArraysElemIter = orderArrays.iterator(); while (orderArraysElemIter.hasNext()) { - Element orderArraysElement = (Element) orderArraysElemIter.next(); + Element orderArraysElement = orderArraysElemIter.next(); // retrieve transaction List orders = UtilXml.childElementList(orderArraysElement, "Order"); @@ -450,12 +450,12 @@ public class EbayOrderServices { while (ordersElemIter.hasNext()) { Map orderCtx = FastMap.newInstance(); - Element ordersElement = (Element) ordersElemIter.next(); + Element ordersElement = ordersElemIter.next(); String externalOrderId = UtilXml.childElementValue(ordersElement, "OrderID"); orderCtx.put("externalId", "EBO_" + externalOrderId); GenericValue orderExist = externalOrderExists(delegator, (String)orderCtx.get("externalId")); if (orderExist != null) { - orderCtx.put("orderId", (String)orderExist.get("orderId")); + orderCtx.put("orderId", orderExist.get("orderId")); } else { orderCtx.put("orderId", ""); } @@ -476,7 +476,7 @@ public class EbayOrderServices { List shippingAddressList = UtilXml.childElementList(ordersElement, "ShippingAddress"); Iterator shippingAddressElemIter = shippingAddressList.iterator(); while (shippingAddressElemIter.hasNext()) { - Element shippingAddressElement = (Element)shippingAddressElemIter.next(); + Element shippingAddressElement = shippingAddressElemIter.next(); shippingAddressCtx.put("buyerName", UtilXml.childElementValue(shippingAddressElement, "Name")); shippingAddressCtx.put("shippingAddressStreet1", UtilXml.childElementValue(shippingAddressElement, "Street1")); shippingAddressCtx.put("shippingAddressStreet2", UtilXml.childElementValue(shippingAddressElement, "Street2")); @@ -499,7 +499,7 @@ public class EbayOrderServices { List shippingServiceSelectedList = UtilXml.childElementList(ordersElement, "ShippingServiceSelected"); Iterator shippingServiceSelectedElemIter = shippingServiceSelectedList.iterator(); while (shippingServiceSelectedElemIter.hasNext()) { - Element shippingServiceSelectedElement = (Element)shippingServiceSelectedElemIter.next(); + Element shippingServiceSelectedElement = shippingServiceSelectedElemIter.next(); shippingServiceSelectedCtx.put("shippingService", UtilXml.childElementValue(shippingServiceSelectedElement, "ShippingService")); shippingServiceSelectedCtx.put("shippingServiceCost", UtilXml.childElementValue(shippingServiceSelectedElement, "ShippingServiceCost", "0")); String insuranceCost = UtilXml.childElementValue(shippingServiceSelectedElement, "ShippingInsuranceCost", "0"); @@ -519,7 +519,7 @@ public class EbayOrderServices { List shippingDetailsList = UtilXml.childElementList(ordersElement, "ShippingDetails"); Iterator shippingDetailsElemIter = shippingDetailsList.iterator(); while (shippingDetailsElemIter.hasNext()) { - Element shippingDetailsElement = (Element) shippingDetailsElemIter.next(); + Element shippingDetailsElement = shippingDetailsElemIter.next(); shippingDetailsCtx.put("insuranceFee", UtilXml.childElementValue(shippingDetailsElement, "InsuranceFee", "0")); shippingDetailsCtx.put("insuranceOption", UtilXml.childElementValue(shippingDetailsElement, "InsuranceOption")); shippingDetailsCtx.put("insuranceWanted", UtilXml.childElementValue(shippingDetailsElement, "InsuranceWanted", "false")); @@ -528,7 +528,7 @@ public class EbayOrderServices { List salesTaxList = UtilXml.childElementList(shippingDetailsElement, "SalesTax"); Iterator salesTaxElemIter = salesTaxList.iterator(); while (salesTaxElemIter.hasNext()) { - Element salesTaxElement = (Element) salesTaxElemIter.next(); + Element salesTaxElement = salesTaxElemIter.next(); shippingDetailsCtx.put("salesTaxAmount", UtilXml.childElementValue(salesTaxElement, "SalesTaxAmount", "0")); shippingDetailsCtx.put("salesTaxPercent", UtilXml.childElementValue(salesTaxElement, "SalesTaxPercent", "0")); shippingDetailsCtx.put("salesTaxState", UtilXml.childElementValue(salesTaxElement, "SalesTaxState", "0")); @@ -542,7 +542,7 @@ public class EbayOrderServices { List checkoutStatusList = UtilXml.childElementList(ordersElement, "CheckoutStatus"); Iterator checkoutStatusElemIter = checkoutStatusList.iterator(); while (checkoutStatusElemIter.hasNext()) { - Element statusElement = (Element) checkoutStatusElemIter.next(); + Element statusElement = checkoutStatusElemIter.next(); checkoutStatusCtx.put("eBayPaymentStatus", UtilXml.childElementValue(statusElement, "eBayPaymentStatus")); checkoutStatusCtx.put("paymentMethodUsed", UtilXml.childElementValue(statusElement, "PaymentMethod")); checkoutStatusCtx.put("completeStatus", UtilXml.childElementValue(statusElement, "Status")); @@ -554,7 +554,7 @@ public class EbayOrderServices { List externalTransactionList = UtilXml.childElementList(ordersElement, "ExternalTransaction"); Iterator externalTransactionElemIter = externalTransactionList.iterator(); while (externalTransactionElemIter.hasNext()) { - Element externalTransactionElement = (Element) externalTransactionElemIter.next(); + Element externalTransactionElement = externalTransactionElemIter.next(); externalTransactionCtx.put("externalTransactionID", UtilXml.childElementValue(externalTransactionElement, "ExternalTransactionID")); externalTransactionCtx.put("externalTransactionTime", UtilXml.childElementValue(externalTransactionElement, "ExternalTransactionTime")); externalTransactionCtx.put("feeOrCreditAmount", UtilXml.childElementValue(externalTransactionElement, "FeeOrCreditAmount", "0")); @@ -568,21 +568,21 @@ public class EbayOrderServices { List transactionArrayList = UtilXml.childElementList(ordersElement, "TransactionArray"); Iterator transactionArrayElemIter = transactionArrayList.iterator(); while (transactionArrayElemIter.hasNext()) { - Element transactionArrayElement = (Element) transactionArrayElemIter.next(); + Element transactionArrayElement = transactionArrayElemIter.next(); boolean buyerEmailExists = false; List transactionList = UtilXml.childElementList(transactionArrayElement, "Transaction"); Iterator transactionElemIter = transactionList.iterator(); while (transactionElemIter.hasNext()) { Map transactionCtx = FastMap.newInstance(); - Element transactionElement = (Element) transactionElemIter.next(); + Element transactionElement = transactionElemIter.next(); // Retrieve Buyer email if (!buyerEmailExists) { List buyerList = UtilXml.childElementList(transactionElement, "Buyer"); Iterator buyerElemIter = buyerList.iterator(); while (buyerElemIter.hasNext()) { - Element buyerElement = (Element) buyerElemIter.next(); + Element buyerElement = buyerElemIter.next(); buyersEmailId = UtilXml.childElementValue(buyerElement, "Email"); if (UtilValidate.isNotEmpty(buyersEmailId)) { buyerEmailExists = true; @@ -594,7 +594,7 @@ public class EbayOrderServices { List itemList = UtilXml.childElementList(transactionElement, "Item"); Iterator itemElemIter = itemList.iterator(); while (itemElemIter.hasNext()) { - Element itemElement = (Element) itemElemIter.next(); + Element itemElement = itemElemIter.next(); transactionCtx.put("goodIdentificationIdValue", UtilXml.childElementValue(itemElement, "ItemID")); transactionCtx.put("productId", UtilXml.childElementValue(itemElement, "SKU")); } @@ -622,7 +622,7 @@ public class EbayOrderServices { List errorList = UtilXml.childElementList(elemResponse, "Errors"); Iterator errorElemIter = errorList.iterator(); while (errorElemIter.hasNext()) { - Element errorElement = (Element) errorElemIter.next(); + Element errorElement = errorElemIter.next(); errorMessage.append(UtilXml.childElementValue(errorElement, "ShortMessage", "")); } } @@ -644,7 +644,7 @@ public class EbayOrderServices { int totalOrders = 0; Iterator paginationElemIter = paginationList.iterator(); while (paginationElemIter.hasNext()) { - Element paginationElement = (Element) paginationElemIter.next(); + Element paginationElement = paginationElemIter.next(); String totalNumberOfEntries = UtilXml.childElementValue(paginationElement, "TotalNumberOfEntries", "0"); totalOrders = Integer.valueOf(totalNumberOfEntries); } @@ -655,13 +655,13 @@ public class EbayOrderServices { List transactions = UtilXml.childElementList(elemResponse, "TransactionArray"); Iterator transactionsElemIter = transactions.iterator(); while (transactionsElemIter.hasNext()) { - Element transactionsElement = (Element) transactionsElemIter.next(); + Element transactionsElement = transactionsElemIter.next(); // retrieve transaction List transaction = UtilXml.childElementList(transactionsElement, "Transaction"); Iterator transactionElemIter = transaction.iterator(); while (transactionElemIter.hasNext()) { - Element transactionElement = (Element) transactionElemIter.next(); + Element transactionElement = transactionElemIter.next(); Map orderCtx = FastMap.newInstance(); orderCtx.put("amountPaid", UtilXml.childElementValue(transactionElement, "AmountPaid", "0")); @@ -678,7 +678,7 @@ public class EbayOrderServices { List containingOrders = UtilXml.childElementList(transactionElement, "ContainingOrder"); Iterator containingOrdersIter = containingOrders.iterator(); while (containingOrdersIter.hasNext()) { - Element containingOrdersElement = (Element) containingOrdersIter.next(); + Element containingOrdersElement = containingOrdersIter.next(); String orderId = UtilXml.childElementValue(containingOrdersElement, "OrderID"); if (getSellerTransactionsContainingOrderList != null && ! getSellerTransactionsContainingOrderList.contains(orderId)) { getSellerTransactionsContainingOrderList.add(orderId); @@ -694,7 +694,7 @@ public class EbayOrderServices { List buyer = UtilXml.childElementList(transactionElement, "Buyer"); Iterator buyerElemIter = buyer.iterator(); while (buyerElemIter.hasNext()) { - Element buyerElement = (Element)buyerElemIter.next(); + Element buyerElement = buyerElemIter.next(); buyerCtx.put("emailBuyer", UtilXml.childElementValue(buyerElement, "Email", "")); buyerCtx.put("eiasTokenBuyer", UtilXml.childElementValue(buyerElement, "EIASToken", "")); buyerCtx.put("ebayUserIdBuyer", UtilXml.childElementValue(buyerElement, "UserID", "")); @@ -703,13 +703,13 @@ public class EbayOrderServices { List buyerInfo = UtilXml.childElementList(buyerElement, "BuyerInfo"); Iterator buyerInfoElemIter = buyerInfo.iterator(); while (buyerInfoElemIter.hasNext()) { - Element buyerInfoElement = (Element)buyerInfoElemIter.next(); + Element buyerInfoElement = buyerInfoElemIter.next(); // retrieve shipping address List shippingAddressInfo = UtilXml.childElementList(buyerInfoElement, "ShippingAddress"); Iterator shippingAddressElemIter = shippingAddressInfo.iterator(); while (shippingAddressElemIter.hasNext()) { - Element shippingAddressElement = (Element)shippingAddressElemIter.next(); + Element shippingAddressElement = shippingAddressElemIter.next(); shippingAddressCtx.put("buyerName", UtilXml.childElementValue(shippingAddressElement, "Name", "")); shippingAddressCtx.put("shippingAddressStreet", UtilXml.childElementValue(shippingAddressElement, "Street", "")); shippingAddressCtx.put("shippingAddressStreet1", UtilXml.childElementValue(shippingAddressElement, "Street1", "")); @@ -731,7 +731,7 @@ public class EbayOrderServices { List shippingServiceSelected = UtilXml.childElementList(transactionElement, "ShippingServiceSelected"); Iterator shippingServiceSelectedElemIter = shippingServiceSelected.iterator(); while (shippingServiceSelectedElemIter.hasNext()) { - Element shippingServiceSelectedElement = (Element)shippingServiceSelectedElemIter.next(); + Element shippingServiceSelectedElement = shippingServiceSelectedElemIter.next(); shippingServiceSelectedCtx.put("shippingService", UtilXml.childElementValue(shippingServiceSelectedElement, "ShippingService", "")); shippingServiceSelectedCtx.put("shippingServiceCost", UtilXml.childElementValue(shippingServiceSelectedElement, "ShippingServiceCost", "0")); @@ -763,7 +763,7 @@ public class EbayOrderServices { List shippingDetails = UtilXml.childElementList(transactionElement, "ShippingDetails"); Iterator shippingDetailsElemIter = shippingDetails.iterator(); while (shippingDetailsElemIter.hasNext()) { - Element shippingDetailsElement = (Element)shippingDetailsElemIter.next(); + Element shippingDetailsElement = shippingDetailsElemIter.next(); shippingDetailsCtx.put("insuranceFee", UtilXml.childElementValue(shippingDetailsElement, "InsuranceFee", "0")); shippingDetailsCtx.put("insuranceOption", UtilXml.childElementValue(shippingDetailsElement, "InsuranceOption", "")); shippingDetailsCtx.put("insuranceWanted", UtilXml.childElementValue(shippingDetailsElement, "InsuranceWanted", "false")); @@ -772,7 +772,7 @@ public class EbayOrderServices { List salesTax = UtilXml.childElementList(shippingDetailsElement, "SalesTax"); Iterator salesTaxElemIter = salesTax.iterator(); while (salesTaxElemIter.hasNext()) { - Element salesTaxElement = (Element)salesTaxElemIter.next(); + Element salesTaxElement = salesTaxElemIter.next(); shippingDetailsCtx.put("salesTaxAmount", UtilXml.childElementValue(salesTaxElement, "SalesTaxAmount", "0")); shippingDetailsCtx.put("salesTaxPercent", UtilXml.childElementValue(salesTaxElement, "SalesTaxPercent", "0")); shippingDetailsCtx.put("salesTaxState", UtilXml.childElementValue(salesTaxElement, "SalesTaxState", "0")); @@ -783,12 +783,12 @@ public class EbayOrderServices { List taxTable = UtilXml.childElementList(shippingDetailsElement, "TaxTable"); Iterator taxTableElemIter = taxTable.iterator(); while (taxTableElemIter.hasNext()) { - Element taxTableElement = (Element)taxTableElemIter.next(); + Element taxTableElement = taxTableElemIter.next(); List taxJurisdiction = UtilXml.childElementList(taxTableElement, "TaxJurisdiction"); Iterator taxJurisdictionElemIter = taxJurisdiction.iterator(); while (taxJurisdictionElemIter.hasNext()) { - Element taxJurisdictionElement = (Element)taxJurisdictionElemIter.next(); + Element taxJurisdictionElement = taxJurisdictionElemIter.next(); shippingDetailsCtx.put("jurisdictionID", UtilXml.childElementValue(taxJurisdictionElement, "JurisdictionID", "")); shippingDetailsCtx.put("jurisdictionSalesTaxPercent", UtilXml.childElementValue(taxJurisdictionElement, "SalesTaxPercent", "0")); @@ -803,7 +803,7 @@ public class EbayOrderServices { List status = UtilXml.childElementList(transactionElement, "Status"); Iterator statusElemIter = status.iterator(); while (statusElemIter.hasNext()) { - Element statusElement = (Element)statusElemIter.next(); + Element statusElement = statusElemIter.next(); checkoutStatusCtx.put("eBayPaymentStatus", UtilXml.childElementValue(statusElement, "eBayPaymentStatus", "")); checkoutStatusCtx.put("checkoutStatus", UtilXml.childElementValue(statusElement, "CheckoutStatus", "")); checkoutStatusCtx.put("paymentMethodUsed", UtilXml.childElementValue(statusElement, "PaymentMethodUsed", "")); @@ -817,7 +817,7 @@ public class EbayOrderServices { List externalTransaction = UtilXml.childElementList(transactionElement, "ExternalTransaction"); Iterator externalTransactionElemIter = externalTransaction.iterator(); while (externalTransactionElemIter.hasNext()) { - Element externalTransactionElement = (Element)externalTransactionElemIter.next(); + Element externalTransactionElement = externalTransactionElemIter.next(); externalTransactionCtx.put("externalTransactionID", UtilXml.childElementValue(externalTransactionElement, "ExternalTransactionID", "")); externalTransactionCtx.put("externalTransactionTime", UtilXml.childElementValue(externalTransactionElement, "ExternalTransactionTime", "")); externalTransactionCtx.put("feeOrCreditAmount", UtilXml.childElementValue(externalTransactionElement, "FeeOrCreditAmount", "0")); @@ -833,7 +833,7 @@ public class EbayOrderServices { Iterator itemElemIter = item.iterator(); while (itemElemIter.hasNext()) { Map orderItemCtx = FastMap.newInstance(); - Element itemElement = (Element)itemElemIter.next(); + Element itemElement = itemElemIter.next(); itemId = UtilXml.childElementValue(itemElement, "ItemID", ""); orderItemCtx.put("paymentMethods", UtilXml.childElementValue(itemElement, "PaymentMethods", "")); orderItemCtx.put("quantity", quantityPurchased); @@ -852,7 +852,7 @@ public class EbayOrderServices { List sellingStatus = UtilXml.childElementList(itemElement, "SellingStatus"); Iterator sellingStatusitemElemIter = sellingStatus.iterator(); while (sellingStatusitemElemIter.hasNext()) { - Element sellingStatusElement = (Element)sellingStatusitemElemIter.next(); + Element sellingStatusElement = sellingStatusitemElemIter.next(); orderItemCtx.put("amount", UtilXml.childElementValue(sellingStatusElement, "CurrentPrice", "0")); orderItemCtx.put("quantitySold", UtilXml.childElementValue(sellingStatusElement, "QuantitySold", "0")); orderItemCtx.put("listingStatus", UtilXml.childElementValue(sellingStatusElement, "ListingStatus", "")); @@ -874,7 +874,7 @@ public class EbayOrderServices { GenericValue orderExist = externalOrderExists(delegator, (String)orderCtx.get("externalId")); if (orderExist != null) { - orderCtx.put("orderId", (String) orderExist.get("orderId")); + orderCtx.put("orderId", orderExist.get("orderId")); } else { orderCtx.put("orderId", ""); } @@ -904,7 +904,7 @@ public class EbayOrderServices { List errorList = UtilXml.childElementList(elemResponse, "Errors"); Iterator errorElemIter = errorList.iterator(); while (errorElemIter.hasNext()) { - Element errorElement = (Element) errorElemIter.next(); + Element errorElement = errorElemIter.next(); errorMessage.append(UtilXml.childElementValue(errorElement, "ShortMessage", "")); } } @@ -927,21 +927,21 @@ public class EbayOrderServices { List deletedFromSoldList = UtilXml.childElementList(elemResponse, "DeletedFromSoldList"); Iterator deletedFromSoldElemIter = deletedFromSoldList.iterator(); while (deletedFromSoldElemIter.hasNext()) { - Element deletedFromSoldElement = (Element) deletedFromSoldElemIter.next(); + Element deletedFromSoldElement = deletedFromSoldElemIter.next(); // retrieve transaction List orderTransactionArrayList = UtilXml.childElementList(deletedFromSoldElement, "OrderTransactionArray"); Iterator orderTransactionArrayElemIter = orderTransactionArrayList.iterator(); while (orderTransactionArrayElemIter.hasNext()) { - Element orderTransactionArrayElement = (Element) orderTransactionArrayElemIter.next(); + Element orderTransactionArrayElement = orderTransactionArrayElemIter.next(); List orderTransactionList = UtilXml.childElementList(orderTransactionArrayElement, "OrderTransaction"); Iterator orderTransactionElemIter = orderTransactionList.iterator(); while (orderTransactionElemIter.hasNext()) { - Element orderTransactionElement = (Element) orderTransactionElemIter.next(); + Element orderTransactionElement = orderTransactionElemIter.next(); List sellerOrderList = UtilXml.childElementList(orderTransactionElement, "Order"); Iterator sellerOrderElemIter = sellerOrderList.iterator(); while (sellerOrderElemIter.hasNext()) { - Element sellerOrderElement = (Element) sellerOrderElemIter.next(); + Element sellerOrderElement = sellerOrderElemIter.next(); String orderId = UtilXml.childElementValue(sellerOrderElement, "OrderID"); if (UtilValidate.isNotEmpty(orderId)) { fetchDeletedOrdersAndTransactions.add(orderId); @@ -950,12 +950,12 @@ public class EbayOrderServices { List transactionList = UtilXml.childElementList(orderTransactionElement, "Transaction"); Iterator transactionElemIter = transactionList.iterator(); while (transactionElemIter.hasNext()) { - Element transactionElement = (Element) transactionElemIter.next(); + Element transactionElement = transactionElemIter.next(); List itemList = UtilXml.childElementList(transactionElement, "Item"); Iterator itemElemIter = itemList.iterator(); while (itemElemIter.hasNext()) { - Element itemElement = (Element) itemElemIter.next(); + Element itemElement = itemElemIter.next(); String itemId = UtilXml.childElementValue(itemElement, "ItemID"); if (UtilValidate.isNotEmpty(itemId)) { fetchDeletedOrdersAndTransactions.add(itemId); @@ -969,7 +969,7 @@ public class EbayOrderServices { List errorList = UtilXml.childElementList(elemResponse, "Errors"); Iterator errorElemIter = errorList.iterator(); while (errorElemIter.hasNext()) { - Element errorElement = (Element) errorElemIter.next(); + Element errorElement = errorElemIter.next(); errorMessage.append(UtilXml.childElementValue(errorElement, "ShortMessage", "")); } } @@ -1048,7 +1048,7 @@ public class EbayOrderServices { List> orderItemList = UtilGenerics.checkList(context.get("orderItemList")); Iterator> orderItemIter = orderItemList.iterator(); while (orderItemIter.hasNext()) { - Map orderItem = (Map) orderItemIter.next(); + Map orderItem = orderItemIter.next(); addItem(cart, orderItem, dispatcher, delegator, 0); } @@ -1107,8 +1107,8 @@ public class EbayOrderServices { Map shippingAddressCtx = UtilGenerics.checkMap(context.get("shippingAddressCtx")); if (UtilValidate.isNotEmpty(shippingAddressCtx)) { String buyerName = (String) shippingAddressCtx.get("buyerName"); - String firstName = (String) buyerName.substring(0, buyerName.indexOf(" ")); - String lastName = (String) buyerName.substring(buyerName.indexOf(" ")+1); + String firstName = buyerName.substring(0, buyerName.indexOf(" ")); + String lastName = buyerName.substring(buyerName.indexOf(" ")+1); String country = (String) shippingAddressCtx.get("shippingAddressCountry"); String state = (String) shippingAddressCtx.get("shippingAddressStateOrProvince"); diff --git a/specialpurpose/ebay/src/org/ofbiz/ebay/ImportOrdersFromEbay.java b/specialpurpose/ebay/src/org/ofbiz/ebay/ImportOrdersFromEbay.java index 93ed41a53e..b0e1bfb088 100755 --- a/specialpurpose/ebay/src/org/ofbiz/ebay/ImportOrdersFromEbay.java +++ b/specialpurpose/ebay/src/org/ofbiz/ebay/ImportOrdersFromEbay.java @@ -88,32 +88,32 @@ public class ImportOrdersFromEbay { Map order = FastMap.newInstance(); Map result = FastMap.newInstance(); try { - order.put("productStoreId", (String) context.get("productStoreId")); - order.put("userLogin", (GenericValue) context.get("userLogin")); - order.put("externalId", (String) context.get("externalId")); - order.put("createdDate", (String) context.get("createdDate")); - order.put("productId", (String) context.get("productId")); - order.put("quantityPurchased", (String) context.get("quantityPurchased")); - order.put("transactionPrice", (String) context.get("transactionPrice")); - order.put("shippingService", (String) context.get("shippingService")); - order.put("shippingServiceCost", (String) context.get("shippingServiceCost")); - order.put("shippingTotalAdditionalCost", (String) context.get("shippingTotalAdditionalCost")); - order.put("salesTaxAmount", (String) context.get("salesTaxAmount")); - order.put("salesTaxPercent", (String) context.get("salesTaxPercent")); - order.put("amountPaid", (String) context.get("amountPaid")); - order.put("paidTime", (String) context.get("paidTime")); - order.put("shippedTime", (String) context.get("shippedTime")); + order.put("productStoreId", context.get("productStoreId")); + order.put("userLogin", context.get("userLogin")); + order.put("externalId", context.get("externalId")); + order.put("createdDate", context.get("createdDate")); + order.put("productId", context.get("productId")); + order.put("quantityPurchased", context.get("quantityPurchased")); + order.put("transactionPrice", context.get("transactionPrice")); + order.put("shippingService", context.get("shippingService")); + order.put("shippingServiceCost", context.get("shippingServiceCost")); + order.put("shippingTotalAdditionalCost", context.get("shippingTotalAdditionalCost")); + order.put("salesTaxAmount", context.get("salesTaxAmount")); + order.put("salesTaxPercent", context.get("salesTaxPercent")); + order.put("amountPaid", context.get("amountPaid")); + order.put("paidTime", context.get("paidTime")); + order.put("shippedTime", context.get("shippedTime")); - order.put("buyerName", (String) context.get("buyerName")); - order.put("emailBuyer", (String) context.get("emailBuyer")); - order.put("shippingAddressPhone", (String) context.get("shippingAddressPhone")); - order.put("shippingAddressStreet", (String) context.get("shippingAddressStreet")); - order.put("shippingAddressStreet1", (String) context.get("shippingAddressStreet1")); - order.put("shippingAddressStreet2", (String) context.get("shippingAddressStreet2")); - order.put("shippingAddressPostalCode", (String) context.get("shippingAddressPostalCode")); - order.put("shippingAddressCountry", (String) context.get("shippingAddressCountry")); - order.put("shippingAddressStateOrProvince", (String) context.get("shippingAddressStateOrProvince")); - order.put("shippingAddressCityName", (String) context.get("shippingAddressCityName")); + order.put("buyerName", context.get("buyerName")); + order.put("emailBuyer", context.get("emailBuyer")); + order.put("shippingAddressPhone", context.get("shippingAddressPhone")); + order.put("shippingAddressStreet", context.get("shippingAddressStreet")); + order.put("shippingAddressStreet1", context.get("shippingAddressStreet1")); + order.put("shippingAddressStreet2", context.get("shippingAddressStreet2")); + order.put("shippingAddressPostalCode", context.get("shippingAddressPostalCode")); + order.put("shippingAddressCountry", context.get("shippingAddressCountry")); + order.put("shippingAddressStateOrProvince", context.get("shippingAddressStateOrProvince")); + order.put("shippingAddressCityName", context.get("shippingAddressCityName")); result = createShoppingCart(delegator, dispatcher, locale, order, true); } catch (Exception e) { @@ -191,9 +191,9 @@ public class ImportOrdersFromEbay { } else { Iterator> orderIter = orders.iterator(); while (orderIter.hasNext()) { - Map order = (Map) orderIter.next(); - order.put("productStoreId", (String) context.get("productStoreId")); - order.put("userLogin", (GenericValue) context.get("userLogin")); + Map order = orderIter.next(); + order.put("productStoreId", context.get("productStoreId")); + order.put("userLogin", context.get("userLogin")); Map error = createShoppingCart(delegator, dispatcher, locale, order, false); String errorMsg = ServiceUtil.getErrorMessage(error); if (UtilValidate.isNotEmpty(errorMsg)) { @@ -317,7 +317,7 @@ public class ImportOrdersFromEbay { List errorList = UtilXml.childElementList(elemResponse, "Errors"); Iterator errorElemIter = errorList.iterator(); while (errorElemIter.hasNext()) { - Element errorElement = (Element) errorElemIter.next(); + Element errorElement = errorElemIter.next(); errorMessage = UtilXml.childElementValue(errorElement, "ShortMessage", ""); } return ServiceUtil.returnFailure(errorMessage); @@ -340,7 +340,7 @@ public class ImportOrdersFromEbay { int totalOrders = 0; Iterator paginationElemIter = paginationList.iterator(); while (paginationElemIter.hasNext()) { - Element paginationElement = (Element) paginationElemIter.next(); + Element paginationElement = paginationElemIter.next(); String totalNumberOfEntries = UtilXml.childElementValue(paginationElement, "TotalNumberOfEntries", "0"); totalOrders = Integer.valueOf(totalNumberOfEntries); } @@ -352,7 +352,7 @@ public class ImportOrdersFromEbay { List transactions = UtilXml.childElementList(elemResponse, "TransactionArray"); Iterator transactionsElemIter = transactions.iterator(); while (transactionsElemIter.hasNext()) { - Element transactionsElement = (Element) transactionsElemIter.next(); + Element transactionsElement = transactionsElemIter.next(); // retrieve transaction List transaction = UtilXml.childElementList(transactionsElement, "Transaction"); @@ -361,7 +361,7 @@ public class ImportOrdersFromEbay { Map order = FastMap.newInstance(); String itemId = ""; - Element transactionElement = (Element) transactionElemIter.next(); + Element transactionElement = transactionElemIter.next(); List containingOrders = UtilXml.childElementList(transactionElement, "ContainingOrder"); if (UtilValidate.isNotEmpty(containingOrders)) { continue; @@ -372,7 +372,7 @@ public class ImportOrdersFromEbay { List buyer = UtilXml.childElementList(transactionElement, "Buyer"); Iterator buyerElemIter = buyer.iterator(); while (buyerElemIter.hasNext()) { - Element buyerElement = (Element)buyerElemIter.next(); + Element buyerElement = buyerElemIter.next(); order.put("emailBuyer", UtilXml.childElementValue(buyerElement, "Email", "")); order.put("eiasTokenBuyer", UtilXml.childElementValue(buyerElement, "EIASToken", "")); order.put("ebayUserIdBuyer", UtilXml.childElementValue(buyerElement, "UserID", "")); @@ -381,13 +381,13 @@ public class ImportOrdersFromEbay { List buyerInfo = UtilXml.childElementList(buyerElement, "BuyerInfo"); Iterator buyerInfoElemIter = buyerInfo.iterator(); while (buyerInfoElemIter.hasNext()) { - Element buyerInfoElement = (Element)buyerInfoElemIter.next(); + Element buyerInfoElement = buyerInfoElemIter.next(); // retrieve shipping address List shippingAddressInfo = UtilXml.childElementList(buyerInfoElement, "ShippingAddress"); Iterator shippingAddressElemIter = shippingAddressInfo.iterator(); while (shippingAddressElemIter.hasNext()) { - Element shippingAddressElement = (Element)shippingAddressElemIter.next(); + Element shippingAddressElement = shippingAddressElemIter.next(); order.put("buyerName", UtilXml.childElementValue(shippingAddressElement, "Name", "")); order.put("shippingAddressStreet", UtilXml.childElementValue(shippingAddressElement, "Street", "")); order.put("shippingAddressStreet1", UtilXml.childElementValue(shippingAddressElement, "Street1", "")); @@ -406,7 +406,7 @@ public class ImportOrdersFromEbay { List shippingDetails = UtilXml.childElementList(transactionElement, "ShippingDetails"); Iterator shippingDetailsElemIter = shippingDetails.iterator(); while (shippingDetailsElemIter.hasNext()) { - Element shippingDetailsElement = (Element)shippingDetailsElemIter.next(); + Element shippingDetailsElement = shippingDetailsElemIter.next(); order.put("insuranceFee", UtilXml.childElementValue(shippingDetailsElement, "InsuranceFee", "0")); order.put("insuranceOption", UtilXml.childElementValue(shippingDetailsElement, "InsuranceOption", "")); order.put("insuranceWanted", UtilXml.childElementValue(shippingDetailsElement, "InsuranceWanted", "false")); @@ -415,7 +415,7 @@ public class ImportOrdersFromEbay { List salesTax = UtilXml.childElementList(shippingDetailsElement, "SalesTax"); Iterator salesTaxElemIter = salesTax.iterator(); while (salesTaxElemIter.hasNext()) { - Element salesTaxElement = (Element)salesTaxElemIter.next(); + Element salesTaxElement = salesTaxElemIter.next(); order.put("salesTaxAmount", UtilXml.childElementValue(salesTaxElement, "SalesTaxAmount", "0")); order.put("salesTaxPercent", UtilXml.childElementValue(salesTaxElement, "SalesTaxPercent", "0")); order.put("salesTaxState", UtilXml.childElementValue(salesTaxElement, "SalesTaxState", "0")); @@ -426,12 +426,12 @@ public class ImportOrdersFromEbay { List taxTable = UtilXml.childElementList(shippingDetailsElement, "TaxTable"); Iterator taxTableElemIter = taxTable.iterator(); while (taxTableElemIter.hasNext()) { - Element taxTableElement = (Element)taxTableElemIter.next(); + Element taxTableElement = taxTableElemIter.next(); List taxJurisdiction = UtilXml.childElementList(taxTableElement, "TaxJurisdiction"); Iterator taxJurisdictionElemIter = taxJurisdiction.iterator(); while (taxJurisdictionElemIter.hasNext()) { - Element taxJurisdictionElement = (Element)taxJurisdictionElemIter.next(); + Element taxJurisdictionElement = taxJurisdictionElemIter.next(); order.put("jurisdictionID", UtilXml.childElementValue(taxJurisdictionElement, "JurisdictionID", "")); order.put("jurisdictionSalesTaxPercent", UtilXml.childElementValue(taxJurisdictionElement, "SalesTaxPercent", "0")); @@ -447,7 +447,7 @@ public class ImportOrdersFromEbay { List item = UtilXml.childElementList(transactionElement, "Item"); Iterator itemElemIter = item.iterator(); while (itemElemIter.hasNext()) { - Element itemElement = (Element)itemElemIter.next(); + Element itemElement = itemElemIter.next(); itemId = UtilXml.childElementValue(itemElement, "ItemID", ""); order.put("paymentMethods", UtilXml.childElementValue(itemElement, "PaymentMethods", "")); order.put("quantity", UtilXml.childElementValue(itemElement, "Quantity", "0")); @@ -467,7 +467,7 @@ public class ImportOrdersFromEbay { List sellingStatus = UtilXml.childElementList(itemElement, "SellingStatus"); Iterator sellingStatusitemElemIter = sellingStatus.iterator(); while (sellingStatusitemElemIter.hasNext()) { - Element sellingStatusElement = (Element)sellingStatusitemElemIter.next(); + Element sellingStatusElement = sellingStatusitemElemIter.next(); order.put("amount", UtilXml.childElementValue(sellingStatusElement, "CurrentPrice", "0")); order.put("quantitySold", UtilXml.childElementValue(sellingStatusElement, "QuantitySold", "0")); order.put("listingStatus", UtilXml.childElementValue(sellingStatusElement, "ListingStatus", "")); @@ -481,7 +481,7 @@ public class ImportOrdersFromEbay { List status = UtilXml.childElementList(transactionElement, "Status"); Iterator statusElemIter = status.iterator(); while (statusElemIter.hasNext()) { - Element statusElement = (Element)statusElemIter.next(); + Element statusElement = statusElemIter.next(); order.put("eBayPaymentStatus", UtilXml.childElementValue(statusElement, "eBayPaymentStatus", "")); order.put("checkoutStatus", UtilXml.childElementValue(statusElement, "CheckoutStatus", "")); order.put("paymentMethodUsed", UtilXml.childElementValue(statusElement, "PaymentMethodUsed", "")); @@ -502,7 +502,7 @@ public class ImportOrdersFromEbay { GenericValue orderExist = externalOrderExists(delegator, (String)order.get("externalId")); if (orderExist != null) { - order.put("orderId", (String)orderExist.get("orderId")); + order.put("orderId", orderExist.get("orderId")); } else { order.put("orderId", ""); } @@ -514,7 +514,7 @@ public class ImportOrdersFromEbay { List externalTransaction = UtilXml.childElementList(transactionElement, "ExternalTransaction"); Iterator externalTransactionElemIter = externalTransaction.iterator(); while (externalTransactionElemIter.hasNext()) { - Element externalTransactionElement = (Element)externalTransactionElemIter.next(); + Element externalTransactionElement = externalTransactionElemIter.next(); order.put("externalTransactionID", UtilXml.childElementValue(externalTransactionElement, "ExternalTransactionID", "")); order.put("externalTransactionTime", UtilXml.childElementValue(externalTransactionElement, "ExternalTransactionTime", "")); order.put("feeOrCreditAmount", UtilXml.childElementValue(externalTransactionElement, "FeeOrCreditAmount", "0")); @@ -525,7 +525,7 @@ public class ImportOrdersFromEbay { List shippingServiceSelected = UtilXml.childElementList(transactionElement, "ShippingServiceSelected"); Iterator shippingServiceSelectedElemIter = shippingServiceSelected.iterator(); while (shippingServiceSelectedElemIter.hasNext()) { - Element shippingServiceSelectedElement = (Element)shippingServiceSelectedElemIter.next(); + Element shippingServiceSelectedElement = shippingServiceSelectedElemIter.next(); order.put("shippingService", UtilXml.childElementValue(shippingServiceSelectedElement, "ShippingService", "")); order.put("shippingServiceCost", UtilXml.childElementValue(shippingServiceSelectedElement, "ShippingServiceCost", "0")); @@ -570,7 +570,7 @@ public class ImportOrdersFromEbay { List errorList = UtilXml.childElementList(elemResponse, "Errors"); Iterator errorElemIter = errorList.iterator(); while (errorElemIter.hasNext()) { - Element errorElement = (Element) errorElemIter.next(); + Element errorElement = errorElemIter.next(); errorMessage.append(UtilXml.childElementValue(errorElement, "ShortMessage", "")); } } diff --git a/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayEvents.java b/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayEvents.java index 5c89ce2417..1a3a1d2dc0 100644 --- a/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayEvents.java +++ b/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayEvents.java @@ -329,7 +329,7 @@ public class EbayEvents { Debug.logError("Required productStoreId for get ebay API config data.", module); return null; } - ApiContext apiContext = EbayStoreHelper.getApiContext((String)request.getParameter("productStoreId") != null ? request.getParameter("productStoreId"):(String)request.getAttribute("productStoreId"), locale, delegator); + ApiContext apiContext = EbayStoreHelper.getApiContext(request.getParameter("productStoreId") != null ? request.getParameter("productStoreId"):(String)request.getAttribute("productStoreId"), locale, delegator); return apiContext; } @@ -376,7 +376,7 @@ public class EbayEvents { return categories; } if (request.getParameter("categoryId") != null || request.getAttribute("categoryId") != null) { - categoryId = (String) request.getParameter("categoryId") != null ? request.getParameter("categoryId") : (String) request.getAttribute("categoryId"); + categoryId = request.getParameter("categoryId") != null ? request.getParameter("categoryId") : (String) request.getAttribute("categoryId"); Debug.logInfo("Load child categories from session following site id and categoryId is ".concat(categoryId), module); } else { Debug.logWarning("No categoryId to get child categories.", module); @@ -434,7 +434,7 @@ public class EbayEvents { return categories; } if (UtilValidate.isNotEmpty(request.getParameter("categoryId")) || UtilValidate.isNotEmpty(request.getAttribute("categoryId"))) { - categoryId = (String) request.getParameter("categoryId") != null ? request.getParameter("categoryId") : (String) request.getAttribute("categoryId"); + categoryId = request.getParameter("categoryId") != null ? request.getParameter("categoryId") : (String) request.getAttribute("categoryId"); Debug.logInfo("Load child categories from session following site id and categoryId is ".concat(categoryId), module); } else { Debug.logWarning("No categoryId to get child categories.", module); @@ -488,7 +488,7 @@ public class EbayEvents { return null; } if (request.getParameter("categoryId") != null || request.getAttribute("categoryId") != null) { - categoryId = (String)request.getParameter("categoryId") != null ? request.getParameter("categoryId") : (String)request.getAttribute("categoryId"); + categoryId = request.getParameter("categoryId") != null ? request.getParameter("categoryId") : (String)request.getAttribute("categoryId"); Debug.logInfo("Load child categories from session following site id and categoryId is ".concat(categoryId), module); } else { Debug.logWarning("No categoryId to get child categories.", module); @@ -710,8 +710,8 @@ public class EbayEvents { NameValueListArrayType nameValueListArray = new NameValueListArrayType(); NameValueListType[] nameValueListTypes = new NameValueListType[nameSpecificList.size()]; for (int i = 0; i < itemSpecificsSize; i++) { - String name = (String) nameSpecificList.get(i); - String value = (String) valueSpecificList.get(i); + String name = nameSpecificList.get(i); + String value = valueSpecificList.get(i); String[] valueArray = new String[] { value }; // set Name value list type. @@ -972,7 +972,7 @@ public class EbayEvents { resp = (VerifyAddItemResponseType) verifyCall.execute(req); if (resp != null && "SUCCESS".equals(resp.getAck().toString())) { itemObj.put("isVerify", "Y"); - FeesType feest = (FeesType) resp.getFees(); + FeesType feest = resp.getFees(); FeeType[] fees = feest.getFee(); for (FeeType fee : fees) { double dfee = fee.getFee().getValue(); diff --git a/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStore.java b/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStore.java index 67f2d89b91..adcb2ea10e 100644 --- a/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStore.java +++ b/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStore.java @@ -462,9 +462,9 @@ public class EbayStore { productStore = delegator.findByPrimaryKey("ProductStore",UtilMisc.toMap("productStoreId", context.get("productStoreId").toString())); } Element itemElem = UtilXml.addChildElement(storeRequestElem, "Store", storeDocument); - UtilXml.addChildElementValue(itemElem, "Name", (String) productStore.getString("storeName"), storeDocument); + UtilXml.addChildElementValue(itemElem, "Name", productStore.getString("storeName"), storeDocument); UtilXml.addChildElementValue(itemElem, "SubscriptionLevel", "Basic", storeDocument); - UtilXml.addChildElementValue(itemElem, "Description", (String) productStore.getString("title"), storeDocument); + UtilXml.addChildElementValue(itemElem, "Description", productStore.getString("title"), storeDocument); dataStoreXml.append(UtilXml.writeXmlDocument(storeDocument)); } catch (Exception e) { @@ -939,7 +939,7 @@ public class EbayStore { Map storeColorSchemeMap = null; while (i < storeBasicTheme.length) { - StoreThemeType storeThemeType = (StoreThemeType) storeBasicTheme[i]; + StoreThemeType storeThemeType = storeBasicTheme[i]; if (themeId.equals(storeThemeType.getThemeID().toString())) { StoreColorSchemeType colorSchemeType = storeThemeType.getColorScheme(); if (colorSchemeType != null) { @@ -998,7 +998,7 @@ public class EbayStore { List> logoList = FastList.newInstance(); while (i < returnedLogoArray.getLogoLength()) { Map logo = FastMap.newInstance(); - StoreLogoType storeLogoType = (StoreLogoType) returnedLogoArray.getLogo(i); + StoreLogoType storeLogoType = returnedLogoArray.getLogo(i); logo.put("storeLogoId", storeLogoType.getLogoID()); logo.put("storeLogoName", storeLogoType.getName()); logo.put("storeLogoURL", storeLogoType.getURL()); @@ -1043,7 +1043,7 @@ public class EbayStore { List> themeList = FastList.newInstance(); while (i < returnedBasicThemeArray.getThemeLength()) { Map basictheme = FastMap.newInstance(); - StoreThemeType storeBasicThemeType = (StoreThemeType) returnedBasicThemeArray.getTheme(i); + StoreThemeType storeBasicThemeType = returnedBasicThemeArray.getTheme(i); basictheme.put("storeThemeId", storeBasicThemeType.getThemeID()); basictheme.put("storeThemeName", storeBasicThemeType.getName()); @@ -1109,7 +1109,7 @@ public class EbayStore { List> themeColorList = FastList.newInstance(); while (j < storeColorSchemeTypes.length) { Map advanceColorTheme = FastMap.newInstance(); - StoreColorSchemeType storeColorSchemeType = (StoreColorSchemeType) storeColorSchemeTypes[j]; + StoreColorSchemeType storeColorSchemeType = storeColorSchemeTypes[j]; advanceColorTheme.put("storeColorSchemeId", storeColorSchemeType.getColorSchemeID()); advanceColorTheme.put("storeColorName", storeColorSchemeType.getName()); themeColorList.add(advanceColorTheme); @@ -1156,7 +1156,7 @@ public class EbayStore { StoreColorSchemeType[] storeColorSchemeTypes = returnedThemeArray.getGenericColorSchemeArray().getColorScheme(); while (i < storeColorSchemeTypes.length) { - StoreColorSchemeType storeColorSchemeType = (StoreColorSchemeType) storeColorSchemeTypes[i]; + StoreColorSchemeType storeColorSchemeType = storeColorSchemeTypes[i]; StoreFontType storeFontType = storeColorSchemeType.getFont(); advanceFontTheme.put("storeFontTypeNameFaceColor",storeFontType.getNameColor()); int j = 0; @@ -1165,7 +1165,7 @@ public class EbayStore { List> nameFaces = FastList.newInstance(); while (j < storeFontNameFaceCodeTypes.length) { Map storeFontNameFaceCodeTypeMap = FastMap.newInstance(); - StoreFontFaceCodeType storeFontNameFaceCodeType = (StoreFontFaceCodeType) storeFontNameFaceCodeTypes[j]; + StoreFontFaceCodeType storeFontNameFaceCodeType = storeFontNameFaceCodeTypes[j]; storeFontNameFaceCodeTypeMap.put("storeFontValue", storeFontNameFaceCodeType.value()); storeFontNameFaceCodeTypeMap.put("storeFontName", storeFontNameFaceCodeType.name()); nameFaces.add(storeFontNameFaceCodeTypeMap); @@ -1178,7 +1178,7 @@ public class EbayStore { List> sizeFaces = FastList.newInstance(); while (j < storeFontSizeCodeTypes.length) { Map storeFontSizeCodeTypeMap = FastMap.newInstance(); - StoreFontSizeCodeType storeFontSizeCodeType = (StoreFontSizeCodeType) storeFontSizeCodeTypes[j]; + StoreFontSizeCodeType storeFontSizeCodeType = storeFontSizeCodeTypes[j]; storeFontSizeCodeTypeMap.put("storeFontSizeValue", storeFontSizeCodeType.value()); storeFontSizeCodeTypeMap.put("storeFontSizeName", storeFontSizeCodeType.name()); sizeFaces.add(storeFontSizeCodeTypeMap); @@ -1193,7 +1193,7 @@ public class EbayStore { List> titleFaces = FastList.newInstance(); while (j < storeFontTypeTitleFaces.length) { Map storeFontTypeTitleFaceMap = FastMap.newInstance(); - StoreFontFaceCodeType storeFontTypeTitleFace = (StoreFontFaceCodeType) storeFontTypeTitleFaces[j]; + StoreFontFaceCodeType storeFontTypeTitleFace = storeFontTypeTitleFaces[j]; storeFontTypeTitleFaceMap.put("storeFontValue", storeFontTypeTitleFace.value()); storeFontTypeTitleFaceMap.put("storeFontName", storeFontTypeTitleFace.name()); titleFaces.add(storeFontTypeTitleFaceMap); @@ -1207,7 +1207,7 @@ public class EbayStore { List> titleSizes = FastList.newInstance(); while (j < storeTitleSizeCodeTypes.length) { Map storeFontSizeCodeTypeMap = FastMap.newInstance(); - StoreFontSizeCodeType storeFontSizeCodeType = (StoreFontSizeCodeType) storeTitleSizeCodeTypes[j]; + StoreFontSizeCodeType storeFontSizeCodeType = storeTitleSizeCodeTypes[j]; storeFontSizeCodeTypeMap.put("storeFontSizeValue", storeFontSizeCodeType.value()); storeFontSizeCodeTypeMap.put("storeFontSizeName", storeFontSizeCodeType.name()); titleSizes.add(storeFontSizeCodeTypeMap); @@ -1223,7 +1223,7 @@ public class EbayStore { List> descFaces = FastList.newInstance(); while (j < storeFontTypeDescFaces.length) { Map storeFontTypeDescFaceMap = FastMap.newInstance(); - StoreFontFaceCodeType storeFontTypeDescFace = (StoreFontFaceCodeType) storeFontTypeDescFaces[j]; + StoreFontFaceCodeType storeFontTypeDescFace = storeFontTypeDescFaces[j]; storeFontTypeDescFaceMap.put("storeFontValue", storeFontTypeDescFace.value()); storeFontTypeDescFaceMap.put("storeFontName", storeFontTypeDescFace.name()); descFaces.add(storeFontTypeDescFaceMap); @@ -1237,7 +1237,7 @@ public class EbayStore { List> descSizes = FastList.newInstance(); while (j < storeDescSizeCodeTypes.length) { Map storeFontSizeCodeTypeMap = FastMap.newInstance(); - StoreFontSizeCodeType storeFontSizeCodeType = (StoreFontSizeCodeType) storeDescSizeCodeTypes[j]; + StoreFontSizeCodeType storeFontSizeCodeType = storeDescSizeCodeTypes[j]; storeFontSizeCodeTypeMap.put("storeFontSizeValue", storeFontSizeCodeType.value()); storeFontSizeCodeTypeMap.put("storeFontSizeName", storeFontSizeCodeType.name()); descSizes.add(storeFontSizeCodeTypeMap); diff --git a/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreAutoPreferences.java b/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreAutoPreferences.java index d496c71602..a50dfd88e6 100644 --- a/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreAutoPreferences.java +++ b/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreAutoPreferences.java @@ -799,7 +799,7 @@ public class EbayStoreAutoPreferences { if (soldGroupList.size() > 1) { for (int j = 0; j < soldGroupList.size(); j++) { - Map myMap = (Map) soldGroupList.get(j); + Map myMap = soldGroupList.get(j); SellingManagerSoldOrderType soldorder = (SellingManagerSoldOrderType) myMap.get("soldorder"); Timestamp createdate = UtilDateTime.toTimestamp(soldorder.getCreationTime().getTime()); if (myMap.get("group").toString().length() == 0) { @@ -826,7 +826,7 @@ public class EbayStoreAutoPreferences { int totalQty = 0; for (int j = 0; j < soldGroupList.size(); j++) { - Map myMap = (Map) soldGroupList.get(j); + Map myMap = soldGroupList.get(j); if (UtilValidate.isNotEmpty(myMap.get("group"))) { if (x == Integer.parseInt(myMap.get("group").toString())) { SellingManagerSoldOrderType sellingManagerSoldOrder = (SellingManagerSoldOrderType) myMap.get("soldorder"); @@ -915,7 +915,7 @@ public class EbayStoreAutoPreferences { public static void runCheckAndGroup(int groupRunning, Timestamp startTimestamp, long countDays, List> inList) { Timestamp endDate = UtilDateTime.getDayEnd(UtilDateTime.toTimestamp(startTimestamp), countDays); for (Map inMap : inList) { - String group = (String) inMap.get("group").toString(); + String group = inMap.get("group").toString(); SellingManagerSoldOrderType soldorder = (SellingManagerSoldOrderType) inMap.get("soldorder"); if (group.length() == 0) { Timestamp createtimestamp = UtilDateTime.toTimestamp(soldorder.getCreationTime().getTime()); @@ -955,7 +955,7 @@ public class EbayStoreAutoPreferences { if (allBidders.size() != 0) { // call to send email to bidder for (int j = 0; j < allBidders.size(); j++) { - Map bidder = (Map) allBidders.get(j); + Map bidder = allBidders.get(j); UserType user = (UserType) bidder.get("bidder"); String buyerUserId = bidder.get("userId").toString(); @@ -1171,7 +1171,7 @@ public class EbayStoreAutoPreferences { GenericValue userLogin = delegator.findOne("UserLogin", false, "userLoginId", "system"); String jobId = (String) context.get("jobId"); String productStoreId = (String) context.get("productStoreId"); - GenericValue ebayProductStorePref = (GenericValue) delegator.findByPrimaryKey("EbayProductStorePref", UtilMisc.toMap("productStoreId", productStoreId, "autoPrefEnumId", "EBAY_AUTO_BEST_OFFER")); + GenericValue ebayProductStorePref = delegator.findByPrimaryKey("EbayProductStorePref", UtilMisc.toMap("productStoreId", productStoreId, "autoPrefEnumId", "EBAY_AUTO_BEST_OFFER")); String parentPrefCondId = ebayProductStorePref.getString("parentPrefCondId"); List ebayProductStorePrefCond = delegator.findByAnd("EbayProductStorePrefCond", UtilMisc.toMap("parentPrefCondId", parentPrefCondId)); //Parameters diff --git a/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreCategoryFacade.java b/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreCategoryFacade.java index ab0b90b898..c9acfa237e 100644 --- a/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreCategoryFacade.java +++ b/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreCategoryFacade.java @@ -166,7 +166,7 @@ public class EbayStoreCategoryFacade { al.add(pm); } } - return (BuyerPaymentMethodCodeType[])al.toArray(new BuyerPaymentMethodCodeType[0]); + return al.toArray(new BuyerPaymentMethodCodeType[0]); } /** diff --git a/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreHelper.java b/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreHelper.java index ef0745a6f2..62f87a3bcd 100644 --- a/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreHelper.java +++ b/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreHelper.java @@ -405,7 +405,7 @@ public class EbayStoreHelper { public static void mappedShippingLocations(Map requestParams, ItemType item, ApiContext apiContext, HttpServletRequest request, HashMap attributeMapList) { try { if (UtilValidate.isNotEmpty(requestParams)) { - EbayStoreSiteFacade sf = (EbayStoreSiteFacade) EbayEvents.getSiteFacade(apiContext, request); + EbayStoreSiteFacade sf = EbayEvents.getSiteFacade(apiContext, request); Map eBayDetailsMap = sf.getEBayDetailsMap(); GeteBayDetailsResponseType eBayDetails = eBayDetailsMap.get(apiContext.getSite()); ShippingLocationDetailsType[] shippingLocationDetails = eBayDetails.getShippingLocationDetails(); @@ -413,7 +413,7 @@ public class EbayStoreHelper { int i = 0; String[] tempShipLocation = new String[shippingLocationDetails.length]; for (ShippingLocationDetailsType shippingLocationDetail : shippingLocationDetails) { - String shippingLocation = (String) shippingLocationDetail.getShippingLocation(); + String shippingLocation = shippingLocationDetail.getShippingLocation(); String shipParam = (String)requestParams.get("Shipping_".concat(shippingLocation)); if ("true".equals(shipParam)) { tempShipLocation[i] = shippingLocation; @@ -431,7 +431,7 @@ public class EbayStoreHelper { public static Map exportProductEachItem(DispatchContext dctx, Map context) { Map result = FastMap.newInstance(); - LocalDispatcher dispatcher = (LocalDispatcher) dctx.getDispatcher(); + LocalDispatcher dispatcher = dctx.getDispatcher(); Delegator delegator = dctx.getDelegator(); Map itemObject = (Map) context.get("itemObject"); String productListingId = itemObject.get("productListingId").toString(); @@ -658,7 +658,7 @@ public class EbayStoreHelper { AddOrderRequestType addReq = new AddOrderRequestType(); AddOrderResponseType addResp = null; OrderType newOrder = new OrderType(); - ShippingDetailsType shippingDetail = (ShippingDetailsType) order.getShippingDetails(); + ShippingDetailsType shippingDetail = order.getShippingDetails(); if (trackingOrders.size() > 0) { ShipmentTrackingDetailsType[] trackDetails = new ShipmentTrackingDetailsType[trackingOrders.size()]; for (int i = 0; i < trackDetails.length; i++) { diff --git a/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreOptions.java b/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreOptions.java index 8ff679a44e..5c5a19c9ac 100644 --- a/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreOptions.java +++ b/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreOptions.java @@ -92,7 +92,7 @@ public class EbayStoreOptions { Map storeColorSchemeMap = FastMap.newInstance(); while (i < storeBasicTheme.length) { - StoreThemeType storeThemeType = (StoreThemeType)storeBasicTheme[i]; + StoreThemeType storeThemeType = storeBasicTheme[i]; if (themeId.equals(storeThemeType.getThemeID().toString())) { StoreColorSchemeType colorSchemeType = storeThemeType.getColorScheme(); if (colorSchemeType != null) { diff --git a/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreOrder.java b/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreOrder.java index 6c6a71767d..638b3357ad 100644 --- a/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreOrder.java +++ b/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreOrder.java @@ -369,7 +369,7 @@ public class EbayStoreOrder { List> orderItemList = UtilGenerics.checkList(context.get("orderItemList")); Iterator> orderItemIter = orderItemList.iterator(); while (orderItemIter.hasNext()) { - Map orderItem = (Map) orderItemIter.next(); + Map orderItem = orderItemIter.next(); addItem(cart, orderItem, dispatcher, delegator, 0); } @@ -424,8 +424,8 @@ public class EbayStoreOrder { Map shippingAddressCtx = UtilGenerics.checkMap(context.get("shippingAddressCtx")); if (UtilValidate.isNotEmpty(shippingAddressCtx)) { String buyerName = (String) shippingAddressCtx.get("buyerName"); - String firstName = (String) buyerName.substring(0, buyerName.indexOf(" ")); - String lastName = (String) buyerName.substring(buyerName.indexOf(" ")+1); + String firstName = buyerName.substring(0, buyerName.indexOf(" ")); + String lastName = buyerName.substring(buyerName.indexOf(" ")+1); String country = (String) shippingAddressCtx.get("shippingAddressCountry"); String state = (String) shippingAddressCtx.get("shippingAddressStateOrProvince"); diff --git a/specialpurpose/googlebase/src/org/ofbiz/googlebase/GoogleBaseSearchEvents.java b/specialpurpose/googlebase/src/org/ofbiz/googlebase/GoogleBaseSearchEvents.java index 39ff9e1497..509d0178d2 100644 --- a/specialpurpose/googlebase/src/org/ofbiz/googlebase/GoogleBaseSearchEvents.java +++ b/specialpurpose/googlebase/src/org/ofbiz/googlebase/GoogleBaseSearchEvents.java @@ -55,7 +55,7 @@ public class GoogleBaseSearchEvents { LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher"); Locale locale = UtilHttp.getLocale(request); GenericValue userLogin = (GenericValue) request.getSession().getAttribute("userLogin"); - String selectResult = (String) request.getParameter("selectResult"); + String selectResult = request.getParameter("selectResult"); List productExportList = FastList.newInstance(); String errMsg = null; @@ -73,7 +73,7 @@ public class GoogleBaseSearchEvents { } GenericValue searchResultView = null; - while ((searchResultView = (GenericValue) eli.next()) != null) { + while ((searchResultView = eli.next()) != null) { productExportList.add(searchResultView.getString("mainProductId")); } eli.close(); @@ -84,15 +84,15 @@ public class GoogleBaseSearchEvents { productExportList.add(selectResult); } } - String webSiteUrl = (String) request.getParameter("webSiteUrl"); - String imageUrl = (String) request.getParameter("imageUrl"); - String actionType = (String) request.getParameter("actionType"); - String statusId = (String) request.getParameter("statusId"); - String testMode = (String) request.getParameter("testMode"); - String trackingCodeId = (String) request.getParameter("trackingCodeId"); - String webSiteMountPoint = (String) request.getParameter("webSiteMountPoint"); - String countryCode = (String) request.getParameter("countryCode"); - String productStoreId = (String) request.getParameter("productStoreId"); + String webSiteUrl = request.getParameter("webSiteUrl"); + String imageUrl = request.getParameter("imageUrl"); + String actionType = request.getParameter("actionType"); + String statusId = request.getParameter("statusId"); + String testMode = request.getParameter("testMode"); + String trackingCodeId = request.getParameter("trackingCodeId"); + String webSiteMountPoint = request.getParameter("webSiteMountPoint"); + String countryCode = request.getParameter("countryCode"); + String productStoreId = request.getParameter("productStoreId"); // Export all or selected products to Google Base try { diff --git a/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java b/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java index e028938719..dbab1d99a6 100644 --- a/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java +++ b/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java @@ -362,7 +362,7 @@ public class ProductsExportToGoogle { GenericValue googleProduct; while (productsListItr.hasNext()) { itemActionType = actionType; - GenericValue prod = (GenericValue)productsListItr.next(); + GenericValue prod = productsListItr.next(); String price = getProductPrice(dispatcher, prod); if (price == null) { Debug.logInfo("Price not found for product [" + prod.getString("productId")+ "]; product will not be exported.", module); @@ -445,7 +445,7 @@ public class ProductsExportToGoogle { Iterator productCategoryMembersIter = productCategoryMembers.iterator(); while (productCategoryMembersIter.hasNext()) { - GenericValue productCategoryMember = (GenericValue) productCategoryMembersIter.next(); + GenericValue productCategoryMember = productCategoryMembersIter.next(); GenericValue productCategory = productCategoryMember.getRelatedOne("ProductCategory"); String productCategoryTypeId = productCategory.getString("productCategoryTypeId"); if (UtilValidate.isNotEmpty(productCategoryTypeId) && "GOOGLE_BASE_CATEGORY".equals(productCategoryTypeId)) { @@ -544,10 +544,10 @@ public class ProductsExportToGoogle { Iterator atomEntryElemIter = atomEntryList.iterator(); int index = 0; while (atomEntryElemIter.hasNext()) { - Element atomEntryElement = (Element)atomEntryElemIter.next(); + Element atomEntryElement = atomEntryElemIter.next(); String id = UtilXml.childElementValue(atomEntryElement, "atom:id", ""); if (UtilValidate.isNotEmpty(id) && newProductsInGoogle.get(index) != null) { - String productId = (String)newProductsInGoogle.get(index); + String productId = newProductsInGoogle.get(index); try { GenericValue googleProductId = delegator.makeValue("GoodIdentification"); googleProductId.set("goodIdentificationTypeId", "GOOGLE_ID"); @@ -559,7 +559,7 @@ public class ProductsExportToGoogle { } } if (UtilValidate.isNotEmpty(id) && productsRemovedFromGoogle.get(index) != null) { - String productId = (String)productsRemovedFromGoogle.get(index); + String productId = productsRemovedFromGoogle.get(index); try { delegator.removeByAnd("GoodIdentification", UtilMisc.toMap("goodIdentificationTypeId", "GOOGLE_ID", "productId", productId)); } catch (GenericEntityException gee) { @@ -570,7 +570,7 @@ public class ProductsExportToGoogle { List batchStatusList = UtilXml.childElementList(atomEntryElement, "batch:status"); Iterator batchStatusEntryElemIter = batchStatusList.iterator(); while (batchStatusEntryElemIter.hasNext()) { - Element batchStatusEntryElement = (Element)batchStatusEntryElemIter.next(); + Element batchStatusEntryElement = batchStatusEntryElemIter.next(); if (UtilValidate.isNotEmpty(batchStatusEntryElement.getAttribute("reason"))) { message.add(title + " " + batchStatusEntryElement.getAttribute("reason")); } diff --git a/specialpurpose/ldap/src/org/ofbiz/ldap/activedirectory/OFBizActiveDirectoryAuthenticationHandler.java b/specialpurpose/ldap/src/org/ofbiz/ldap/activedirectory/OFBizActiveDirectoryAuthenticationHandler.java index 183f51be4c..75f8d245c4 100644 --- a/specialpurpose/ldap/src/org/ofbiz/ldap/activedirectory/OFBizActiveDirectoryAuthenticationHandler.java +++ b/specialpurpose/ldap/src/org/ofbiz/ldap/activedirectory/OFBizActiveDirectoryAuthenticationHandler.java @@ -97,7 +97,7 @@ public final class OFBizActiveDirectoryAuthenticationHandler extends AbstractOFB "(&(" + filter + ") (" + attribute +"))", controls); if (answer.hasMoreElements()) { - result = (SearchResult) answer.next(); + result = answer.next(); if (bindRequired) { env.put(Context.SECURITY_AUTHENTICATION, authenType); // specify the username diff --git a/specialpurpose/ldap/src/org/ofbiz/ldap/openldap/OFBizLdapAuthenticationHandler.java b/specialpurpose/ldap/src/org/ofbiz/ldap/openldap/OFBizLdapAuthenticationHandler.java index 6dc44f63fe..0180be93d8 100644 --- a/specialpurpose/ldap/src/org/ofbiz/ldap/openldap/OFBizLdapAuthenticationHandler.java +++ b/specialpurpose/ldap/src/org/ofbiz/ldap/openldap/OFBizLdapAuthenticationHandler.java @@ -82,7 +82,7 @@ public final class OFBizLdapAuthenticationHandler extends AbstractOFBizAuthentic "(&(" + filter + ") (" + attribute +"))", controls); if (answer.hasMoreElements()) { - result = (SearchResult) answer.next(); + result = answer.next(); if (bindRequired) { env.put(Context.SECURITY_AUTHENTICATION, authenType); // specify the username diff --git a/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java b/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java index 983260bf49..b9a41a29c0 100644 --- a/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java +++ b/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java @@ -1023,7 +1023,7 @@ public class OagisInventoryServices { Double returnQuantityDbl = returnItem.getDouble("returnQuantity"); if (UtilValidate.isNotEmpty(productId) && returnQuantityDbl != null) { double newTotal = returnQuantityDbl.doubleValue(); - Double existingTotal = (Double) returnQuantityByProductIdMap.get(productId); + Double existingTotal = returnQuantityByProductIdMap.get(productId); if (existingTotal != null) newTotal += existingTotal.doubleValue(); returnQuantityByProductIdMap.put(productId, new Double(newTotal)); } diff --git a/specialpurpose/oagis/src/org/ofbiz/oagis/OagisServices.java b/specialpurpose/oagis/src/org/ofbiz/oagis/OagisServices.java index ab5f38b893..be2d18906c 100644 --- a/specialpurpose/oagis/src/org/ofbiz/oagis/OagisServices.java +++ b/specialpurpose/oagis/src/org/ofbiz/oagis/OagisServices.java @@ -450,7 +450,7 @@ public class OagisServices { // try looking up by just the referenceId, those alone are often unique, return error if there is more than one result List oagisMessageInfoList = delegator.findByAnd("OagisMessageInfo", UtilMisc.toMap("referenceId", referenceId)); if (oagisMessageInfoList.size() == 1) { - oagisMessageInfo = (GenericValue) oagisMessageInfoList.get(0); + oagisMessageInfo = oagisMessageInfoList.get(0); } else if (oagisMessageInfoList.size() > 1) { return ServiceUtil.returnError("Looked up by referenceId because logicalId, component, or task were not passed in but found more than one [" + oagisMessageInfoList.size() + "] record with referenceId [" + referenceId + "]"); } diff --git a/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java b/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java index b0af8c7dd1..0c13819fac 100644 --- a/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java +++ b/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java @@ -218,7 +218,7 @@ public class OagisShipmentServices { String shipGroupSeqId = shipment.getString("primaryShipGroupSeqId"); String originFacilityId = shipment.getString("originFacilityId"); - Element shipUnitFirstElement = (Element)shipUnitElementList.get(0); + Element shipUnitFirstElement = shipUnitElementList.get(0); String trackingNum = UtilXml.childElementValue(shipUnitFirstElement, "of:TRACKINGID"); // of String carrierCode = UtilXml.childElementValue(shipUnitFirstElement, "of:CARRIER"); // of if (UtilValidate.isNotEmpty(carrierCode)) { @@ -343,7 +343,7 @@ public class OagisShipmentServices { Debug.logError(errMsg, module); continue; } - GenericValue shipmentItem = (GenericValue) shipmentItemList.get(0); + GenericValue shipmentItem = shipmentItemList.get(0); String shipmentItemSeqId = shipmentItem.getString("shipmentItemSeqId"); GenericValue orderShipment = EntityUtil.getFirst(delegator.findByAnd("OrderShipment", UtilMisc.toMap("shipmentId", shipmentId, "shipmentItemSeqId", shipmentItemSeqId))); @@ -395,7 +395,7 @@ public class OagisShipmentServices { // because there may be more than one ShipmentItem for an OrderItem allow there to be more inventory reservations for the //OrderItem than there is quantity on the current ShipmentItem - if ((int) totalReserved < messageQuantity.intValue()) { + if (totalReserved < messageQuantity.intValue()) { String errMsg = "Inventory reservation quantity [" + totalReserved + "] was less than the message quantity [" + messageQuantity.intValue() + "] so cannot receive against reservations for ShipmentItem with ID [" + shipmentId + ":" + shipmentItemSeqId + "], and OrderItem [" + orderShipment.getString("orderId") + ":" + orderShipment.getString("orderItemSeqId") + "]"; errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "SerialNumbersMissing")); Debug.logInfo(errMsg, module); diff --git a/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java b/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java index 46b6cf0642..4e3894e5a0 100644 --- a/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java +++ b/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java @@ -367,8 +367,8 @@ public class PosTransaction implements Serializable { //Debug.log("AuthTrans - " + authTrans, module); if ("PaymentMethodType".equals(infValue.getEntityName())) { - payInfo.put("description", (String) infValue.get("description", locale)); - payInfo.put("payInfo", (String) infValue.get("description", locale)); + payInfo.put("description", infValue.get("description", locale)); + payInfo.put("payInfo", infValue.get("description", locale)); payInfo.put("amount", UtilFormatOut.formatPrice(inf.amount)); } else { String paymentMethodTypeId = infValue.getString("paymentMethodTypeId"); @@ -379,7 +379,7 @@ public class PosTransaction implements Serializable { Debug.logError(e, module); } if (pmt != null) { - payInfo.put("description", (String) pmt.get("description", locale)); + payInfo.put("description", pmt.get("description", locale)); payInfo.put("amount", UtilFormatOut.formatPrice(inf.amount)); } diff --git a/specialpurpose/pos/src/org/ofbiz/pos/adaptor/KeyboardAdaptor.java b/specialpurpose/pos/src/org/ofbiz/pos/adaptor/KeyboardAdaptor.java index 18a425786c..d7432cc0f4 100644 --- a/specialpurpose/pos/src/org/ofbiz/pos/adaptor/KeyboardAdaptor.java +++ b/specialpurpose/pos/src/org/ofbiz/pos/adaptor/KeyboardAdaptor.java @@ -134,10 +134,10 @@ public class KeyboardAdaptor { if (chars.length == 0) { // non-character data from keyboard interface (i.e. FN keys, enter, esc, etc) return KEYBOARD_DATA; - } else if (((int) chars[0]) == 2 && ((int) chars[chars.length - 1]) == 10) { + } else if ((chars[0]) == 2 && (chars[chars.length - 1]) == 10) { // test for scanner data return SCANNER_DATA; - } else if (((int) chars[0]) == 37 && ((int) chars[chars.length - 1]) == 10) { + } else if ((chars[0]) == 37 && (chars[chars.length - 1]) == 10) { // test for MSR data return MSR_DATA; } else { @@ -164,17 +164,17 @@ public class KeyboardAdaptor { int[] codes = new int[keyCodeData.size()]; for (int i = 0; i < codes.length; i++) { - Integer itg = (Integer) keyCodeData.get(i); + Integer itg = keyCodeData.get(i); codes[i] = itg.intValue(); } for (int i = 0; i < chars.length; i++) { - Character ch = (Character) keyCharData.get(i); + Character ch = keyCharData.get(i); chars[i] = ch.charValue(); } for (KeyboardReceiver receiver : receivers.keySet()) { - int receiverType = ((Integer) receivers.get(receiver)).intValue(); + int receiverType = (receivers.get(receiver)).intValue(); int thisDataType = this.checkDataType(chars); if (receiverType == ALL_DATA || receiverType == thisDataType) { receiver.receiveData(codes, chars); diff --git a/specialpurpose/pos/src/org/ofbiz/pos/component/Input.java b/specialpurpose/pos/src/org/ofbiz/pos/component/Input.java index ce28cd88b0..7e44deb258 100644 --- a/specialpurpose/pos/src/org/ofbiz/pos/component/Input.java +++ b/specialpurpose/pos/src/org/ofbiz/pos/component/Input.java @@ -96,7 +96,7 @@ public class Input implements KeyboardReceiver, KeyListener { public String[] getLastFunction() { String[] f = null; try { - f = (String[]) this.functionStack.peek(); + f = this.functionStack.peek(); } catch (EmptyStackException e) { } return f; @@ -105,7 +105,7 @@ public class Input implements KeyboardReceiver, KeyListener { public String[] clearLastFunction() { String[] f = null; try { - f = (String[]) this.functionStack.pop(); + f = this.functionStack.pop(); } catch (EmptyStackException e) { } return f; @@ -123,7 +123,7 @@ public class Input implements KeyboardReceiver, KeyListener { public String[] clearFunction(String function) { Iterator i = functionStack.iterator(); while (i.hasNext()) { - String[] func = (String[]) i.next(); + String[] func = i.next(); if (func[0].equals(function)) { i.remove(); return func; @@ -195,7 +195,7 @@ public class Input implements KeyboardReceiver, KeyListener { boolean process = false; int remIdx = 0; for (int i = 0; i < chars.length; i++) { - if (((int) chars[i]) == 10 || ((int) chars[i]) == 8 || ((int) chars[i] == 27)) { + if ((chars[i]) == 10 || (chars[i]) == 8 || (chars[i] == 27)) { idxToRemove[remIdx++] = i+1; } else { process = true; diff --git a/specialpurpose/pos/src/org/ofbiz/pos/component/Journal.java b/specialpurpose/pos/src/org/ofbiz/pos/component/Journal.java index bd3f694103..bbb529d608 100644 --- a/specialpurpose/pos/src/org/ofbiz/pos/component/Journal.java +++ b/specialpurpose/pos/src/org/ofbiz/pos/component/Journal.java @@ -38,7 +38,7 @@ import org.ofbiz.pos.screen.PosScreen; public class Journal { public static final String module = Journal.class.getName(); - protected XProject currentProject = (XProject)XProjectManager.getCurrentProject(); + protected XProject currentProject = XProjectManager.getCurrentProject(); private static String[] field = { "sku", "desc", "qty", "price" }; private static String[] name = { "PosSku", "PosItem", "PosQty", "PosAmt" }; diff --git a/specialpurpose/pos/src/org/ofbiz/pos/component/PosButton.java b/specialpurpose/pos/src/org/ofbiz/pos/component/PosButton.java index f7cfa7ffad..bea180dfa4 100644 --- a/specialpurpose/pos/src/org/ofbiz/pos/component/PosButton.java +++ b/specialpurpose/pos/src/org/ofbiz/pos/component/PosButton.java @@ -92,7 +92,7 @@ public class PosButton { } public void setLock(String buttonName, boolean lock) { - PosButtonWrapper button = (PosButtonWrapper) loadedXButtons.get(buttonName); + PosButtonWrapper button = loadedXButtons.get(buttonName); button.setEnabled(!lock); } diff --git a/specialpurpose/pos/src/org/ofbiz/pos/component/PosButtonWrapper.java b/specialpurpose/pos/src/org/ofbiz/pos/component/PosButtonWrapper.java index 65294a6adb..246b409156 100644 --- a/specialpurpose/pos/src/org/ofbiz/pos/component/PosButtonWrapper.java +++ b/specialpurpose/pos/src/org/ofbiz/pos/component/PosButtonWrapper.java @@ -203,7 +203,7 @@ public class PosButtonWrapper { // we can only wrap if : // 1) we have a space available // 2) the next character is a space - if (space == -1 && ((int)text.charAt(thisPosition)) != 32) { + if (space == -1 && (text.charAt(thisPosition)) != 32) { buf.append(text); break; } else { diff --git a/specialpurpose/pos/src/org/ofbiz/pos/device/DeviceLoader.java b/specialpurpose/pos/src/org/ofbiz/pos/device/DeviceLoader.java index 39b455a7e4..394865362f 100644 --- a/specialpurpose/pos/src/org/ofbiz/pos/device/DeviceLoader.java +++ b/specialpurpose/pos/src/org/ofbiz/pos/device/DeviceLoader.java @@ -53,7 +53,7 @@ public class DeviceLoader { public static void load(Map devices) throws GeneralException { // load the keyboard if (devices.get("Keyboard") != null) { - String keyboardDevice = ((ContainerConfig.Container.Property) devices.get("Keyboard")).value; + String keyboardDevice = (devices.get("Keyboard")).value; if (UtilValidate.isNotEmpty(keyboardDevice) && !"[NOT IMPLEMENTED]".equals(keyboardDevice)) { keyboard = new Keyboard(keyboardDevice, -1); try { @@ -67,7 +67,7 @@ public class DeviceLoader { // load the scanner if (devices.get("Scanner") != null) { - String scannerDevice = ((ContainerConfig.Container.Property) devices.get("Scanner")).value; + String scannerDevice = (devices.get("Scanner")).value; if (UtilValidate.isNotEmpty(scannerDevice) && !"[NOT IMPLEMENTED]".equals(scannerDevice)) { scanner = new Scanner(scannerDevice, -1); try { @@ -81,7 +81,7 @@ public class DeviceLoader { // load the check reader if (devices.get("CheckScanner") != null) { - String checkScannerDevice = ((ContainerConfig.Container.Property) devices.get("CheckScanner")).value; + String checkScannerDevice = (devices.get("CheckScanner")).value; if (UtilValidate.isNotEmpty(checkScannerDevice) && !"[NOT IMPLEMENTED]".equals(checkScannerDevice)) { check = new CheckScanner(checkScannerDevice, -1); try { @@ -95,7 +95,7 @@ public class DeviceLoader { // load the msr if (devices.get("Msr") != null) { - String msrDevice = ((ContainerConfig.Container.Property) devices.get("Msr")).value; + String msrDevice = (devices.get("Msr")).value; if (UtilValidate.isNotEmpty(msrDevice) && !"[NOT IMPLEMENTED]".equals(msrDevice)) { msr = new Msr(msrDevice, -1); try { @@ -109,7 +109,7 @@ public class DeviceLoader { // load the receipt printer if (devices.get("Receipt") != null) { - String receiptDevice = ((ContainerConfig.Container.Property) devices.get("Receipt")).value; + String receiptDevice = (devices.get("Receipt")).value; if (UtilValidate.isNotEmpty(receiptDevice) && !"[NOT IMPLEMENTED]".equals(receiptDevice)) { receipt = new Receipt(receiptDevice, -1); try { @@ -123,7 +123,7 @@ public class DeviceLoader { // load the journal printer if (devices.get("Journal") != null) { - String journalDevice = ((ContainerConfig.Container.Property) devices.get("Journal")).value; + String journalDevice = (devices.get("Journal")).value; if (UtilValidate.isNotEmpty(journalDevice) && !"[NOT IMPLEMENTED]".equals(journalDevice)) { journal = new Journal(journalDevice, -1); try { @@ -137,7 +137,7 @@ public class DeviceLoader { // load the line display if (devices.get("LineDisplay") != null) { - String lineDisplayDevice = ((ContainerConfig.Container.Property) devices.get("LineDisplay")).value; + String lineDisplayDevice = (devices.get("LineDisplay")).value; if (UtilValidate.isNotEmpty(lineDisplayDevice) && !"[NOT IMPLEMENTED]".equals(lineDisplayDevice)) { ldisplay = new LineDisplay(lineDisplayDevice, -1); try { @@ -153,7 +153,7 @@ public class DeviceLoader { for (int i = 1; i < 10; i++) { // more than 10 cash drawers on a terminal?? String idName = "CashDrawer." + i; if (devices.get(idName) != null) { - String cashDrawerDevice = ((ContainerConfig.Container.Property) devices.get(idName)).value; + String cashDrawerDevice = (devices.get(idName)).value; if (UtilValidate.isNotEmpty(cashDrawerDevice) && !"[NOT IMPLEMENTED]".equals(cashDrawerDevice)) { if (drawer == null) { drawer = new CashDrawer[10]; diff --git a/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java b/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java index 6cfccb5c99..af0a755c54 100644 --- a/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java +++ b/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java @@ -435,7 +435,7 @@ public class ManagerEvents { PaidInOut PaidInOut = new PaidInOut(trans, pos, type); Map mapInOut = PaidInOut.openDlg(); if (null != mapInOut.get("amount")) { - String amount = (String) mapInOut.get("amount"); + String amount = mapInOut.get("amount"); BigDecimal amt = ZERO; try { amt = new BigDecimal(amount); @@ -503,7 +503,7 @@ public class ManagerEvents { if (eli != null) { GenericValue ohpp; - while (((ohpp = (GenericValue) eli.next()) != null)) { + while (((ohpp = eli.next()) != null)) { Timestamp orderDate = ohpp.getTimestamp("orderDate"); if (orderDate.after(dayStart) && orderDate.before(dayEnd)) { String pmt = ohpp.getString("paymentMethodTypeId"); diff --git a/specialpurpose/pos/src/org/ofbiz/pos/jpos/service/KeyboardService.java b/specialpurpose/pos/src/org/ofbiz/pos/jpos/service/KeyboardService.java index d47e872ea9..38e5c1bfa6 100644 --- a/specialpurpose/pos/src/org/ofbiz/pos/jpos/service/KeyboardService.java +++ b/specialpurpose/pos/src/org/ofbiz/pos/jpos/service/KeyboardService.java @@ -138,7 +138,7 @@ public class KeyboardService extends BaseService implements jpos.services.POSKey if (lastEvent != null) { KeyEvent thisEvent = lastEvent; PosKey thisKey = new PosKey(thisEvent); - PosKey mappedKey = (PosKey) keyMapping.get(thisKey.hashCode()); + PosKey mappedKey = keyMapping.get(thisKey.hashCode()); if (mappedKey != null && mappedKey.checkModifiers(thisEvent.getModifiersEx())) { this.received = true; this.keyData = mappedKey.getMappedCode(); diff --git a/specialpurpose/pos/src/org/ofbiz/pos/jpos/service/MsrKybService.java b/specialpurpose/pos/src/org/ofbiz/pos/jpos/service/MsrKybService.java index ffa4bfcee7..00980f300d 100644 --- a/specialpurpose/pos/src/org/ofbiz/pos/jpos/service/MsrKybService.java +++ b/specialpurpose/pos/src/org/ofbiz/pos/jpos/service/MsrKybService.java @@ -284,15 +284,15 @@ public class MsrKybService extends BaseService implements jpos.services.MSRServi if (this.parseDecodeData) { // set the sentinels this.sentinels = new int[4]; - this.sentinels[0] = (int) tr1BegChar.charAt(0); - this.sentinels[1] = (int) tr1EndChar.charAt(0); - this.sentinels[2] = (int) tr2BegChar.charAt(0); - this.sentinels[3] = (int) tr2EndChar.charAt(0); + this.sentinels[0] = tr1BegChar.charAt(0); + this.sentinels[1] = tr1EndChar.charAt(0); + this.sentinels[2] = tr2BegChar.charAt(0); + this.sentinels[3] = tr2EndChar.charAt(0); // set the lrcs this.lrc = new int[2]; - this.lrc[0] = (int) tr1LrcCode.charAt(0); - this.lrc[1] = (int) tr2LrcCode.charAt(0); + this.lrc[0] = tr1LrcCode.charAt(0); + this.lrc[1] = tr2LrcCode.charAt(0); // set the account number this.accountNumber = new String[2]; diff --git a/specialpurpose/pos/src/org/ofbiz/pos/jpos/service/ScannerKybService.java b/specialpurpose/pos/src/org/ofbiz/pos/jpos/service/ScannerKybService.java index 614fc8df54..6fac501136 100644 --- a/specialpurpose/pos/src/org/ofbiz/pos/jpos/service/ScannerKybService.java +++ b/specialpurpose/pos/src/org/ofbiz/pos/jpos/service/ScannerKybService.java @@ -109,7 +109,7 @@ public class ScannerKybService extends BaseService implements jpos.services.Scan public int getScanDataType() throws JposException { if (codeId != null && barcodeIdMap.containsKey(codeId)) { - return ((Integer) barcodeIdMap.get(codeId)).intValue(); + return (barcodeIdMap.get(codeId)).intValue(); } return ScannerConst.SCAN_SDT_UNKNOWN; } diff --git a/specialpurpose/pos/src/org/ofbiz/pos/screen/ClientProfile.java b/specialpurpose/pos/src/org/ofbiz/pos/screen/ClientProfile.java index cfa5d4069e..f3ada6c6f1 100644 --- a/specialpurpose/pos/src/org/ofbiz/pos/screen/ClientProfile.java +++ b/specialpurpose/pos/src/org/ofbiz/pos/screen/ClientProfile.java @@ -276,12 +276,12 @@ public class ClientProfile extends XPage implements ActionListener { m_clientListBidingCombo.clear(); if (UtilValidate.isNotEmpty(partyList)) { for (Map party : partyList) { - name = (String) party.get("lastName"); - email = (String) party.get("infoString"); - phone = (String) party.get("contactNumber"); - String partyId = (String) party.get("partyId"); + name = party.get("lastName"); + email = party.get("infoString"); + phone = party.get("contactNumber"); + String partyId = party.get("partyId"); m_clientListBidingCombo.add(partyId); - card = (String) party.get("cardId"); + card = party.get("cardId"); name = name == null ? "" : name; email = email == null ? "" : email; phone = phone == null ? "" : phone; diff --git a/specialpurpose/pos/src/org/ofbiz/pos/screen/ConfigureItem.java b/specialpurpose/pos/src/org/ofbiz/pos/screen/ConfigureItem.java index 981f8bcea3..8c72691e89 100644 --- a/specialpurpose/pos/src/org/ofbiz/pos/screen/ConfigureItem.java +++ b/specialpurpose/pos/src/org/ofbiz/pos/screen/ConfigureItem.java @@ -412,7 +412,7 @@ public class ConfigureItem extends XPage { //for(int i: selected) { // Debug.logInfo(""+i, module); //} - List options = (List)question.getOptions(); + List options = question.getOptions(); for (ConfigOption option: options) { option.setSelected(false); } diff --git a/specialpurpose/pos/src/org/ofbiz/pos/screen/PaidInOut.java b/specialpurpose/pos/src/org/ofbiz/pos/screen/PaidInOut.java index 165339d57a..204ecc8baa 100644 --- a/specialpurpose/pos/src/org/ofbiz/pos/screen/PaidInOut.java +++ b/specialpurpose/pos/src/org/ofbiz/pos/screen/PaidInOut.java @@ -123,7 +123,7 @@ public class PaidInOut extends XPage { } else { return UtilMisc.toMap("amount", m_amountEdit.getText(), "reason", (String)(posPaidReasons.get(m_reasonCombo.getSelectedIndex())).get("enumId"), - "reasonComment", (String) m_reasonCommentEdit.getText()); + "reasonComment", m_reasonCommentEdit.getText()); } } diff --git a/specialpurpose/pos/src/org/ofbiz/pos/screen/PosScreen.java b/specialpurpose/pos/src/org/ofbiz/pos/screen/PosScreen.java index 8e76c910ff..afa8b76e0b 100644 --- a/specialpurpose/pos/src/org/ofbiz/pos/screen/PosScreen.java +++ b/specialpurpose/pos/src/org/ofbiz/pos/screen/PosScreen.java @@ -58,7 +58,7 @@ public class PosScreen extends XPage implements Runnable, DialogCallback, FocusL public static final long MAX_INACTIVITY = Long.valueOf(UtilProperties.getPropertyValue(PosTransaction.resource, "MaxInactivity", "1800000")); public static PosScreen currentScreen; - protected XProject currentProject = (XProject)XProjectManager.getCurrentProject(); + protected XProject currentProject = XProjectManager.getCurrentProject(); protected static boolean monitorRunning = false; protected static boolean firstInit = false; protected static long lastActivity = 0; diff --git a/specialpurpose/workflow/src/org/ofbiz/workflow/WfApplicationServices.java b/specialpurpose/workflow/src/org/ofbiz/workflow/WfApplicationServices.java index 3a1d4670c0..69fd2caad6 100644 --- a/specialpurpose/workflow/src/org/ofbiz/workflow/WfApplicationServices.java +++ b/specialpurpose/workflow/src/org/ofbiz/workflow/WfApplicationServices.java @@ -316,7 +316,7 @@ public class WfApplicationServices { } if (assigments.size() != 1) Debug.logWarning("More than one accepted activities found for the workEffortId=" + workEffortId, module); - return (GenericValue) assigments.iterator().next(); + return assigments.iterator().next(); } catch (GenericEntityException ee) { throw new GenericServiceException(ee.getMessage(), ee); } diff --git a/specialpurpose/workflow/src/org/ofbiz/workflow/WfFactory.java b/specialpurpose/workflow/src/org/ofbiz/workflow/WfFactory.java index ec791ba788..fc92b86e88 100644 --- a/specialpurpose/workflow/src/org/ofbiz/workflow/WfFactory.java +++ b/specialpurpose/workflow/src/org/ofbiz/workflow/WfFactory.java @@ -144,7 +144,7 @@ public class WfFactory { } } } - return (WfProcessMgr) wfProcessMgrCache.get(key); + return wfProcessMgrCache.get(key); } /** @@ -200,7 +200,7 @@ public class WfFactory { wfClientCache.put(dctx, new WorkflowClient(dctx)); } } - return (WorkflowClient) wfClientCache.get(dctx); + return wfClientCache.get(dctx); } } diff --git a/specialpurpose/workflow/src/org/ofbiz/workflow/WfUtil.java b/specialpurpose/workflow/src/org/ofbiz/workflow/WfUtil.java index 713b62713e..e62f37d8cb 100644 --- a/specialpurpose/workflow/src/org/ofbiz/workflow/WfUtil.java +++ b/specialpurpose/workflow/src/org/ofbiz/workflow/WfUtil.java @@ -38,7 +38,7 @@ public final class WfUtil { */ public static final String getJavaType(String xpdlType) { if (typeMap.containsKey(xpdlType)) - return (String) typeMap.get(xpdlType); + return typeMap.get(xpdlType); else return "java.lang.Object"; } diff --git a/specialpurpose/workflow/src/org/ofbiz/workflow/client/WorkflowClient.java b/specialpurpose/workflow/src/org/ofbiz/workflow/client/WorkflowClient.java index c4ec101e37..b25aa603ef 100644 --- a/specialpurpose/workflow/src/org/ofbiz/workflow/client/WorkflowClient.java +++ b/specialpurpose/workflow/src/org/ofbiz/workflow/client/WorkflowClient.java @@ -388,12 +388,12 @@ public class WorkflowClient { WfExecutionObject obj = null; try { - obj = (WfExecutionObject) WfFactory.getWfActivity(delegator, workEffortId); + obj = WfFactory.getWfActivity(delegator, workEffortId); } catch (WfException e) {// ingore } if (obj == null) { try { - obj = (WfExecutionObject) WfFactory.getWfProcess(delegator, workEffortId); + obj = WfFactory.getWfProcess(delegator, workEffortId); } catch (WfException e) {// ignore } } diff --git a/specialpurpose/workflow/src/org/ofbiz/workflow/impl/ServiceCondition.java b/specialpurpose/workflow/src/org/ofbiz/workflow/impl/ServiceCondition.java index 4528369872..c2a1c4ed89 100644 --- a/specialpurpose/workflow/src/org/ofbiz/workflow/impl/ServiceCondition.java +++ b/specialpurpose/workflow/src/org/ofbiz/workflow/impl/ServiceCondition.java @@ -43,7 +43,7 @@ public class ServiceCondition implements TransitionCondition { */ public Boolean evaluateCondition(Map context, Map attrs, String expression, DispatchContext dctx) throws EvaluationException { // get the service to call - String serviceName = (String) attrs.get("serviceName"); + String serviceName = attrs.get("serviceName"); if (UtilValidate.isEmpty(serviceName)) throw new EvaluationException("Invalid serviceName; be sure to set the serviceName ExtendedAttribute"); diff --git a/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfActivityImpl.java b/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfActivityImpl.java index 550fde1446..a5c51007f0 100644 --- a/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfActivityImpl.java +++ b/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfActivityImpl.java @@ -730,7 +730,7 @@ public class WfActivityImpl extends WfExecutionObjectImpl implements WfActivity if (howManyAssignment() == 1) { Debug.logVerbose("Single assignment; getting assignment info.", module); List assignments = getAssignments(); - WfAssignment assign = (WfAssignment) assignments.iterator().next(); + WfAssignment assign = assignments.iterator().next(); WfResource res = assign.assignee(); context.put("assignedPartyId", res.resourcePartyId()); context.put("assignedRoleTypeId", res.resourceRoleId()); @@ -764,7 +764,7 @@ public class WfActivityImpl extends WfExecutionObjectImpl implements WfActivity // direct assignment from context actualContext.put(key, context.get(key)); } else if (!actualContext.containsKey(key) && !ignoreUnknown) { - throw new WfException("Context does not contain the key: '" + (String) key + "'"); + throw new WfException("Context does not contain the key: '" + key + "'"); } } } diff --git a/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfActivityToolImplementation.java b/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfActivityToolImplementation.java index 6268ca4015..ad8155ebd8 100644 --- a/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfActivityToolImplementation.java +++ b/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfActivityToolImplementation.java @@ -73,7 +73,7 @@ public class WfActivityToolImplementation extends WfActivityAbstractImplementati Map extendedAttr = StringUtil.strToMap(extend); if (extendedAttr != null && extendedAttr.containsKey("serviceName")) { - serviceName = (String) extendedAttr.get("serviceName"); + serviceName = extendedAttr.get("serviceName"); } serviceName = serviceName != null ? serviceName : (toolTypeEnumId.equals("WTT_APPLICATION") ? "wfActivateApplication" : toolId); diff --git a/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfAssignmentImpl.java b/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfAssignmentImpl.java index e8c04c1380..796360765b 100644 --- a/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfAssignmentImpl.java +++ b/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfAssignmentImpl.java @@ -125,7 +125,7 @@ public class WfAssignmentImpl implements WfAssignment { Iterator ai = activity.getIteratorAssignment(); while (ai.hasNext() && allDelegated) { - WfAssignment a = (WfAssignment) ai.next(); + WfAssignment a = ai.next(); if (!a.equals(this) && !a.status().equals("CAL_DELEGATED")) { allDelegated = false; } @@ -140,7 +140,7 @@ public class WfAssignmentImpl implements WfAssignment { Iterator ai = activity.getIteratorAssignment(); while (ai.hasNext()) { - WfAssignment a = (WfAssignment) ai.next(); + WfAssignment a = ai.next(); if (!this.isEqual(a)) a.delegate(); } } diff --git a/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfProcessImpl.java b/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfProcessImpl.java index 80272bf9d2..0604d07430 100644 --- a/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfProcessImpl.java +++ b/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfProcessImpl.java @@ -444,7 +444,7 @@ public class WfProcessImpl extends WfExecutionObjectImpl implements WfProcess { // check for a conditionClassName attribute if exists use it if (extendedAttr != null && extendedAttr.get("conditionClassName") != null) { - String conditionClassName = (String) extendedAttr.get("conditionClassName"); + String conditionClassName = extendedAttr.get("conditionClassName"); transitionOk = this.evalConditionClass(conditionClassName, conditionBody, this.processContext(), extendedAttr); } else { // since no condition class is supplied, evaluate the expression using bsh diff --git a/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfRequesterImpl.java b/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfRequesterImpl.java index 7a63f96dcf..b34cf3439d 100644 --- a/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfRequesterImpl.java +++ b/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfRequesterImpl.java @@ -151,7 +151,7 @@ public class WfRequesterImpl implements WfRequester { GenericRequester req = null; if (performers.containsKey(process)) - req = (GenericRequester) performers.get(process); + req = performers.get(process); if (req != null) req.receiveResult(process.result()); }