diff --git a/assetmaint/src/main/java/org/apache/ofbiz/assetmaint/FixedAssetMaintServices.java b/assetmaint/src/main/java/org/apache/ofbiz/assetmaint/FixedAssetMaintServices.java index 93850af59..64831e8f0 100644 --- a/assetmaint/src/main/java/org/apache/ofbiz/assetmaint/FixedAssetMaintServices.java +++ b/assetmaint/src/main/java/org/apache/ofbiz/assetmaint/FixedAssetMaintServices.java @@ -55,7 +55,7 @@ public static Map addPartFixedAssetMaint(DispatchContext ctx, Ma String productId = (String)context.get("productId"); String facilityId = (String)context.get("facilityId"); Double quantity = (Double)context.get("quantity"); - double requestedQty = quantity.doubleValue(); + double requestedQty = quantity; try { GenericValue product = ProductWorker.findProduct(delegator, productId); @@ -87,13 +87,13 @@ public static Map addPartFixedAssetMaint(DispatchContext ctx, Ma while (requestedQty > 0 && itr.hasNext()) { GenericValue inventoryItem = itr.next(); String inventoryItemId = inventoryItem.getString("inventoryItemId"); - atp = inventoryItem.getDouble("availableToPromiseTotal").doubleValue(); + atp = inventoryItem.getDouble("availableToPromiseTotal"); findCurrInventoryParams = UtilMisc.toMap("inventoryItemId", inventoryItemId); Double issueQuantity = null; if (requestedQty > atp) { - issueQuantity = new Double(atp); + issueQuantity = atp; } else { - issueQuantity = new Double(requestedQty); + issueQuantity = requestedQty; } Map itemIssuanceCtx = new HashMap(); itemIssuanceCtx.put("userLogin", userLogin); @@ -106,7 +106,7 @@ public static Map addPartFixedAssetMaint(DispatchContext ctx, Ma if (ServiceUtil.isError(result)) { return ServiceUtil.returnError(UtilProperties.getMessage(resource, "AssetMaintProblemCallingService", locale), null, null, result); } - requestedQty = requestedQty - issueQuantity.doubleValue(); + requestedQty = requestedQty - issueQuantity; } } catch (GenericEntityException e) { Debug.logError("Problem in retriving data from database", module); diff --git a/ebay/src/main/java/org/apache/ofbiz/ebay/EbayHelper.java b/ebay/src/main/java/org/apache/ofbiz/ebay/EbayHelper.java index f5c21bcf6..1ecdd2806 100644 --- a/ebay/src/main/java/org/apache/ofbiz/ebay/EbayHelper.java +++ b/ebay/src/main/java/org/apache/ofbiz/ebay/EbayHelper.java @@ -287,7 +287,7 @@ public static GenericValue makeOrderAdjustment(Delegator delegator, String order "orderItemSeqId", orderItemSeqId, "shipGroupSeqId", shipGroupSeqId, "amount", new BigDecimal(amount)); if (sourcePercentage != 0) { - inputMap.put("sourcePercentage", new Double(sourcePercentage)); + inputMap.put("sourcePercentage", sourcePercentage); } orderAdjustment = delegator.makeValue("OrderAdjustment", inputMap); } catch (Exception e) { diff --git a/ebay/src/main/java/org/apache/ofbiz/ebay/EbayOrderServices.java b/ebay/src/main/java/org/apache/ofbiz/ebay/EbayOrderServices.java index 42283386c..3613c4e45 100644 --- a/ebay/src/main/java/org/apache/ofbiz/ebay/EbayOrderServices.java +++ b/ebay/src/main/java/org/apache/ofbiz/ebay/EbayOrderServices.java @@ -743,13 +743,13 @@ private static List> readGetSellerTransactionResponse(String double shippingSurcharge = 0; if (UtilValidate.isNotEmpty(incuranceCost)) { - shippingInsuranceCost = new Double(incuranceCost).doubleValue(); + shippingInsuranceCost = new Double(incuranceCost); } if (UtilValidate.isNotEmpty(additionalCost)) { - shippingServiceAdditionalCost = new Double(additionalCost).doubleValue(); + shippingServiceAdditionalCost = new Double(additionalCost); } if (UtilValidate.isNotEmpty(surchargeCost)) { - shippingSurcharge = new Double(surchargeCost).doubleValue(); + shippingSurcharge = new Double(surchargeCost); } double shippingTotalAdditionalCost = shippingInsuranceCost + shippingServiceAdditionalCost + shippingSurcharge; String totalAdditionalCost = new Double(shippingTotalAdditionalCost).toString(); @@ -1063,7 +1063,7 @@ private static Map createShoppingCart(Delegator delegator, Local String shippingCost = (String) shippingServiceSelectedCtx.get("shippingServiceCost"); if (UtilValidate.isNotEmpty(shippingCost)) { - double shippingAmount = new Double(shippingCost).doubleValue(); + double shippingAmount = new Double(shippingCost); if (shippingAmount > 0) { GenericValue shippingAdjustment = EbayHelper.makeOrderAdjustment(delegator, "SHIPPING_CHARGES", cart.getOrderId(), null, null, shippingAmount, 0.0); if (shippingAdjustment != null) { @@ -1074,7 +1074,7 @@ private static Map createShoppingCart(Delegator delegator, Local // Apply additional shipping costs as order adjustment String shippingTotalAdditionalCost = (String) shippingServiceSelectedCtx.get("shippingTotalAdditionalCost"); if (UtilValidate.isNotEmpty(shippingTotalAdditionalCost)) { - double shippingAdditionalCost = new Double(shippingTotalAdditionalCost).doubleValue(); + double shippingAdditionalCost = new Double(shippingTotalAdditionalCost); if (shippingAdditionalCost > 0) { GenericValue shippingAdjustment = EbayHelper.makeOrderAdjustment(delegator, "MISCELLANEOUS_CHARGE", cart.getOrderId(), null, null, shippingAdditionalCost, 0.0); if (shippingAdjustment != null) { @@ -1087,11 +1087,11 @@ private static Map createShoppingCart(Delegator delegator, Local String salesTaxAmount = (String) shippingDetailsCtx.get("salesTaxAmount"); String salesTaxPercent = (String) shippingDetailsCtx.get("salesTaxPercent"); if (UtilValidate.isNotEmpty(salesTaxAmount)) { - double salesTaxAmountTotal = new Double(salesTaxAmount).doubleValue(); + double salesTaxAmountTotal = new Double(salesTaxAmount); if (salesTaxAmountTotal > 0) { double salesPercent = 0.0; if (UtilValidate.isNotEmpty(salesTaxPercent)) { - salesPercent = new Double(salesTaxPercent).doubleValue(); + salesPercent = new Double(salesTaxPercent); } GenericValue salesTaxAdjustment = EbayHelper.makeOrderAdjustment(delegator, "SALES_TAX", cart.getOrderId(), null, null, salesTaxAmountTotal, salesPercent); if (salesTaxAdjustment != null) { diff --git a/ebay/src/main/java/org/apache/ofbiz/ebay/ImportOrdersFromEbay.java b/ebay/src/main/java/org/apache/ofbiz/ebay/ImportOrdersFromEbay.java index a1f400b36..9d3663c1a 100755 --- a/ebay/src/main/java/org/apache/ofbiz/ebay/ImportOrdersFromEbay.java +++ b/ebay/src/main/java/org/apache/ofbiz/ebay/ImportOrdersFromEbay.java @@ -545,15 +545,15 @@ private static List> readResponseFromEbay(String msg, Locale double shippingSurcharge = 0; if (UtilValidate.isNotEmpty(incuranceCost)) { - shippingInsuranceCost = new Double(incuranceCost).doubleValue(); + shippingInsuranceCost = new Double(incuranceCost); } if (UtilValidate.isNotEmpty(additionalCost)) { - shippingServiceAdditionalCost = new Double(additionalCost).doubleValue(); + shippingServiceAdditionalCost = new Double(additionalCost); } if (UtilValidate.isNotEmpty(surchargeCost)) { - shippingSurcharge = new Double(surchargeCost).doubleValue(); + shippingSurcharge = new Double(surchargeCost); } double shippingTotalAdditionalCost = shippingInsuranceCost + shippingServiceAdditionalCost + shippingSurcharge; @@ -681,7 +681,7 @@ private static Map createShoppingCart(Delegator delegator, Local // Apply shipping costs as order adjustment String shippingCost = (String) parameters.get("shippingServiceCost"); if (UtilValidate.isNotEmpty(shippingCost)) { - double shippingAmount = new Double(shippingCost).doubleValue(); + double shippingAmount = new Double(shippingCost); if (shippingAmount > 0) { GenericValue shippingAdjustment = EbayHelper.makeOrderAdjustment(delegator, "SHIPPING_CHARGES", cart.getOrderId(), null, null, shippingAmount, 0.0); if (shippingAdjustment != null) { @@ -693,7 +693,7 @@ private static Map createShoppingCart(Delegator delegator, Local // Apply additional shipping costs as order adjustment String shippingTotalAdditionalCost = (String) parameters.get("shippingTotalAdditionalCost"); if (UtilValidate.isNotEmpty(shippingTotalAdditionalCost)) { - double shippingAdditionalCost = new Double(shippingTotalAdditionalCost).doubleValue(); + double shippingAdditionalCost = new Double(shippingTotalAdditionalCost); if (shippingAdditionalCost > 0) { GenericValue shippingAdjustment = EbayHelper.makeOrderAdjustment(delegator, "MISCELLANEOUS_CHARGE", cart.getOrderId(), null, null, shippingAdditionalCost, 0.0); if (shippingAdjustment != null) { @@ -706,11 +706,11 @@ private static Map createShoppingCart(Delegator delegator, Local String salesTaxAmount = (String) parameters.get("salesTaxAmount"); String salesTaxPercent = (String) parameters.get("salesTaxPercent"); if (UtilValidate.isNotEmpty(salesTaxAmount)) { - double salesTaxAmountTotal = new Double(salesTaxAmount).doubleValue(); + double salesTaxAmountTotal = new Double(salesTaxAmount); if (salesTaxAmountTotal > 0) { double salesPercent = 0.0; if (UtilValidate.isNotEmpty(salesTaxPercent)) { - salesPercent = new Double(salesTaxPercent).doubleValue(); + salesPercent = new Double(salesTaxPercent); } GenericValue salesTaxAdjustment = EbayHelper.makeOrderAdjustment(delegator, "SALES_TAX", cart.getOrderId(), null, null, salesTaxAmountTotal, salesPercent); if (salesTaxAdjustment != null) { diff --git a/ebay/src/main/java/org/apache/ofbiz/ebay/ProductsExportToEbay.java b/ebay/src/main/java/org/apache/ofbiz/ebay/ProductsExportToEbay.java index f3b446d01..0d50e4658 100755 --- a/ebay/src/main/java/org/apache/ofbiz/ebay/ProductsExportToEbay.java +++ b/ebay/src/main/java/org/apache/ofbiz/ebay/ProductsExportToEbay.java @@ -525,7 +525,7 @@ public static Map getEbayCategories(DispatchContext dctx, Map EbayStoreCreateTransactionShoppingCart(Dispatc String shippingTotalAdditionalCost = context.get("shippingTotalAdditionalCost").toString(); if (UtilValidate.isNotEmpty(shippingTotalAdditionalCost)) { - double shippingAdditionalCost = new Double(shippingTotalAdditionalCost).doubleValue(); + double shippingAdditionalCost = new Double(shippingTotalAdditionalCost); if (shippingAdditionalCost > 0) { GenericValue shippingAdjustment = EbayHelper.makeOrderAdjustment(delegator, "MISCELLANEOUS_CHARGE", cart.getOrderId(), null, null, shippingAdditionalCost, 0.0); if (shippingAdjustment != null) { @@ -199,11 +199,11 @@ public static Map EbayStoreCreateTransactionShoppingCart(Dispatc String salesTaxAmount = context.get("salesTaxAmount").toString(); String salesTaxPercent = context.get("salesTaxPercent").toString(); if (UtilValidate.isNotEmpty(salesTaxAmount)) { - double salesTaxAmountTotal = new Double(salesTaxAmount).doubleValue(); + double salesTaxAmountTotal = new Double(salesTaxAmount); if (salesTaxAmountTotal > 0) { double salesPercent = 0.0; if (UtilValidate.isNotEmpty(salesTaxPercent)) { - salesPercent = new Double(salesTaxPercent).doubleValue(); + salesPercent = new Double(salesTaxPercent); } GenericValue salesTaxAdjustment = EbayHelper.makeOrderAdjustment(delegator, "SALES_TAX", cart.getOrderId(), null, null, salesTaxAmountTotal, salesPercent); if (salesTaxAdjustment != null) { @@ -404,7 +404,7 @@ public static Map EbayStoreCreateOrderShoppingCart(DispatchConte if (salesTaxAmount.doubleValue() > 0) { double salesPercent = 0.0; if (UtilValidate.isNotEmpty(shippingDetailsCtx.get("salesTaxPercent"))) { - salesPercent = new Double(shippingDetailsCtx.get("salesTaxPercent").toString()).doubleValue(); + salesPercent = new Double(shippingDetailsCtx.get("salesTaxPercent").toString()); } GenericValue salesTaxAdjustment = EbayHelper.makeOrderAdjustment(delegator, "SALES_TAX", cart.getOrderId(), null, null, salesTaxAmount.doubleValue(), salesPercent); if (salesTaxAdjustment != null) { diff --git a/lucene/src/main/java/org/apache/ofbiz/content/search/ProductDocument.java b/lucene/src/main/java/org/apache/ofbiz/content/search/ProductDocument.java index 61d79c1b4..8afa07135 100644 --- a/lucene/src/main/java/org/apache/ofbiz/content/search/ProductDocument.java +++ b/lucene/src/main/java/org/apache/ofbiz/content/search/ProductDocument.java @@ -183,7 +183,7 @@ public Document prepareDocument(Delegator delegator) { int weight = 1; try { // this is defaulting to a weight of 1 because you specified you wanted to index this type - weight = EntityUtilProperties.getPropertyAsInteger("prodsearch", "index.weight.ProductContent." + productContentTypeId, 1).intValue(); + weight = EntityUtilProperties.getPropertyAsInteger("prodsearch", "index.weight.ProductContent." + productContentTypeId, 1); } catch (Exception e) { Debug.logWarning("Could not parse weight number: " + e.toString(), module); } diff --git a/passport/src/main/java/org/apache/ofbiz/passport/event/GitHubEvents.java b/passport/src/main/java/org/apache/ofbiz/passport/event/GitHubEvents.java index 5c022161a..03a718462 100644 --- a/passport/src/main/java/org/apache/ofbiz/passport/event/GitHubEvents.java +++ b/passport/src/main/java/org/apache/ofbiz/passport/event/GitHubEvents.java @@ -285,7 +285,7 @@ private static String checkLoginGitHubUser(HttpServletRequest request, Map getCellContents(XSSFRow row, List colNames, int si cell = row.getCell(i); } if (cell == null) { - if (((Boolean) colNames.get(i)[2]).booleanValue()) { + if ((Boolean) colNames.get(i)[2]) { report.print(UtilProperties.getMessage(resource, "ErrorColCannotEmpty", new Object[] {colNames.get(i)[0]}, locale), InterfaceReport.FORMAT_WARNING); errorMessages.put(new CellReference(cell), UtilProperties.getMessage(resource, "ErrorColCannotEmpty", new Object[] {colNames.get(i)[0]}, locale)); foundError = true; @@ -439,14 +439,14 @@ public List getCellContents(XSSFRow row, List colNames, int si } else { report.print(((i == 0)?"":","), InterfaceReport.FORMAT_NOTE); } - if (((Boolean) colNames.get(i)[2]).booleanValue() && UtilValidate.isEmpty(cellValue)) { + if ((Boolean) colNames.get(i)[2] && UtilValidate.isEmpty(cellValue)) { report.print(UtilProperties.getMessage(resource, "ErrorColCannotEmpty", new Object[] {colNames.get(i)[0]}, locale), InterfaceReport.FORMAT_WARNING); errorMessages.put(new CellReference(cell), UtilProperties.getMessage(resource, "ErrorColCannotEmpty", new Object[] {colNames.get(i)[0]}, locale)); foundError = true; results.add(null); continue; } - if (((Boolean) colNames.get(i)[2]).booleanValue() && cellType != (int) colNames.get(i)[1]) { + if ((Boolean) colNames.get(i)[2] && cellType != (int) colNames.get(i)[1]) { // String warningMessage = ""; if ((int) colNames.get(i)[1] == XSSFCell.CELL_TYPE_STRING) { results.add(cellValue); @@ -562,7 +562,7 @@ public synchronized void endExcelImportHistory(String logFileName, String thruRe } Timestamp now = UtilDateTime.nowTimestamp(); if (UtilValidate.isEmpty(historyValue)) { - historyValue = delegator.makeValue("ExcelImportHistory", UtilMisc.toMap("sequenceNum", Long.valueOf(sequenceNum), "userLoginId", userLoginId, + historyValue = delegator.makeValue("ExcelImportHistory", UtilMisc.toMap("sequenceNum", sequenceNum, "userLoginId", userLoginId, "fileName", pricatFile.getName(), "statusId", "EXCEL_IMPORTED", "fromDate", now, "thruDate", now, "threadName", threadName, "logFileName", logFileName)); } else { diff --git a/pricat/src/main/java/org/apache/ofbiz/pricat/sample/SamplePricatParser.java b/pricat/src/main/java/org/apache/ofbiz/pricat/sample/SamplePricatParser.java index d2a966554..be5f3370d 100644 --- a/pricat/src/main/java/org/apache/ofbiz/pricat/sample/SamplePricatParser.java +++ b/pricat/src/main/java/org/apache/ofbiz/pricat/sample/SamplePricatParser.java @@ -558,7 +558,7 @@ public List getCellContents(XSSFRow row, List colNames, int si cell = row.getCell(i); } if (cell == null) { - if (((Boolean) colNames.get(i)[2]).booleanValue() && (facilities.keySet().size() > 1 || (facilities.keySet().size() == 1 && i >= 2))) { + if ((Boolean) colNames.get(i)[2] && (facilities.keySet().size() > 1 || (facilities.keySet().size() == 1 && i >= 2))) { report.print(UtilProperties.getMessage(resource, "ErrorColCannotEmpty", new Object[] {colNames.get(i)[0]}, locale), InterfaceReport.FORMAT_WARNING); cell = row.createCell(i); errorMessages.put(new CellReference(cell), UtilProperties.getMessage(resource, "ErrorColCannotEmpty", new Object[] {colNames.get(i)[0]}, locale)); @@ -589,14 +589,14 @@ public List getCellContents(XSSFRow row, List colNames, int si } else { report.print(((i == 0)?"":","), InterfaceReport.FORMAT_NOTE); } - if (((Boolean) colNames.get(i)[2]).booleanValue() && UtilValidate.isEmpty(cellValue) && (facilities.keySet().size() > 1 || (facilities.keySet().size() == 1 && i >= 2))) { + if ((Boolean) colNames.get(i)[2] && UtilValidate.isEmpty(cellValue) && (facilities.keySet().size() > 1 || (facilities.keySet().size() == 1 && i >= 2))) { report.print(UtilProperties.getMessage(resource, "ErrorColCannotEmpty", new Object[] {colNames.get(i)[0]}, locale), InterfaceReport.FORMAT_WARNING); errorMessages.put(new CellReference(cell), UtilProperties.getMessage(resource, "ErrorColCannotEmpty", new Object[] {colNames.get(i)[0]}, locale)); foundError = true; results.add(null); continue; } - if (((Boolean) colNames.get(i)[2]).booleanValue() && cellType != (int) colNames.get(i)[1]) { + if ((Boolean) colNames.get(i)[2] && cellType != (int) colNames.get(i)[1]) { // String warningMessage = ""; if ((int) colNames.get(i)[1] == XSSFCell.CELL_TYPE_STRING) { if (UtilValidate.isNotEmpty(cellValue) && UtilValidate.isNotEmpty(cellValue.trim())) { diff --git a/projectmgr/src/main/java/org/apache/ofbiz/project/Various.java b/projectmgr/src/main/java/org/apache/ofbiz/project/Various.java index fa9017fe6..aad84777b 100644 --- a/projectmgr/src/main/java/org/apache/ofbiz/project/Various.java +++ b/projectmgr/src/main/java/org/apache/ofbiz/project/Various.java @@ -65,7 +65,7 @@ public static Timestamp calculateCompletionDate(GenericValue task, Timestamp sta standard.put("estimatedNumPeople", new Double("1")); } if (standard.get("estimatedDuration") != null) { - plannedHours += standard.getDouble("estimatedDuration").doubleValue() / standard.getDouble("estimatedNumPeople").doubleValue(); + plannedHours += standard.getDouble("estimatedDuration") / standard.getDouble("estimatedNumPeople"); } } @@ -96,7 +96,7 @@ public static double calculateActualHours(Delegator delegator, String timesheetI if (actuals.size() > 0) { for (GenericValue actual : actuals) { Double hour = (Double) actual.get("hours"); - double hours = hour.doubleValue(); + double hours = hour; actualHours = actualHours + hours; } } diff --git a/solr/src/main/java/org/apache/ofbiz/solr/SolrProductSearch.java b/solr/src/main/java/org/apache/ofbiz/solr/SolrProductSearch.java index afefe11c5..6b9180512 100644 --- a/solr/src/main/java/org/apache/ofbiz/solr/SolrProductSearch.java +++ b/solr/src/main/java/org/apache/ofbiz/solr/SolrProductSearch.java @@ -484,8 +484,8 @@ public static Map keywordSearch(DispatchContext dctx, Map facetQuery = queryResult.getFacetQuery(); Map facetQueries = new HashMap(); for (String fq : facetQuery.keySet()) { - if (facetQuery.get(fq).intValue() > 0) - facetQueries.put(fq, fq.replaceAll("^.*\\u005B(.*)\\u005D", "$1") + " (" + facetQuery.get(fq).intValue() + ")"); + if (facetQuery.get(fq) > 0) + facetQueries.put(fq, fq.replaceAll("^.*\\u005B(.*)\\u005D", "$1") + " (" + facetQuery.get(fq) + ")"); } Map> facetFields = new HashMap>(); diff --git a/webpos/src/main/java/org/apache/ofbiz/webpos/session/WebPosSession.java b/webpos/src/main/java/org/apache/ofbiz/webpos/session/WebPosSession.java index 62ad48f03..0e86ddded 100755 --- a/webpos/src/main/java/org/apache/ofbiz/webpos/session/WebPosSession.java +++ b/webpos/src/main/java/org/apache/ofbiz/webpos/session/WebPosSession.java @@ -235,7 +235,7 @@ public boolean isManagerLoggedIn() { if (UtilValidate.isEmpty(mgrLoggedIn)) { mgrLoggedIn = hasRole(getUserLogin(), "MANAGER"); } - return mgrLoggedIn.booleanValue(); + return mgrLoggedIn; } public WebPosTransaction getCurrentTransaction() { diff --git a/webpos/src/main/java/org/apache/ofbiz/webpos/transaction/WebPosTransaction.java b/webpos/src/main/java/org/apache/ofbiz/webpos/transaction/WebPosTransaction.java index 953af7b79..03ecf9637 100755 --- a/webpos/src/main/java/org/apache/ofbiz/webpos/transaction/WebPosTransaction.java +++ b/webpos/src/main/java/org/apache/ofbiz/webpos/transaction/WebPosTransaction.java @@ -147,7 +147,7 @@ public GenericValue getTerminalState() { public void closeTx() { if (UtilValidate.isNotEmpty(txLog)) { txLog.set("statusId", "POSTX_CLOSED"); - txLog.set("itemCount", new Long(getCart().size())); + txLog.set("itemCount", (long) getCart().size()); txLog.set("logEndDateTime", UtilDateTime.nowTimestamp()); try { txLog.store(); @@ -245,7 +245,7 @@ public BigDecimal processSale() throws GeneralException { // save the TX Log txLog.set("statusId", "POSTX_SOLD"); txLog.set("orderId", orderId); - txLog.set("itemCount", new Long(getCart().size())); + txLog.set("itemCount", (long) getCart().size()); txLog.set("logEndDateTime", UtilDateTime.nowTimestamp()); try { txLog.store();