diff --git a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/agreement/AgreementServices.java b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/agreement/AgreementServices.java index d0eb8f299c..bc6596f28b 100644 --- a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/agreement/AgreementServices.java +++ b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/agreement/AgreementServices.java @@ -140,9 +140,9 @@ public class AgreementServices { // if days is greater than zero, then it has been set with another value, so we use the lowest term days // if days is less than zero, then it has not been set yet. if (days > 0) { - days = Math.min(days, termDays.longValue()); + days = Math.min(days, termDays); } else { - days = termDays.longValue(); + days = termDays; } } } @@ -163,7 +163,7 @@ public class AgreementServices { "currencyUomId", agreementItem.getString("currencyUomId"), "productId", productId); if (days >= 0) { - partyCommissionResult.put("days", Long.valueOf(days)); + partyCommissionResult.put("days", days); } if (!commissions.contains(partyCommissionResult)) { commissions.add(partyCommissionResult); diff --git a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/finaccount/FinAccountPaymentServices.java b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/finaccount/FinAccountPaymentServices.java index 7161a69979..3202ea08eb 100644 --- a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/finaccount/FinAccountPaymentServices.java +++ b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/finaccount/FinAccountPaymentServices.java @@ -258,7 +258,7 @@ public class FinAccountPaymentServices { if (finAccountSettings != null && finAccountSettings.getLong("authValidDays") != null) { thruDate = UtilDateTime.getDayEnd(UtilDateTime.nowTimestamp(), finAccountSettings.getLong("authValidDays")); } else { - thruDate = UtilDateTime.getDayEnd(UtilDateTime.nowTimestamp(), Long.valueOf(30)); // default 30 days for an auth + thruDate = UtilDateTime.getDayEnd(UtilDateTime.nowTimestamp(), 30L); // default 30 days for an auth } Map tmpResult = dispatcher.runSync("createFinAccountAuth", UtilMisc.toMap("finAccountId", finAccountId, diff --git a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/invoice/InvoiceServices.java b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/invoice/InvoiceServices.java index bb8e4edb1a..920625f2da 100644 --- a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/invoice/InvoiceServices.java +++ b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/invoice/InvoiceServices.java @@ -1520,7 +1520,7 @@ public class InvoiceServices { // total ordered orderedQty = orderItem.getBigDecimal("quantity"); - if (dropShipmentFound && createSalesInvoicesForDropShipments.booleanValue()) { + if (dropShipmentFound && createSalesInvoicesForDropShipments) { // Override the issueQty with the quantity from the purchase order item GenericValue orderItemAssoc = EntityUtil.getFirst(EntityUtil.filterByAnd(orderItemAssocs, UtilMisc.toMap("orderId", issue.getString("orderId"), "orderItemSeqId", issue.getString("orderItemSeqId")))); @@ -1822,8 +1822,8 @@ public class InvoiceServices { } // If the authorization fails, create the invoice anyway, but make a note of it - boolean authFinished = ((Boolean) authResult.get("finished")).booleanValue(); - boolean authErrors = ((Boolean) authResult.get("errors")).booleanValue(); + boolean authFinished = (Boolean) authResult.get("finished"); + boolean authErrors = (Boolean) authResult.get("errors"); if (authErrors || ! authFinished) { String errMsg = UtilProperties.getMessage(resource, "AccountingUnableToAuthAdditionalShipCharges", UtilMisc.toMap("shipmentId", shipmentId, "paymentMethodId", paymentMethodId, "orderPaymentPreferenceId", orderPaymentPreferenceId), locale); Debug.logError(errMsg, module); diff --git a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/PaymentGatewayServices.java b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/PaymentGatewayServices.java index 2281b22272..0be6fbc621 100644 --- a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/PaymentGatewayServices.java +++ b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/PaymentGatewayServices.java @@ -138,11 +138,11 @@ public class PaymentGatewayServices { // get the process attempts so far Long procAttempt = orderPaymentPreference.getLong("processAttempt"); if (procAttempt == null) { - procAttempt = Long.valueOf(0); + procAttempt = 0L; } // update the process attempt count - orderPaymentPreference.set("processAttempt", Long.valueOf(procAttempt.longValue() + 1)); + orderPaymentPreference.set("processAttempt", procAttempt + 1); try { orderPaymentPreference.store(); orderPaymentPreference.refresh(); @@ -317,7 +317,7 @@ public class PaymentGatewayServices { Map result = new HashMap<>(); boolean reAuth = false; if (context.get("reAuth") != null) { - reAuth = ((Boolean)context.get("reAuth")).booleanValue(); + reAuth = (Boolean) context.get("reAuth"); } // get the order header and payment preferences GenericValue orderHeader = null; @@ -399,10 +399,10 @@ public class PaymentGatewayServices { messages.add("Could not authorize OrderPaymentPreference [" + paymentPref.getString("orderPaymentPreferenceId") + "] for order [" + orderId + "]: " + results.get(ModelService.ERROR_MESSAGE)); continue; } - if (((Boolean) results.get("finished")).booleanValue()) { + if ((Boolean) results.get("finished")) { finished += 1; } - if (((Boolean) results.get("errors")).booleanValue()) { + if ((Boolean) results.get("errors")) { hadError += 1; } if (results.get("messages") != null) { @@ -839,7 +839,7 @@ public class PaymentGatewayServices { // save the response and respective messages savePgrAndMsgs(dctx, pgCredit, messageEntities); - if (creditResponse != null && creditResponse.booleanValue()) { + if (creditResponse != null && creditResponse) { paymentPref.set("statusId", "PAYMENT_CANCELLED"); try { paymentPref.store(); @@ -1043,7 +1043,7 @@ public class PaymentGatewayServices { } } - if (releaseResponse != null && releaseResponse.booleanValue()) { + if (releaseResponse != null && releaseResponse) { paymentPref.set("statusId", "PAYMENT_CANCELLED"); try { paymentPref.store(); @@ -1874,13 +1874,13 @@ public class PaymentGatewayServices { if (authResult != null) { processAuthResult(dctx, result, userLogin, paymentPreference); - resultPassed = authResult.booleanValue(); + resultPassed = authResult; authServiceType = ("PAYMENT_NOT_AUTH".equals(initialStatus)) ? AUTH_SERVICE_TYPE : REAUTH_SERVICE_TYPE; } if (captureResult != null) { processCaptureResult(dctx, result, userLogin, paymentPreference, authServiceType, locale); if (!resultPassed) { - resultPassed = captureResult.booleanValue(); + resultPassed = captureResult; } } return resultPassed; @@ -2008,7 +2008,7 @@ public class PaymentGatewayServices { } // set the status of the OrderPaymentPreference - boolean authResultOk = authResult.booleanValue(); + boolean authResultOk = authResult; if (authResultOk) { orderPaymentPreference.set("statusId", "PAYMENT_AUTHORIZED"); @@ -2034,18 +2034,18 @@ public class PaymentGatewayServices { if (creditCard != null) { Long consecutiveFailedAuths = creditCard.getLong("consecutiveFailedAuths"); if (consecutiveFailedAuths == null) { - creditCard.set("consecutiveFailedAuths", Long.valueOf(1)); + creditCard.set("consecutiveFailedAuths", 1L); } else { - creditCard.set("consecutiveFailedAuths", Long.valueOf(consecutiveFailedAuths.longValue() + 1)); + creditCard.set("consecutiveFailedAuths", consecutiveFailedAuths + 1); } creditCard.set("lastFailedAuthDate", nowTimestamp); if (Boolean.TRUE.equals(context.get("resultNsf"))) { Long consecutiveFailedNsf = creditCard.getLong("consecutiveFailedNsf"); if (consecutiveFailedNsf == null) { - creditCard.set("consecutiveFailedNsf", Long.valueOf(1)); + creditCard.set("consecutiveFailedNsf", 1L); } else { - creditCard.set("consecutiveFailedNsf", Long.valueOf(consecutiveFailedNsf.longValue() + 1)); + creditCard.set("consecutiveFailedNsf", consecutiveFailedNsf + 1); } creditCard.set("lastFailedNsfDate", nowTimestamp); } @@ -2056,9 +2056,9 @@ public class PaymentGatewayServices { // auth was successful, to clear out any failed auth or nsf info if (authResultOk) { if ((creditCard != null) && (creditCard.get("lastFailedAuthDate") != null)) { - creditCard.set("consecutiveFailedAuths", Long.valueOf(0)); + creditCard.set("consecutiveFailedAuths", 0L); creditCard.set("lastFailedAuthDate", null); - creditCard.set("consecutiveFailedNsf", Long.valueOf(0)); + creditCard.set("consecutiveFailedNsf", 0L); creditCard.set("lastFailedNsfDate", null); creditCard.store(); } @@ -2089,7 +2089,7 @@ public class PaymentGatewayServices { "paymentMethodId", orderPaymentPreference.get("paymentMethodId"), "resultNsf", "Y") .queryCount(); - if (failedTries < autoOrderCcTryLaterMax.longValue()) { + if (failedTries < autoOrderCcTryLaterMax) { needsNsfRetry = true; } } else { @@ -2150,7 +2150,7 @@ public class PaymentGatewayServices { if (capRes != null && ServiceUtil.isError(capRes)) { throw new GeneralException(ServiceUtil.getErrorMessage(capRes)); } - if (!captureResult.booleanValue()) { + if (!captureResult) { // capture returned false (error) try { processReAuthFromCaptureFailure(dctx, result, amount, userLogin, paymentPreference, locale); @@ -2203,7 +2203,7 @@ public class PaymentGatewayServices { if (authResp != null && Boolean.TRUE.equals(authResp)) { GenericValue authTrans = processAuthRetryResult(dctx, authPayRes, userLogin, paymentPreference); // check if auto-capture was enabled; process if so - if (capResp != null && capResp.booleanValue()) { + if (capResp != null && capResp) { processCaptureResult(dctx, result, userLogin, paymentPreference, locale); } else { // no auto-capture; do manual capture now @@ -2214,7 +2214,7 @@ public class PaymentGatewayServices { // process the capture result Boolean capPayResp = (Boolean) capPayRes.get("captureResult"); - if (capPayResp != null && capPayResp.booleanValue()) { + if (capPayResp != null && capPayResp) { // process the capture result processCaptureResult(dctx, capPayRes, userLogin, paymentPreference, locale); } else { @@ -2237,7 +2237,7 @@ public class PaymentGatewayServices { BigDecimal amount = (BigDecimal) context.get("captureAmount"); String serviceType = (String) context.get("serviceTypeEnum"); String currencyUomId = (String) context.get("currencyUomId"); - boolean captureSuccessful = ((Boolean) context.get("captureResult")).booleanValue(); + boolean captureSuccessful = (Boolean) context.get("captureResult"); String paymentMethodTypeId = paymentPreference.getString("paymentMethodTypeId"); @@ -2616,7 +2616,7 @@ public class PaymentGatewayServices { } Boolean refundResult = (Boolean) context.get("refundResult"); - if (refundResult != null && refundResult.booleanValue()) { + if (refundResult != null && refundResult) { // mark the preference as refunded paymentPref.set("statusId", "PAYMENT_REFUNDED"); @@ -2743,7 +2743,7 @@ public class PaymentGatewayServices { EntityQuery eq = EntityQuery.use(delegator) .from("OrderPaymentPreference") .where(EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, "PAYMENT_NOT_AUTH"), - EntityCondition.makeCondition("processAttempt",EntityOperator.GREATER_THAN, Long.valueOf(0))) + EntityCondition.makeCondition("processAttempt",EntityOperator.GREATER_THAN, 0L)) .orderBy("orderId"); try (EntityListIterator eli = eq.queryIterator()) { diff --git a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/tax/TaxAuthorityServices.java b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/tax/TaxAuthorityServices.java index 12fb883e1f..d663e33ecf 100644 --- a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/tax/TaxAuthorityServices.java +++ b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/tax/TaxAuthorityServices.java @@ -408,17 +408,17 @@ public class TaxAuthorityServices { BigDecimal taxable = ZERO_BASE; if (product != null && (product.get("taxable") == null || (product.get("taxable") != null && product - .getBoolean("taxable").booleanValue()))) { + .getBoolean("taxable")))) { taxable = taxable.add(itemAmount); } if (shippingAmount != null && (taxAuthorityRateProduct.get("taxShipping") == null || (taxAuthorityRateProduct.get("taxShipping") != null && taxAuthorityRateProduct.getBoolean( - "taxShipping").booleanValue()))) { + "taxShipping")))) { taxable = taxable.add(shippingAmount); } if (orderPromotionsAmount != null && (taxAuthorityRateProduct.get("taxPromotions") == null || (taxAuthorityRateProduct.get("taxPromotions") != null && taxAuthorityRateProduct.getBoolean( - "taxPromotions").booleanValue()))) { + "taxPromotions")))) { taxable = taxable.add(orderPromotionsAmount); } diff --git a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java index 7bdd675fca..8fcd55f6db 100644 --- a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java +++ b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java @@ -187,7 +187,7 @@ public class AIMPaymentServices { } Map reply = processCard(request, props, locale); results.putAll(processRefundTransResult(request, reply)); - boolean refundResult = ((Boolean)results.get("refundResult")).booleanValue(); + boolean refundResult = (Boolean) results.get("refundResult"); String refundFlag = (String)results.get("refundFlag"); // Since the refund failed, we are going to void the previous authorization against // which ccRefunds attempted to issue the refund. This happens because Authorize.NET requires @@ -645,10 +645,10 @@ public class AIMPaymentServices { AuthorizeResponse ar = (AuthorizeResponse) reply.get("authorizeResponse"); try { Boolean authResult = (Boolean) reply.get("authResult"); - results.put("authResult", new Boolean(authResult.booleanValue())); + results.put("authResult", authResult); results.put("authFlag", ar.getReasonCode()); results.put("authMessage", ar.getReasonText()); - if (authResult.booleanValue()) { //passed + if (authResult) { //passed results.put("authCode", ar.getAuthorizationCode()); results.put("authRefNum", ar.getTransactionId()); results.put("cvCode", ar.getCvResult()); @@ -676,11 +676,11 @@ public class AIMPaymentServices { AuthorizeResponse ar = (AuthorizeResponse) reply.get("authorizeResponse"); try { Boolean captureResult = (Boolean) reply.get("authResult"); - results.put("captureResult", new Boolean(captureResult.booleanValue())); + results.put("captureResult", captureResult); results.put("captureFlag", ar.getReasonCode()); results.put("captureMessage", ar.getReasonText()); results.put("captureRefNum", ar.getTransactionId()); - if (captureResult.booleanValue()) { //passed + if (captureResult) { //passed results.put("captureCode", ar.getAuthorizationCode()); if (BigDecimal.ZERO.compareTo(ar.getAmount()) == 0) { results.put("captureAmount", getXAmount(request)); @@ -702,11 +702,11 @@ public class AIMPaymentServices { AuthorizeResponse ar = (AuthorizeResponse) reply.get("authorizeResponse"); try { Boolean captureResult = (Boolean) reply.get("authResult"); - results.put("refundResult", new Boolean(captureResult.booleanValue())); + results.put("refundResult", captureResult); results.put("refundFlag", ar.getReasonCode()); results.put("refundMessage", ar.getReasonText()); results.put("refundRefNum", ar.getTransactionId()); - if (captureResult.booleanValue()) { //passed + if (captureResult) { //passed results.put("refundCode", ar.getAuthorizationCode()); if (BigDecimal.ZERO.compareTo(ar.getAmount()) == 0) { results.put("refundAmount", getXAmount(request)); @@ -729,11 +729,11 @@ public class AIMPaymentServices { AuthorizeResponse ar = (AuthorizeResponse) reply.get("authorizeResponse"); try { Boolean captureResult = (Boolean) reply.get("authResult"); - results.put("releaseResult", new Boolean(captureResult.booleanValue())); + results.put("releaseResult", captureResult); results.put("releaseFlag", ar.getReasonCode()); results.put("releaseMessage", ar.getReasonText()); results.put("releaseRefNum", ar.getTransactionId()); - if (captureResult.booleanValue()) { //passed + if (captureResult) { //passed results.put("releaseCode", ar.getAuthorizationCode()); if (BigDecimal.ZERO.compareTo(ar.getAmount()) == 0) { results.put("releaseAmount", getXAmount(request)); @@ -755,14 +755,14 @@ public class AIMPaymentServices { AuthorizeResponse ar = (AuthorizeResponse) reply.get("authorizeResponse"); try { Boolean authResult = (Boolean) reply.get("authResult"); - results.put("authResult", new Boolean(authResult.booleanValue())); + results.put("authResult", authResult); results.put("authFlag", ar.getReasonCode()); results.put("authMessage", ar.getReasonText()); - results.put("captureResult", new Boolean(authResult.booleanValue())); + results.put("captureResult", authResult); results.put("captureFlag", ar.getReasonCode()); results.put("captureMessage", ar.getReasonText()); results.put("captureRefNum", ar.getTransactionId()); - if (authResult.booleanValue()) { //passed + if (authResult) { //passed results.put("authCode", ar.getAuthorizationCode()); results.put("authRefNum", ar.getTransactionId()); results.put("cvCode", ar.getCvResult()); diff --git a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/orbital/OrbitalPaymentServices.java b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/orbital/OrbitalPaymentServices.java index 6a3adc8ac2..1a7e040152 100644 --- a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/orbital/OrbitalPaymentServices.java +++ b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/orbital/OrbitalPaymentServices.java @@ -507,10 +507,10 @@ public class OrbitalPaymentServices { private static void processAuthTransResult(Map processCardResponseContext, Map results) { ResponseIF response = (ResponseIF) processCardResponseContext.get("processCardResponse"); Boolean authResult = (Boolean) processCardResponseContext.get("authResult"); - results.put("authResult", new Boolean(authResult.booleanValue())); + results.put("authResult", authResult); results.put("authFlag", response.getResponseCode()); results.put("authMessage", response.getMessage()); - if (authResult.booleanValue()) { //passed + if (authResult) { //passed results.put("authCode", response.getAuthCode()); results.put("authRefNum", response.getTxRefNum()); results.put("cvCode", UtilFormatOut.checkNull(response.getCVV2RespCode())); @@ -527,14 +527,14 @@ public class OrbitalPaymentServices { private static void processAuthCaptureTransResult(Map processCardResponseContext, Map results) { ResponseIF response = (ResponseIF) processCardResponseContext.get("processCardResponse"); Boolean authResult = (Boolean) processCardResponseContext.get("authResult"); - results.put("authResult", new Boolean(authResult.booleanValue())); + results.put("authResult", authResult); results.put("authFlag", response.getResponseCode()); results.put("authMessage", response.getMessage()); - results.put("captureResult", new Boolean(authResult.booleanValue())); + results.put("captureResult", authResult); results.put("captureFlag", response.getResponseCode()); results.put("captureMessage", response.getMessage()); results.put("captureRefNum", response.getTxRefNum()); - if (authResult.booleanValue()) { //passed + if (authResult) { //passed results.put("authCode", response.getAuthCode()); results.put("authRefNum", response.getTxRefNum()); results.put("cvCode", UtilFormatOut.checkNull(response.getCVV2RespCode())); @@ -551,11 +551,11 @@ public class OrbitalPaymentServices { private static void processCaptureTransResult(Map processCardResponseContext, Map results) { ResponseIF response = (ResponseIF) processCardResponseContext.get("processCardResponse"); Boolean captureResult = (Boolean) processCardResponseContext.get("authResult"); - results.put("captureResult", new Boolean(captureResult.booleanValue())); + results.put("captureResult", captureResult); results.put("captureFlag", response.getResponseCode()); results.put("captureMessage", response.getMessage()); results.put("captureRefNum", response.getTxRefNum()); - if (captureResult.booleanValue()) { //passed + if (captureResult) { //passed results.put("captureCode", response.getAuthCode()); results.put("captureAmount", new BigDecimal(results.get("captureAmount").toString())); } else { @@ -567,11 +567,11 @@ public class OrbitalPaymentServices { private static void processRefundTransResult(Map processCardResponseContext, Map results) { ResponseIF response = (ResponseIF) processCardResponseContext.get("processCardResponse"); Boolean refundResult = (Boolean) processCardResponseContext.get("authResult"); - results.put("refundResult", new Boolean(refundResult.booleanValue())); + results.put("refundResult", refundResult); results.put("refundFlag", response.getResponseCode()); results.put("refundMessage", response.getMessage()); results.put("refundRefNum", response.getTxRefNum()); - if (refundResult.booleanValue()) { //passed + if (refundResult) { //passed results.put("refundCode", response.getAuthCode()); results.put("refundAmount", new BigDecimal(results.get("refundAmount").toString())); } else { @@ -583,11 +583,11 @@ public class OrbitalPaymentServices { private static void processReleaseTransResult(Map processCardResponseContext, Map results) { ResponseIF response = (ResponseIF) processCardResponseContext.get("processCardResponse"); Boolean releaseResult = (Boolean) processCardResponseContext.get("authResult"); - results.put("releaseResult", new Boolean(releaseResult.booleanValue())); + results.put("releaseResult", releaseResult); results.put("releaseFlag", response.getResponseCode()); results.put("releaseMessage", response.getMessage()); results.put("releaseRefNum", response.getTxRefNum()); - if (releaseResult.booleanValue()) { //passed + if (releaseResult) { //passed results.put("releaseCode", response.getAuthCode()); results.put("releaseAmount", new BigDecimal(results.get("releaseAmount").toString())); } else { diff --git a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/securepay/SecurePayPaymentServices.java b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/securepay/SecurePayPaymentServices.java index 5e7bd209d9..eeb1880269 100644 --- a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/securepay/SecurePayPaymentServices.java +++ b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/securepay/SecurePayPaymentServices.java @@ -113,12 +113,12 @@ public class SecurePayPaymentServices { Txn resp = payment.getTxn(0); boolean approved = resp.getApproved(); if (approved == false){ - result.put("authResult", new Boolean(false)); + result.put("authResult", Boolean.FALSE); result.put("authRefNum", "N/A"); result.put("processAmount", BigDecimal.ZERO); } else { result.put("authRefNum", resp.getTxnId()); - result.put("authResult", new Boolean(true)); + result.put("authResult", Boolean.TRUE); result.put("processAmount", processAmount); } result.put("authCode", resp.getResponseCode()); diff --git a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/securepay/SecurePayServiceTest.java b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/securepay/SecurePayServiceTest.java index 4fa91cc9d8..c0c7250bc9 100644 --- a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/securepay/SecurePayServiceTest.java +++ b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/securepay/SecurePayServiceTest.java @@ -135,7 +135,7 @@ public class SecurePayServiceTest extends OFBizTestCase{ Debug.logInfo("[testCCAuth] responseMessage: " + responseMessage, module); TestCase.assertEquals("Service result is success", ModelService.RESPOND_SUCCESS, responseMessage); - if (((Boolean) result.get("authResult")).equals(new Boolean(false))) { // returnCode ok? + if (((Boolean) result.get("authResult")).equals(Boolean.FALSE)) { // returnCode ok? Debug.logInfo("[testAuth] Error Messages from SecurePay: " + result.get("internalRespMsgs"), module); TestCase.fail("Returned messages:" + result.get("internalRespMsgs")); } else { @@ -180,7 +180,7 @@ public class SecurePayServiceTest extends OFBizTestCase{ Debug.logInfo("[testdoCapture] responseMessage: " + responseMessage, module); TestCase.assertEquals("Service result is success", ModelService.RESPOND_SUCCESS, responseMessage); - if (((Boolean) result.get("captureResult")).equals(new Boolean(false))) { // returnCode ok? + if (((Boolean) result.get("captureResult")).equals(Boolean.FALSE)) { // returnCode ok? Debug.logInfo("[testdoCapture] Error Messages from SecurePay: " + result.get("internalRespMsgs"), module); TestCase.fail("Returned messages:" + result.get("internalRespMsgs")); } else { @@ -212,7 +212,7 @@ public class SecurePayServiceTest extends OFBizTestCase{ Debug.logInfo("[testdoRefund] responseMessage: " + responseMessage, module); TestCase.assertEquals("Service result is success", ModelService.RESPOND_SUCCESS, responseMessage); - if (((Boolean) result.get("refundResult")).equals(new Boolean(false))) { // returnCode ok? + if (((Boolean) result.get("refundResult")).equals(Boolean.FALSE)) { // returnCode ok? Debug.logInfo("[testdoRefund] Error Messages from SecurePay: " + result.get("internalRespMsgs"), module); TestCase.fail("Returned messages:" + result.get("internalRespMsgs")); } else { @@ -245,7 +245,7 @@ public class SecurePayServiceTest extends OFBizTestCase{ Debug.logInfo("[testdoCredit] responseMessage: " + responseMessage, module); TestCase.assertEquals("Service result is success", ModelService.RESPOND_SUCCESS, responseMessage); - if (((Boolean) result.get("creditResult")).equals(new Boolean(false))) { // returnCode ok? + if (((Boolean) result.get("creditResult")).equals(Boolean.FALSE)) { // returnCode ok? Debug.logInfo("[testdoCredit] Error Messages from SecurePay: " + result.get("internalRespMsgs"), module); TestCase.fail("Returned messages:" + result.get("internalRespMsgs")); } else { diff --git a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/valuelink/ValueLinkServices.java b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/valuelink/ValueLinkServices.java index 9c706ebf97..bb99072bb8 100644 --- a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/valuelink/ValueLinkServices.java +++ b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/valuelink/ValueLinkServices.java @@ -64,9 +64,9 @@ public class ValueLinkServices { Boolean kekOnly = context.get("kekOnly") != null ? (Boolean) context.get("kekOnly") : Boolean.FALSE; String kekTest = (String) context.get("kekTest"); - Debug.logInfo("KEK Only : " + kekOnly.booleanValue(), module); + Debug.logInfo("KEK Only : " + kekOnly, module); - StringBuffer buf = vl.outputKeyCreation(kekOnly.booleanValue(), kekTest); + StringBuffer buf = vl.outputKeyCreation(kekOnly, kekTest); String output = buf.toString(); Debug.logInfo(":: Key Generation Output ::\n\n" + output, module); @@ -93,7 +93,7 @@ public class ValueLinkServices { byte[] testEncryption = null; String desc = ""; - if (mode.intValue() == 1) { + if (mode == 1) { // encrypt the test bytes testEncryption = vl.encryptViaKek(testBytes); desc = "Encrypted"; @@ -154,7 +154,7 @@ public class ValueLinkServices { Map request = vl.getInitialRequestMap(context); request.put("Interface", "Encrypt"); request.put("EncryptKey", mwkHex); - request.put("EncryptID", Long.valueOf(vl.getWorkingKeyIndex().longValue() + 1)); + request.put("EncryptID", vl.getWorkingKeyIndex() + 1); // send the request Map response = null; @@ -786,7 +786,7 @@ public class ValueLinkServices { if (redeemResult != null) { Boolean processResult = (Boolean) redeemResult.get("processResult"); // confirm the amount redeemed; since VL does not error in insufficient funds - if (processResult.booleanValue()) { + if (processResult) { BigDecimal previous = (BigDecimal) redeemResult.get("previousAmount"); if (previous == null) previous = BigDecimal.ZERO; BigDecimal current = (BigDecimal) redeemResult.get("amount"); @@ -1137,7 +1137,7 @@ public class ValueLinkServices { } Boolean processResult = (Boolean) activateResult.get("processResult"); - if (activateResult.containsKey(ModelService.ERROR_MESSAGE) || !processResult.booleanValue()) { + if (activateResult.containsKey(ModelService.ERROR_MESSAGE) || !processResult) { failure = true; } @@ -1398,7 +1398,7 @@ public class ValueLinkServices { } Boolean processResult = (Boolean) reloadResult.get("processResult"); - if (reloadResult.containsKey(ModelService.ERROR_MESSAGE) || !processResult.booleanValue()) { + if (reloadResult.containsKey(ModelService.ERROR_MESSAGE) || !processResult) { Debug.logError("Reload Failed Need to Refund : " + reloadResult, module); // process the return diff --git a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/verisign/PayflowPro.java b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/verisign/PayflowPro.java index 82de57648b..fb799d9a43 100644 --- a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/verisign/PayflowPro.java +++ b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/verisign/PayflowPro.java @@ -908,8 +908,8 @@ public class PayflowPro { Integer maxLogFileSize = Integer.decode(getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, "maxLogFileSize", resource, "payment.verisign.maxLogFileSize", "1000000")); boolean stackTraceOn = "Y".equalsIgnoreCase(getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, "stackTraceOn", resource, "payment.verisign.stackTraceOn", "N")); - PayflowAPI pfp = new PayflowAPI(hostAddress, hostPort.intValue(), timeout.intValue(), proxyAddress, - proxyPort.intValue(), proxyLogon, proxyPassword); + PayflowAPI pfp = new PayflowAPI(hostAddress, hostPort, timeout, proxyAddress, + proxyPort, proxyLogon, proxyPassword); SDKProperties.setLogFileName(logFileName); SDKProperties.setLoggingLevel(loggingLevel); SDKProperties.setMaxLogFileSize(maxLogFileSize); diff --git a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/worldpay/WorldPayEvents.java b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/worldpay/WorldPayEvents.java index c17ed31953..71e06a9c9b 100644 --- a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/worldpay/WorldPayEvents.java +++ b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/worldpay/WorldPayEvents.java @@ -432,7 +432,7 @@ public class WorldPayEvents { List toStore = new LinkedList<>(); java.sql.Timestamp authDate = null; try { - authDate = new java.sql.Timestamp(paymentDate.longValue()); + authDate = new java.sql.Timestamp(paymentDate); } catch (Exception e) { Debug.logError(e, "Cannot create date from long: " + paymentDate, module); authDate = UtilDateTime.nowTimestamp(); diff --git a/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementServices.java b/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementServices.java index f5a84ad474..4c87f05949 100644 --- a/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementServices.java +++ b/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementServices.java @@ -827,9 +827,9 @@ public class ContentManagementServices { String contentIdTo = (String)context.get("contentIdTo"); Integer seqInc = (Integer)context.get("seqInc"); if (seqInc == null) { - seqInc = Integer.valueOf(100); + seqInc = 100; } - int seqIncrement = seqInc.intValue(); + int seqIncrement = seqInc; List typeList = UtilGenerics.checkList(context.get("typeList")); if (typeList == null) { typeList = new LinkedList(); @@ -864,7 +864,7 @@ public class ContentManagementServices { try { GenericValue prevValue = listAll.get(i-1); Long prevSeqNum = (Long)prevValue.get("sequenceNum"); - prevValue.put("sequenceNum", Long.valueOf(seqNum)); + prevValue.put("sequenceNum", (long) seqNum); prevValue.store(); contentAssoc.put("sequenceNum", prevSeqNum); contentAssoc.store(); @@ -876,20 +876,20 @@ public class ContentManagementServices { if (i < listAll.size()) { // Swap with next entry GenericValue nextValue = listAll.get(i+1); - nextValue.put("sequenceNum", Long.valueOf(seqNum)); + nextValue.put("sequenceNum", (long) seqNum); nextValue.store(); seqNum += seqIncrement; - contentAssoc.put("sequenceNum", Long.valueOf(seqNum)); + contentAssoc.put("sequenceNum", (long) seqNum); contentAssoc.store(); i++; // skip next one } } } else { - contentAssoc.put("sequenceNum", Long.valueOf(seqNum)); + contentAssoc.put("sequenceNum", (long) seqNum); contentAssoc.store(); } } else { - contentAssoc.put("sequenceNum", Long.valueOf(seqNum)); + contentAssoc.put("sequenceNum", (long) seqNum); contentAssoc.store(); } seqNum += seqIncrement; @@ -938,7 +938,7 @@ public class ContentManagementServices { serviceIn.put("userLogin", userLogin); serviceIn.put("contentIdTo", contentId); serviceIn.put("contentAssocTypeId", "SUB_CONTENT"); - serviceIn.put("sequenceNum", Long.valueOf(50)); + serviceIn.put("sequenceNum", 50L); try { thisResult = dispatcher.runSync("persistContentAndAssoc", serviceIn); if (ServiceUtil.isError(thisResult)) { @@ -969,7 +969,7 @@ public class ContentManagementServices { String startContentId = (String)context.get("contentId"); try { int leafCount = ContentManagementWorker.updateStatsTopDown(delegator, startContentId, typeList); - result.put("leafCount", Integer.valueOf(leafCount)); + result.put("leafCount", leafCount); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(e.toString()); @@ -1210,11 +1210,11 @@ public class ContentManagementServices { } Long leafCount = (Long)content.get("childLeafCount"); if (leafCount == null) { - content.set("childLeafCount", Long.valueOf(0)); + content.set("childLeafCount", 0L); } Long branchCount = (Long)content.get("childBranchCount"); if (branchCount == null) { - content.set("childBranchCount", Long.valueOf(0)); + content.set("childBranchCount", 0L); } return result; @@ -1234,7 +1234,7 @@ public class ContentManagementServices { } Long leafCount = (Long)content.get("childLeafCount"); if (leafCount == null) { - leafCount = Long.valueOf(0); + leafCount = 0L; } int changeLeafCount = leafCount.intValue() + 1; int changeBranchCount = 1; @@ -1260,7 +1260,7 @@ public class ContentManagementServices { } Long leafCount = (Long)content.get("childLeafCount"); if (leafCount == null) { - leafCount = Long.valueOf(0); + leafCount = 0L; } int changeLeafCount = -1 * leafCount.intValue() - 1; int changeBranchCount = -1; @@ -1353,7 +1353,7 @@ public class ContentManagementServices { } else { Debug.logWarning("Don't know anything about useTimeUomId [" + useTimeUomId + "], defaulting to month", module); } - calendar.add(field, useTime.intValue()); + calendar.add(field, useTime); thruDate = new Timestamp(calendar.getTimeInMillis()); contentRole.set("thruDate", thruDate); try { @@ -1385,7 +1385,7 @@ public class ContentManagementServices { String productId = (String) context.get("productId"); Integer qty = (Integer) context.get("quantity"); if (qty == null) { - qty = Integer.valueOf(1); + qty = 1; } GenericValue productContent = null; @@ -1413,7 +1413,7 @@ public class ContentManagementServices { Long useTime = (Long) productContent.get("useTime"); Integer newUseTime = null; if (UtilValidate.isNotEmpty(useTime)) { - newUseTime = Integer.valueOf(useTime.intValue() * qty.intValue()); + newUseTime = useTime.intValue() * qty; } context.put("useTime", newUseTime); context.put("useTimeUomId", productContent.get("useTimeUomId")); @@ -1468,7 +1468,7 @@ public class ContentManagementServices { .filterByDate().queryCount(); if (productContentCount > 0) { context.put("productId", productId); - context.put("quantity", Integer.valueOf(qty.intValue())); + context.put("quantity", qty.intValue()); Map ctx = subscriptionModel.makeValid(context, ModelService.IN_PARAM); result = dispatcher.runSync("updateContentSubscriptionByProduct", ctx); if (ServiceUtil.isError(result)) { diff --git a/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementWorker.java b/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementWorker.java index c2ea20aeb8..409620f20b 100644 --- a/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementWorker.java +++ b/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementWorker.java @@ -638,8 +638,8 @@ public final class ContentManagementWorker { // If no children, count this as a leaf if (subLeafCount == 0) subLeafCount = 1; - thisContent.put("childBranchCount", Long.valueOf(contentAssocs.size())); - thisContent.put("childLeafCount", Long.valueOf(subLeafCount)); + thisContent.put("childBranchCount", (long) contentAssocs.size()); + thisContent.put("childLeafCount", (long) subLeafCount); thisContent.store(); return subLeafCount; @@ -662,7 +662,7 @@ public final class ContentManagementWorker { if (leafCount != null) { intLeafCount = leafCount.intValue(); } - contentTo.set("childLeafCount", Long.valueOf(intLeafCount + leafChangeAmount)); + contentTo.set("childLeafCount", (long) (intLeafCount + leafChangeAmount)); if (branchChangeAmount != 0) { int intBranchCount = 0; @@ -670,7 +670,7 @@ public final class ContentManagementWorker { if (branchCount != null) { intBranchCount = branchCount.intValue(); } - contentTo.set("childBranchCount", Long.valueOf(intBranchCount + branchChangeAmount)); + contentTo.set("childBranchCount", (long) (intBranchCount + branchChangeAmount)); } contentTo.store(); updateStatsBottomUp(delegator, contentIdTo, typeList, 0, leafChangeAmount); diff --git a/applications/content/src/main/java/org/apache/ofbiz/content/compdoc/CompDocEvents.java b/applications/content/src/main/java/org/apache/ofbiz/content/compdoc/CompDocEvents.java index a6a8f60df6..c224a429b0 100644 --- a/applications/content/src/main/java/org/apache/ofbiz/content/compdoc/CompDocEvents.java +++ b/applications/content/src/main/java/org/apache/ofbiz/content/compdoc/CompDocEvents.java @@ -140,7 +140,7 @@ public class CompDocEvents { } public static String padNumberWithLeadingZeros(Long num, Integer padLen) { - String s = UtilFormatOut.formatPaddedNumber(num.longValue(), padLen.intValue()); + String s = UtilFormatOut.formatPaddedNumber(num, padLen); return s; } diff --git a/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentKeywordIndex.java b/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentKeywordIndex.java index 44be40e28e..959b447a36 100644 --- a/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentKeywordIndex.java +++ b/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentKeywordIndex.java @@ -70,7 +70,7 @@ public class ContentKeywordIndex { List strings = new LinkedList(); int pidWeight = 1; - keywords.put(content.getString("contentId").toLowerCase(Locale.getDefault()), Long.valueOf(pidWeight)); + keywords.put(content.getString("contentId").toLowerCase(Locale.getDefault()), (long) pidWeight); addWeightedKeywordSourceString(content, "dataResourceId", strings); addWeightedKeywordSourceString(content, "contentName", strings); @@ -187,7 +187,7 @@ public class ContentKeywordIndex { } List toBeStored = new LinkedList(); - int keywordMaxLength = EntityUtilProperties.getPropertyAsInteger("contentsearch", "content.keyword.max.length", 0).intValue(); + int keywordMaxLength = EntityUtilProperties.getPropertyAsInteger("contentsearch", "content.keyword.max.length", 0); for (Map.Entry entry: keywords.entrySet()) { if (entry.getKey().length() <= keywordMaxLength) { GenericValue contentKeyword = delegator.makeValue("ContentKeyword", UtilMisc.toMap("contentId", content.getString("contentId"), "keyword", entry.getKey(), "relevancyWeight", entry.getValue())); diff --git a/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentPermissionServices.java b/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentPermissionServices.java index 90c673be23..febc80fe3a 100644 --- a/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentPermissionServices.java +++ b/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentPermissionServices.java @@ -104,13 +104,13 @@ public class ContentPermissionServices { GenericValue content = (GenericValue) context.get("currentContent"); Boolean bDisplayFailCond = (Boolean)context.get("displayFailCond"); boolean displayFailCond = false; - if (bDisplayFailCond != null && bDisplayFailCond.booleanValue()) { + if (bDisplayFailCond != null && bDisplayFailCond) { displayFailCond = true; } Debug.logInfo("displayFailCond(0):" + displayFailCond, ""); Boolean bDisplayPassCond = (Boolean)context.get("displayPassCond"); boolean displayPassCond = false; - if (bDisplayPassCond != null && bDisplayPassCond.booleanValue()) { + if (bDisplayPassCond != null && bDisplayPassCond) { displayPassCond = true; } Debug.logInfo("displayPassCond(0):" + displayPassCond, ""); @@ -299,7 +299,7 @@ public class ContentPermissionServices { } permissionStatus = (String)permResults.get("permissionStatus"); if (permissionStatus == null || !"granted".equals(permissionStatus)) { - if (bDisplayFailCond != null && bDisplayFailCond.booleanValue()) { + if (bDisplayFailCond != null && bDisplayFailCond) { String errMsg = (String)permResults.get(ModelService.ERROR_MESSAGE); results.put(ModelService.ERROR_MESSAGE, errMsg); } @@ -320,7 +320,7 @@ public class ContentPermissionServices { if (permissionStatus != null && "granted".equals(permissionStatus)) { results.put("permissionStatus", "granted"); } else { - if (bDisplayFailCond != null && bDisplayFailCond.booleanValue()) { + if (bDisplayFailCond != null && bDisplayFailCond) { String errMsg = (String)permResults.get(ModelService.ERROR_MESSAGE); results.put(ModelService.ERROR_MESSAGE, errMsg); } diff --git a/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentSearch.java b/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentSearch.java index 96902fd395..f51e893246 100644 --- a/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentSearch.java +++ b/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentSearch.java @@ -179,7 +179,7 @@ public class ContentSearch { double totalSeconds = ((double)endMillis - (double)startMillis)/1000.0; // store info about results in the database, attached to the user's visitId, if specified - this.saveSearchResultInfo(Long.valueOf(contentIds.size()), Double.valueOf(totalSeconds)); + this.saveSearchResultInfo((long) contentIds.size(), totalSeconds); return contentIds; } @@ -284,7 +284,7 @@ public class ContentSearch { if (resultSortOrder != null) { resultSortOrder.setSortOrder(this); } - dynamicViewEntity.addAlias("CNT", "contentId", null, null, null, Boolean.valueOf(contentIdGroupBy), null); + dynamicViewEntity.addAlias("CNT", "contentId", null, null, null, contentIdGroupBy, null); EntityCondition whereCondition = EntityCondition.makeCondition(entityConditionList, EntityOperator.AND); EntityListIterator eli = null; @@ -305,7 +305,7 @@ public class ContentSearch { } public ArrayList makeContentIdList(EntityListIterator eli) { - ArrayList contentIds = new ArrayList(maxResults == null ? 100 : maxResults.intValue()); + ArrayList contentIds = new ArrayList(maxResults == null ? 100 : maxResults); if (eli == null) { Debug.logWarning("The eli is null, returning zero results", module); return contentIds; @@ -318,9 +318,9 @@ public class ContentSearch { if (initialResult != null) { hasResults = true; } - if (resultOffset != null && resultOffset.intValue() > 1) { + if (resultOffset != null && resultOffset > 1) { if (Debug.infoOn()) Debug.logInfo("Before relative, current index=" + eli.currentIndex(), module); - hasResults = eli.relative(resultOffset.intValue() - 1); + hasResults = eli.relative(resultOffset - 1); initialResult = null; } @@ -338,9 +338,9 @@ public class ContentSearch { // nothing to get... int failTotal = 0; if (this.resultOffset != null) { - failTotal = this.resultOffset.intValue() - 1; + failTotal = this.resultOffset - 1; } - this.totalResults = Integer.valueOf(failTotal); + this.totalResults = failTotal; return contentIds; } @@ -354,7 +354,7 @@ public class ContentSearch { contentIds.add(searchResult.getString("contentId")); contentIdSet.add(searchResult.getString("contentId")); - while (((searchResult = eli.next()) != null) && (maxResults == null || numRetreived < maxResults.intValue())) { + while (((searchResult = eli.next()) != null) && (maxResults == null || numRetreived < maxResults)) { String contentId = searchResult.getString("contentId"); if (!contentIdSet.contains(contentId)) { contentIds.add(contentId); @@ -368,12 +368,12 @@ public class ContentSearch { if (searchResult != null) { this.totalResults = eli.getResultsSizeAfterPartialList(); } - if (this.totalResults == null || this.totalResults.intValue() == 0) { + if (this.totalResults == null || this.totalResults == 0) { int total = numRetreived; if (this.resultOffset != null) { - total += (this.resultOffset.intValue() - 1); + total += (this.resultOffset - 1); } - this.totalResults = Integer.valueOf(total); + this.totalResults = total; } Debug.logInfo("Got search values, numRetreived=" + numRetreived + ", totalResults=" + totalResults + ", maxResults=" + maxResults + ", resultOffset=" + resultOffset + ", duplicatesFound(in the current results)=" + duplicatesFound, module); @@ -618,7 +618,7 @@ public class ContentSearch { this.anySuffix = anySuffix; this.isAnd = isAnd; if (removeStems != null) { - this.removeStems = removeStems.booleanValue(); + this.removeStems = removeStems; } else { this.removeStems = UtilProperties.propertyValueEquals("keywordsearch", "remove.stems", "true"); } diff --git a/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentSearchEvents.java b/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentSearchEvents.java index a88a54fb10..f849986ac7 100644 --- a/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentSearchEvents.java +++ b/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentSearchEvents.java @@ -52,16 +52,16 @@ public class ContentSearchEvents { ContentSearchOptions contentSearchOptions = ContentSearchSession.getContentSearchOptions(session); Integer viewIndexInteger = contentSearchOptions.getViewIndex(); - if (viewIndexInteger != null) viewIndex = viewIndexInteger.intValue(); + if (viewIndexInteger != null) viewIndex = viewIndexInteger; Integer viewSizeInteger = contentSearchOptions.getViewSize(); - if (viewSizeInteger != null) viewSize = viewSizeInteger.intValue(); + if (viewSizeInteger != null) viewSize = viewSizeInteger; lowIndex = viewIndex * viewSize; highIndex = (viewIndex + 1) * viewSize; // setup resultOffset and maxResults, noting that resultOffset is 1 based, not zero based as these numbers - Integer resultOffset = Integer.valueOf(lowIndex + 1); - Integer maxResults = Integer.valueOf(viewSize); + Integer resultOffset = lowIndex + 1; + Integer maxResults = viewSize; // ========== Do the actual search ArrayList contentIds = null; @@ -85,7 +85,7 @@ public class ContentSearchEvents { Integer totalResults = contentSearchContext.getTotalResults(); if (totalResults != null) { - listSize = totalResults.intValue(); + listSize = totalResults; } } @@ -101,11 +101,11 @@ public class ContentSearchEvents { Map result = new HashMap(); result.put("contentIds", contentIds); - result.put("viewIndex", Integer.valueOf(viewIndex)); - result.put("viewSize", Integer.valueOf(viewSize)); - result.put("listSize", Integer.valueOf(listSize)); - result.put("lowIndex", Integer.valueOf(lowIndex)); - result.put("highIndex", Integer.valueOf(highIndex)); + result.put("viewIndex", viewIndex); + result.put("viewSize", viewSize); + result.put("listSize", listSize); + result.put("lowIndex", lowIndex); + result.put("highIndex", highIndex); result.put("searchConstraintStrings", searchConstraintStrings); result.put("searchSortOrderString", searchSortOrderString); diff --git a/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentSearchSession.java b/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentSearchSession.java index 24fa60f08d..6166240fba 100644 --- a/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentSearchSession.java +++ b/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentSearchSession.java @@ -243,7 +243,7 @@ public class ContentSearchSession { } catch (Exception e) { Debug.logError(e, "Error formatting VIEW_INDEX, setting to 0", module); // we could just do nothing here, but we know something was specified so we don't want to use the previous value from the session - contentSearchOptions.setViewIndex(Integer.valueOf(0)); + contentSearchOptions.setViewIndex(0); } } @@ -253,7 +253,7 @@ public class ContentSearchSession { contentSearchOptions.setViewSize(Integer.valueOf(viewSizeStr)); } catch (Exception e) { Debug.logError(e, "Error formatting VIEW_SIZE, setting to 20", module); - contentSearchOptions.setViewSize(Integer.valueOf(20)); + contentSearchOptions.setViewSize(20); } } } diff --git a/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentWorker.java b/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentWorker.java index 21ed9bcd68..e69f79a9b3 100644 --- a/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentWorker.java +++ b/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentWorker.java @@ -572,7 +572,7 @@ public class ContentWorker implements org.apache.ofbiz.widget.content.ContentWor Map currentNode = nodeTrail.get(sz - 1); Boolean isReturnAfter = (Boolean)currentNode.get("isReturnAfter"); - if (isReturnAfter != null && isReturnAfter.booleanValue()) { + if (isReturnAfter != null && isReturnAfter) { return false; } @@ -584,7 +584,7 @@ public class ContentWorker implements org.apache.ofbiz.widget.content.ContentWor ContentWorker.traceNodeTrail("12",nodeTrail); Boolean isPick = (Boolean)currentNode.get("isPick"); - if (isPick != null && isPick.booleanValue()) { + if (isPick != null && isPick) { nodeTrail.add(currentNode); inProgress = true; selectKids(currentNode, ctx); @@ -592,7 +592,7 @@ public class ContentWorker implements org.apache.ofbiz.widget.content.ContentWor break; } else { Boolean isFollow = (Boolean)currentNode.get("isFollow"); - if (isFollow != null && isFollow.booleanValue()) { + if (isFollow != null && isFollow) { nodeTrail.add(currentNode); boolean foundPick = traverseSubContent(ctx); if (foundPick) { @@ -620,14 +620,14 @@ public class ContentWorker implements org.apache.ofbiz.widget.content.ContentWor while (idx < (kids.size() - 1)) { currentNode = kids.get(idx + 1); Boolean isFollow = (Boolean)currentNode.get("isFollow"); - if (isFollow == null || !isFollow.booleanValue()) { + if (isFollow == null || !isFollow) { idx++; continue; } nodeTrail.add(currentNode); ContentWorker.traceNodeTrail("16",nodeTrail); Boolean isPick = (Boolean)currentNode.get("isPick"); - if (isPick == null || !isPick.booleanValue()) { + if (isPick == null || !isPick) { // If not a "pick" node, look at kids inProgress = traverseSubContent(ctx); ContentWorker.traceNodeTrail("17",nodeTrail); @@ -731,9 +731,9 @@ public class ContentWorker implements org.apache.ofbiz.widget.content.ContentWor if (isPick) { Integer count = (Integer) currentNode.get("count"); if (count == null) { - count = Integer.valueOf(1); + count = 1; } else { - count = Integer.valueOf(count.intValue() + 1); + count = count + 1; } currentNode.put("count", count); } @@ -757,7 +757,7 @@ public class ContentWorker implements org.apache.ofbiz.widget.content.ContentWor // retVal should be a Boolean, if not something weird is up... if (retVal instanceof Boolean) { Boolean boolVal = (Boolean) retVal; - isWhen = boolVal.booleanValue(); + isWhen = boolVal; } else { throw new IllegalArgumentException("Return value from use-when condition eval was not a Boolean: " + (retVal != null ? retVal.getClass().getName() : "null") + " [" + retVal + "]"); @@ -1185,7 +1185,7 @@ public class ContentWorker implements org.apache.ofbiz.widget.content.ContentWor } } ctx.put("globalNodeTrail", passedGlobalNodeTrail); - ctx.put("indent", Integer.valueOf(sz)); + ctx.put("indent", sz); return currentContent; } @@ -1271,19 +1271,19 @@ public class ContentWorker implements org.apache.ofbiz.widget.content.ContentWor } } boolean isReturnBefore = checkWhen(context, (String)whenMap.get("returnBeforePickWhen"), false); - trailNode.put("isReturnBefore", Boolean.valueOf(isReturnBefore)); + trailNode.put("isReturnBefore", isReturnBefore); boolean isPick = checkWhen(context, (String)whenMap.get("pickWhen"), true); - trailNode.put("isPick", Boolean.valueOf(isPick)); + trailNode.put("isPick", isPick); boolean isFollow = checkWhen(context, (String)whenMap.get("followWhen"), true); - trailNode.put("isFollow", Boolean.valueOf(isFollow)); + trailNode.put("isFollow", isFollow); boolean isReturnAfter = checkWhen(context, (String)whenMap.get("returnAfterPickWhen"), false); - trailNode.put("isReturnAfter", Boolean.valueOf(isReturnAfter)); + trailNode.put("isReturnAfter", isReturnAfter); trailNode.put("checked", Boolean.TRUE); } public static boolean booleanDataType(Object boolObj) { boolean bool = false; - if (boolObj != null && ((Boolean)boolObj).booleanValue()) { + if (boolObj != null && (Boolean) boolObj) { bool = true; } return bool; diff --git a/applications/content/src/main/java/org/apache/ofbiz/content/content/PermissionRecorder.java b/applications/content/src/main/java/org/apache/ofbiz/content/content/PermissionRecorder.java index 041bdd2940..6004c6a663 100644 --- a/applications/content/src/main/java/org/apache/ofbiz/content/content/PermissionRecorder.java +++ b/applications/content/src/main/java/org/apache/ofbiz/content/content/PermissionRecorder.java @@ -184,11 +184,11 @@ public class PermissionRecorder { public void record(GenericValue purposeOp, boolean targetOpCond, boolean purposeCond, boolean statusCond, boolean privilegeCond, boolean roleCond) { Map map = UtilMisc.makeMapWritable(purposeOp); - map.put("contentOperationIdCond", Boolean.valueOf(targetOpCond)); - map.put("contentPurposeTypeIdCond", Boolean.valueOf(purposeCond)); - map.put("statusIdCond", Boolean.valueOf(statusCond)); - map.put("privilegeEnumIdCond", Boolean.valueOf(privilegeCond)); - map.put("roleTypeIdCond", Boolean.valueOf(roleCond)); + map.put("contentOperationIdCond", targetOpCond); + map.put("contentPurposeTypeIdCond", purposeCond); + map.put("statusIdCond", statusCond); + map.put("privilegeEnumIdCond", privilegeCond); + map.put("roleTypeIdCond", roleCond); map.put("contentId", currentContentId); List> checkResultList = UtilGenerics.checkList(currentContentMap.get("checkResultList")); checkResultList.add(map); @@ -276,8 +276,8 @@ public class PermissionRecorder { for (int i=0; i < opFields.length; i++) { String opField = opFields[i]; Boolean bool = (Boolean)rMap.get(opField + "Cond"); - String cls = (bool.booleanValue()) ? "pass" : "fail"; - if (!bool.booleanValue()) + String cls = (bool) ? "pass" : "fail"; + if (!bool) isPass = false; sb.append(""); s = (String)rMap.get(opField); diff --git a/applications/content/src/main/java/org/apache/ofbiz/content/data/DataEvents.java b/applications/content/src/main/java/org/apache/ofbiz/content/data/DataEvents.java index 6f6d41997a..4237ebc79c 100644 --- a/applications/content/src/main/java/org/apache/ofbiz/content/data/DataEvents.java +++ b/applications/content/src/main/java/org/apache/ofbiz/content/data/DataEvents.java @@ -154,7 +154,7 @@ public class DataEvents { // no service errors; now check the actual response Boolean hasPermission = (Boolean) permSvcResp.get("hasPermission"); - if (!hasPermission.booleanValue()) { + if (!hasPermission) { String errorMsg = (String) permSvcResp.get("failMessage"); Debug.logError(errorMsg, module); request.setAttribute("_ERROR_MESSAGE_", errorMsg); diff --git a/applications/content/src/main/java/org/apache/ofbiz/content/data/DataResourceWorker.java b/applications/content/src/main/java/org/apache/ofbiz/content/data/DataResourceWorker.java index eb26f05279..f2f4690f04 100644 --- a/applications/content/src/main/java/org/apache/ofbiz/content/data/DataResourceWorker.java +++ b/applications/content/src/main/java/org/apache/ofbiz/content/data/DataResourceWorker.java @@ -130,7 +130,7 @@ public class DataResourceWorker implements org.apache.ofbiz.widget.content.Data List categoryValues = EntityQuery.use(delegator).from("DataCategory") .where("parentCategoryId", parentCategoryId) .cache().queryList(); - categoryNode.put("count", Integer.valueOf(categoryValues.size())); + categoryNode.put("count", categoryValues.size()); List> subCategoryIds = new LinkedList<>(); for (GenericValue category : categoryValues) { String id = (String) category.get("dataCategoryId"); @@ -534,9 +534,9 @@ public class DataResourceWorker implements org.apache.ofbiz.widget.content.Data Comparator desc = new Comparator() { @Override public int compare(Object o1, Object o2) { - if (((Long) o1).longValue() > ((Long) o2).longValue()) { + if ((Long) o1 > (Long) o2) { return -1; - } else if (((Long) o1).longValue() < ((Long) o2).longValue()) { + } else if ((Long) o1 < (Long) o2) { return 1; } return 0; @@ -553,7 +553,7 @@ public class DataResourceWorker implements org.apache.ofbiz.widget.content.Data int length = subs.length; for (int i = 0; i < length; i++) { if (subs[i].isDirectory()) { - dirMap.put(Long.valueOf(subs[i].lastModified()), subs[i]); + dirMap.put(subs[i].lastModified(), subs[i]); } } } @@ -1066,7 +1066,7 @@ public class DataResourceWorker implements org.apache.ofbiz.widget.content.Data } byte[] bytes = text.getBytes(UtilIO.getUtf8()); - return UtilMisc.toMap("stream", new ByteArrayInputStream(bytes), "length", Long.valueOf(bytes.length)); + return UtilMisc.toMap("stream", new ByteArrayInputStream(bytes), "length", (long) bytes.length); // object (binary) data } @@ -1098,14 +1098,14 @@ public class DataResourceWorker implements org.apache.ofbiz.widget.content.Data throw new GeneralException("Unsupported OBJECT type [" + dataResourceTypeId + "]; cannot stream"); } - return UtilMisc.toMap("stream", new ByteArrayInputStream(bytes), "length", Long.valueOf(bytes.length)); + return UtilMisc.toMap("stream", new ByteArrayInputStream(bytes), "length", (long) bytes.length); // file data } else if (dataResourceTypeId.endsWith("_FILE") || dataResourceTypeId.endsWith("_FILE_BIN")) { String objectInfo = dataResource.getString("objectInfo"); if (UtilValidate.isNotEmpty(objectInfo)) { File file = DataResourceWorker.getContentFile(dataResourceTypeId, objectInfo, contextRoot); - return UtilMisc.toMap("stream", Files.newInputStream(file.toPath(), StandardOpenOption.READ), "length", Long.valueOf(file.length())); + return UtilMisc.toMap("stream", Files.newInputStream(file.toPath(), StandardOpenOption.READ), "length", file.length()); } throw new GeneralException("No objectInfo found for FILE type [" + dataResourceTypeId + "]; cannot stream"); @@ -1124,7 +1124,7 @@ public class DataResourceWorker implements org.apache.ofbiz.widget.content.Data } URLConnection con = url.openConnection(); - return UtilMisc.toMap("stream", con.getInputStream(), "length", Long.valueOf(con.getContentLength())); + return UtilMisc.toMap("stream", con.getInputStream(), "length", (long) con.getContentLength()); } throw new GeneralException("No objectInfo found for URL_RESOURCE type; cannot stream"); } diff --git a/applications/content/src/main/java/org/apache/ofbiz/content/survey/PdfSurveyServices.java b/applications/content/src/main/java/org/apache/ofbiz/content/survey/PdfSurveyServices.java index 537e94a66b..683f155a05 100644 --- a/applications/content/src/main/java/org/apache/ofbiz/content/survey/PdfSurveyServices.java +++ b/applications/content/src/main/java/org/apache/ofbiz/content/survey/PdfSurveyServices.java @@ -152,10 +152,10 @@ public class PdfSurveyServices { Long sequenceNum = null; if (tabPage != null && tabOrder != null) { - sequenceNum = Long.valueOf(tabPage.intValue() * 1000 + tabOrder.intValue()); + sequenceNum = (long) (tabPage * 1000 + tabOrder); Debug.logInfo("tabPage=" + tabPage + ", tabOrder=" + tabOrder + ", sequenceNum=" + sequenceNum, module); } else if (fieldPositions.length > 0) { - sequenceNum = Long.valueOf((long) fieldPage * 10000 + (long) fieldLly * 1000 + (long) fieldLlx); + sequenceNum = (long) fieldPage * 10000 + (long) fieldLly * 1000 + (long) fieldLlx; Debug.logInfo("fieldPage=" + fieldPage + ", fieldLlx=" + fieldLlx + ", fieldLly=" + fieldLly + ", fieldUrx=" + fieldUrx + ", fieldUry=" + fieldUry + ", sequenceNum=" + sequenceNum, module); } diff --git a/applications/content/src/main/java/org/apache/ofbiz/content/survey/SurveyWrapper.java b/applications/content/src/main/java/org/apache/ofbiz/content/survey/SurveyWrapper.java index 98a978965d..cea38e677c 100644 --- a/applications/content/src/main/java/org/apache/ofbiz/content/survey/SurveyWrapper.java +++ b/applications/content/src/main/java/org/apache/ofbiz/content/survey/SurveyWrapper.java @@ -469,7 +469,7 @@ public class SurveyWrapper { Map thisResult = getOptionResult(question); Long questionTotal = (Long) thisResult.remove("_total"); if (questionTotal == null) { - questionTotal = Long.valueOf(0); + questionTotal = 0L; } // set the total responses resultMap.put("_total", questionTotal); @@ -480,9 +480,9 @@ public class SurveyWrapper { Long optTotal = (Long) entry.getValue(); String optId = entry.getKey(); if (optTotal == null) { - optTotal = Long.valueOf(0); + optTotal = 0L; } - Long percent = Long.valueOf((long)(((double)optTotal.longValue() / (double)questionTotal.longValue()) * 100)); + Long percent = (long) (((double) optTotal / (double) questionTotal) * 100); optMap.put("_total", optTotal); optMap.put("_percent", percent); resultMap.put(optId, optMap); @@ -493,36 +493,36 @@ public class SurveyWrapper { long yesPercent = thisResult[1] > 0 ? (long)(((double)thisResult[1] / (double)thisResult[0]) * 100) : 0; long noPercent = thisResult[2] > 0 ? (long)(((double)thisResult[2] / (double)thisResult[0]) * 100) : 0; - resultMap.put("_total", Long.valueOf(thisResult[0])); - resultMap.put("_yes_total", Long.valueOf(thisResult[1])); - resultMap.put("_no_total", Long.valueOf(thisResult[2])); - resultMap.put("_yes_percent", Long.valueOf(yesPercent)); - resultMap.put("_no_percent", Long.valueOf(noPercent)); + resultMap.put("_total", thisResult[0]); + resultMap.put("_yes_total", thisResult[1]); + resultMap.put("_no_total", thisResult[2]); + resultMap.put("_yes_percent", yesPercent); + resultMap.put("_no_percent", noPercent); resultMap.put("_a_type", "boolean"); } else if ("NUMBER_LONG".equals(questionType)) { double[] thisResult = getNumberResult(question, 1); - resultMap.put("_total", Long.valueOf((long)thisResult[0])); - resultMap.put("_tally", Long.valueOf((long)thisResult[1])); - resultMap.put("_average", Long.valueOf((long)thisResult[2])); + resultMap.put("_total", (long) thisResult[0]); + resultMap.put("_tally", (long) thisResult[1]); + resultMap.put("_average", (long) thisResult[2]); resultMap.put("_a_type", "long"); } else if ("NUMBER_CURRENCY".equals(questionType)) { double[] thisResult = getNumberResult(question, 2); - resultMap.put("_total", Long.valueOf((long)thisResult[0])); - resultMap.put("_tally", Double.valueOf(thisResult[1])); - resultMap.put("_average", Double.valueOf(thisResult[2])); + resultMap.put("_total", (long) thisResult[0]); + resultMap.put("_tally", thisResult[1]); + resultMap.put("_average", thisResult[2]); resultMap.put("_a_type", "double"); } else if ("NUMBER_FLOAT".equals(questionType)) { double[] thisResult = getNumberResult(question, 3); - resultMap.put("_total", Long.valueOf((long)thisResult[0])); - resultMap.put("_tally", Double.valueOf(thisResult[1])); - resultMap.put("_average", Double.valueOf(thisResult[2])); + resultMap.put("_total", (long) thisResult[0]); + resultMap.put("_tally", thisResult[1]); + resultMap.put("_average", thisResult[2]); resultMap.put("_a_type", "double"); } else if ("SEPERATOR_LINE".equals(questionType) || "SEPERATOR_TEXT".equals(questionType)) { // not really a question; ingore completely return null; } else { // default is text - resultMap.put("_total", Long.valueOf(getTextResult(question))); + resultMap.put("_total", getTextResult(question)); resultMap.put("_a_type", "text"); } @@ -593,19 +593,19 @@ public class SurveyWrapper { case 1: Long n = value.getLong("numericResponse"); if (UtilValidate.isNotEmpty(n)) { - result[1] += n.longValue(); + result[1] += n; } break; case 2: Double c = value.getDouble("currencyResponse"); if (UtilValidate.isNotEmpty(c)) { - result[1] += (((double) Math.round((c.doubleValue() - c.doubleValue()) * 100)) / 100); + result[1] += (((double) Math.round((c - c) * 100)) / 100); } break; case 3: Double f = value.getDouble("floatResponse"); if (UtilValidate.isNotEmpty(f)) { - result[1] += f.doubleValue(); + result[1] += f; } break; } @@ -686,9 +686,9 @@ public class SurveyWrapper { if (UtilValidate.isNotEmpty(optionId)) { Long optCount = (Long) result.remove(optionId); if (optCount == null) { - optCount = Long.valueOf(1); + optCount = 1L; } else { - optCount = Long.valueOf(1 + optCount.longValue()); + optCount = 1 + optCount; } result.put(optionId, optCount); total++; // increment the count @@ -713,7 +713,7 @@ public class SurveyWrapper { } } - result.put("_total", Long.valueOf(total)); + result.put("_total", total); return result; } diff --git a/applications/content/src/main/java/org/apache/ofbiz/content/view/SimpleContentViewHandler.java b/applications/content/src/main/java/org/apache/ofbiz/content/view/SimpleContentViewHandler.java index 88319af181..0edbc74480 100644 --- a/applications/content/src/main/java/org/apache/ofbiz/content/view/SimpleContentViewHandler.java +++ b/applications/content/src/main/java/org/apache/ofbiz/content/view/SimpleContentViewHandler.java @@ -176,7 +176,7 @@ public class SimpleContentViewHandler extends AbstractViewHandler { // no service errors; now check the actual response Boolean hasPermission = (Boolean) permSvcResp.get("hasPermission"); - if (!hasPermission.booleanValue()) { + if (!hasPermission) { String errorMsg = (String) permSvcResp.get("failMessage"); Debug.logError(errorMsg, module); request.setAttribute("_ERROR_MESSAGE_", errorMsg); diff --git a/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/LimitedSubContentCacheTransform.java b/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/LimitedSubContentCacheTransform.java index 11da20bbb1..0ebdc65292 100644 --- a/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/LimitedSubContentCacheTransform.java +++ b/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/LimitedSubContentCacheTransform.java @@ -225,8 +225,8 @@ public class LimitedSubContentCacheTransform implements TemplateTransformModel { Boolean isReturnBeforeObj = (Boolean) trailNode.get("isReturnBefore"); Boolean isPickObj = (Boolean) trailNode.get("isPick"); Boolean isFollowObj = (Boolean) trailNode.get("isFollow"); - if ((isReturnBeforeObj == null || !isReturnBeforeObj.booleanValue()) && ((isPickObj != null && - isPickObj.booleanValue()) || (isFollowObj != null && isFollowObj.booleanValue()))) { + if ((isReturnBeforeObj == null || !isReturnBeforeObj) && ((isPickObj != null && + isPickObj) || (isFollowObj != null && isFollowObj))) { List> globalNodeTrail = UtilGenerics.checkList(ctx.get("globalNodeTrail")); if (globalNodeTrail == null) { globalNodeTrail = new LinkedList<>(); @@ -236,7 +236,7 @@ public class LimitedSubContentCacheTransform implements TemplateTransformModel { String csvTrail = ContentWorker.nodeTrailToCsv(globalNodeTrail); ctx.put("nodeTrailCsv", csvTrail); int indentSz = globalNodeTrail.size(); - ctx.put("indent", Integer.valueOf(indentSz)); + ctx.put("indent", indentSz); ctx.put("subDataResourceTypeId", subDataResourceTypeId); ctx.put("mimeTypeId", mimeTypeId); @@ -244,7 +244,7 @@ public class LimitedSubContentCacheTransform implements TemplateTransformModel { ctx.put("content", view); env.setVariable("subDataResourceTypeId", FreeMarkerWorker.autoWrap(subDataResourceTypeId, env)); - env.setVariable("indent", FreeMarkerWorker.autoWrap(Integer.valueOf(indentSz), env)); + env.setVariable("indent", FreeMarkerWorker.autoWrap(indentSz, env)); env.setVariable("nodeTrailCsv", FreeMarkerWorker.autoWrap(csvTrail, env)); env.setVariable("globalNodeTrail", FreeMarkerWorker.autoWrap(globalNodeTrail, env)); env.setVariable("content", FreeMarkerWorker.autoWrap(view, env)); diff --git a/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/LoopSubContentTransform.java b/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/LoopSubContentTransform.java index 6766d83641..fc5c4e9d31 100644 --- a/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/LoopSubContentTransform.java +++ b/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/LoopSubContentTransform.java @@ -85,9 +85,9 @@ public class LoopSubContentTransform implements TemplateTransformModel { List lst = UtilGenerics.checkList(ctx.get("entityList")); Integer idx = (Integer) ctx.get("entityIndex"); if (idx == null) { - idx = Integer.valueOf(0); + idx = 0; } - int i = idx.intValue(); + int i = idx; if (UtilValidate.isEmpty(lst)) { return false; } else if (i >= lst.size()) { @@ -139,7 +139,7 @@ public class LoopSubContentTransform implements TemplateTransformModel { ctx.put("textData", null); } ctx.put("content", subContentDataResourceView); - ctx.put("entityIndex", Integer.valueOf(i + 1)); + ctx.put("entityIndex", i + 1); ctx.put("subContentId", subContentIdSub); ctx.put("drDataResourceId", dataResourceId); ctx.put("mimeTypeId", mimeTypeId); @@ -205,7 +205,7 @@ public class LoopSubContentTransform implements TemplateTransformModel { @Override public int onStart() throws TemplateModelException, IOException { - templateCtx.put("entityIndex", Integer.valueOf(0)); + templateCtx.put("entityIndex", 0); boolean inProgress = prepCtx(delegator, templateCtx); if (inProgress) { return TransformControl.EVALUATE_BODY; diff --git a/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/TraverseSubContentCacheTransform.java b/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/TraverseSubContentCacheTransform.java index 966ca0b874..a38a701ee7 100644 --- a/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/TraverseSubContentCacheTransform.java +++ b/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/TraverseSubContentCacheTransform.java @@ -155,7 +155,7 @@ public class TraverseSubContentCacheTransform implements TemplateTransformModel node = UtilGenerics.checkMap(globalNodeTrail.get(sz - 1)); Boolean checkedObj = (Boolean)node.get("checked"); Map whenMap = UtilGenerics.checkMap(templateRoot.get("whenMap")); - if (checkedObj == null || !checkedObj.booleanValue()) { + if (checkedObj == null || !checkedObj) { ContentWorker.checkConditions(delegator, node, null, whenMap); } } else { @@ -163,7 +163,7 @@ public class TraverseSubContentCacheTransform implements TemplateTransformModel } Boolean isReturnBeforePickBool = (Boolean)node.get("isReturnBeforePick"); - if (isReturnBeforePickBool != null && isReturnBeforePickBool.booleanValue()) { + if (isReturnBeforePickBool != null && isReturnBeforePickBool) { return TransformControl.SKIP_BODY; } @@ -173,8 +173,8 @@ public class TraverseSubContentCacheTransform implements TemplateTransformModel Boolean isPickBool = (Boolean)node.get("isPick"); Boolean isFollowBool = (Boolean)node.get("isFollow"); boolean isPick = true; - if ((isPickBool == null || !isPickBool.booleanValue()) - && (isFollowBool != null && isFollowBool.booleanValue())) { + if ((isPickBool == null || !isPickBool) + && (isFollowBool != null && isFollowBool)) { isPick = ContentWorker.traverseSubContent(traverseContext); } if (isPick) { @@ -241,7 +241,7 @@ public class TraverseSubContentCacheTransform implements TemplateTransformModel globalNodeTrail.addAll(nodeTrail); } int indentSz = globalNodeTrail.size(); - envWrap("indent", Integer.valueOf(indentSz)); + envWrap("indent", indentSz); String trailCsv = ContentWorker.nodeTrailToCsv(globalNodeTrail); envWrap("nodeTrailCsv", trailCsv); envWrap("globalNodeTrail", globalNodeTrail); diff --git a/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/TraverseSubContentTransform.java b/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/TraverseSubContentTransform.java index 86d3bfc60d..f4156d76f9 100644 --- a/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/TraverseSubContentTransform.java +++ b/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/TraverseSubContentTransform.java @@ -162,7 +162,7 @@ public class TraverseSubContentTransform implements TemplateTransformModel { ContentWorker.traceNodeTrail("2", nodeTrail); nodeTrail.add(rootNode); boolean isPick = checkWhen(subContentDataResourceView, (String)traverseContext.get("contentAssocTypeId")); - rootNode.put("isPick", Boolean.valueOf(isPick)); + rootNode.put("isPick", isPick); if (!isPick) { ContentWorker.traceNodeTrail("3", nodeTrail); isPick = ContentWorker.traverseSubContent(traverseContext); @@ -249,8 +249,8 @@ public class TraverseSubContentTransform implements TemplateTransformModel { assocContext.put("typeAncestry", contentTypeAncestry); Map whenMap = UtilGenerics.checkMap(traverseContext.get("whenMap")); List> nodeTrail = UtilGenerics.checkList(traverseContext.get("nodeTrail")); - int indentSz = indent.intValue() + nodeTrail.size(); - assocContext.put("indentObj", Integer.valueOf(indentSz)); + int indentSz = indent + nodeTrail.size(); + assocContext.put("indentObj", indentSz); isPick = ContentWorker.checkWhen(assocContext, (String)whenMap.get("pickWhen"), true); return isPick; } @@ -262,8 +262,8 @@ public class TraverseSubContentTransform implements TemplateTransformModel { String contentId = (String)node.get("contentId"); templateContext.put("subContentId", contentId); templateContext.put("subContentDataResourceView", null); - int indentSz = indent.intValue() + nodeTrail.size(); - templateContext.put("indent", Integer.valueOf(indentSz)); + int indentSz = indent + nodeTrail.size(); + templateContext.put("indent", indentSz); if (sz >= 2) { Map parentNode = nodeTrail.get(sz - 2); GenericValue parentContent = (GenericValue)parentNode.get("value"); diff --git a/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/bom/BOMServices.java b/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/bom/BOMServices.java index d00857729d..803ac80ce7 100644 --- a/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/bom/BOMServices.java +++ b/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/bom/BOMServices.java @@ -106,7 +106,7 @@ public class BOMServices { } catch (GenericEntityException gee) { return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingBomErrorRunningMaxDethAlgorithm", UtilMisc.toMap("errorString", gee.getMessage()), locale)); } - result.put("depth", Long.valueOf(maxDepth)); + result.put("depth", (long) maxDepth); return result; } @@ -163,11 +163,11 @@ public class BOMServices { } } if (virtualMaxDepth > llc.intValue()) { - llc = Long.valueOf(virtualMaxDepth); + llc = (long) virtualMaxDepth; } product.set("billOfMaterialLevel", llc); product.store(); - if (alsoComponents.booleanValue()) { + if (alsoComponents) { Map treeResult = dispatcher.runSync("getBOMTree", UtilMisc.toMap("productId", productId, "bomType", "MANUF_COMPONENT")); if (ServiceUtil.isError(treeResult)) { return ServiceUtil.returnError(ServiceUtil.getErrorMessage(treeResult)); @@ -183,12 +183,12 @@ public class BOMServices { lev = oneProduct.getLong("billOfMaterialLevel").intValue(); } if (lev < oneNode.getDepth()) { - oneProduct.set("billOfMaterialLevel", Long.valueOf(oneNode.getDepth())); + oneProduct.set("billOfMaterialLevel", (long) oneNode.getDepth()); oneProduct.store(); } } } - if (alsoVariants.booleanValue()) { + if (alsoVariants) { List variantProducts = EntityQuery.use(delegator).from("ProductAssoc") .where("productId", productId, "productAssocTypeId", "PRODUCT_VARIANT") @@ -222,7 +222,7 @@ public class BOMServices { try { List products = EntityQuery.use(delegator).from("Product").orderBy("isVirtual DESC").queryList(); - Long zero = Long.valueOf(0); + Long zero = 0L; List allProducts = new LinkedList(); for (GenericValue product : products) { product.set("billOfMaterialLevel", zero); @@ -233,7 +233,7 @@ public class BOMServices { for (GenericValue product : products) { try { - Map depthResult = dispatcher.runSync("updateLowLevelCode", UtilMisc.toMap("productIdTo", product.getString("productId"), "alsoComponents", Boolean.valueOf(false), "alsoVariants", Boolean.valueOf(false))); + Map depthResult = dispatcher.runSync("updateLowLevelCode", UtilMisc.toMap("productIdTo", product.getString("productId"), "alsoComponents", Boolean.FALSE, "alsoVariants", Boolean.FALSE)); if (ServiceUtil.isError(depthResult)) { return ServiceUtil.returnError(ServiceUtil.getErrorMessage(depthResult)); } @@ -305,7 +305,7 @@ public class BOMServices { BigDecimal amount = (BigDecimal) context.get("amount"); Locale locale = (Locale) context.get("locale"); if (type == null) { - type = Integer.valueOf(0); + type = 0; } Date fromDate = null; @@ -321,7 +321,7 @@ public class BOMServices { BOMTree tree = null; try { - tree = new BOMTree(productId, bomType, fromDate, type.intValue(), delegator, dispatcher, userLogin); + tree = new BOMTree(productId, bomType, fromDate, type, delegator, dispatcher, userLogin); } catch (GenericEntityException gee) { return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingBomErrorCreatingBillOfMaterialsTree", UtilMisc.toMap("errorString", gee.getMessage()), locale)); } @@ -385,7 +385,7 @@ public class BOMServices { tree = new BOMTree(productId, "MANUF_COMPONENT", fromDate, BOMTree.EXPLOSION_SINGLE_LEVEL, delegator, dispatcher, userLogin); tree.setRootQuantity(quantity); tree.setRootAmount(amount); - tree.print(components, excludeWIPs.booleanValue()); + tree.print(components, excludeWIPs); if (components.size() > 0) components.remove(0); } catch (GenericEntityException gee) { return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingBomErrorCreatingBillOfMaterialsTree", UtilMisc.toMap("errorString", gee.getMessage()), locale)); @@ -594,7 +594,7 @@ public class BOMServices { BOMNode component = productsInPackages.get(j); Map boxTypeContentMap = new HashMap(); boxTypeContentMap.put("content", orderShipmentReadMap); - boxTypeContentMap.put("componentIndex", Integer.valueOf(j)); + boxTypeContentMap.put("componentIndex", j); GenericValue product = component.getProduct(); String boxTypeId = product.getString("shipmentBoxTypeId"); if (boxTypeId != null) { @@ -668,7 +668,7 @@ public class BOMServices { if (subProduct) { // multi package Integer index = (Integer)contentMap.get("componentIndex"); - BOMNode component = productsInPackages.get(index.intValue()); + BOMNode component = productsInPackages.get(index); product = component.getProduct(); quantity = component.getQuantity(); } else { diff --git a/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRun.java b/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRun.java index ea1f1499a3..eb9ba3f9ff 100644 --- a/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRun.java +++ b/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRun.java @@ -282,7 +282,7 @@ public class ProductionRun { */ public Timestamp recalculateEstimatedCompletionDate() { this.updateCompletionDate = false; - return recalculateEstimatedCompletionDate(Long.valueOf(0), estimatedStartDate); + return recalculateEstimatedCompletionDate(0L, estimatedStartDate); } /** * get the productionRunName property. @@ -408,10 +408,10 @@ public class ProductionRun { double taskTime = 1; double totalTaskTime = 0; if (task.get("estimatedSetupMillis") != null) { - setupTime = task.getDouble("estimatedSetupMillis").doubleValue(); + setupTime = task.getDouble("estimatedSetupMillis"); } if (task.get("estimatedMilliSeconds") != null) { - taskTime = task.getDouble("estimatedMilliSeconds").doubleValue(); + taskTime = task.getDouble("estimatedMilliSeconds"); } totalTaskTime = (setupTime + taskTime * quantity.doubleValue()); diff --git a/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java b/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java index 2ee40a9a06..b722659d8d 100644 --- a/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java +++ b/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java @@ -906,7 +906,7 @@ public class ProductionRunServices { // this should be called only when the last task is completed if ("PRUN_RUNNING".equals(currentStatusId) && (statusId == null || "PRUN_COMPLETED".equals(statusId))) { Map serviceContext = new HashMap(); - if (issueAllComponents.booleanValue()) { + if (issueAllComponents) { // Issue all the components, if this task needs components and they still need to be issued try { List inventoryAssigned = EntityQuery.use(delegator).from("WorkEffortInventoryAssign") @@ -958,7 +958,7 @@ public class ProductionRunServices { if (theTask.get("actualMilliSeconds") == null) { Double autoMillis = null; if (theTask.get("estimatedMilliSeconds") != null) { - autoMillis = Double.valueOf(quantityProduced.doubleValue() * theTask.getDouble("estimatedMilliSeconds")); + autoMillis = quantityProduced.doubleValue() * theTask.getDouble("estimatedMilliSeconds"); } serviceContext.put("actualMilliSeconds", autoMillis); } @@ -1166,13 +1166,13 @@ public class ProductionRunServices { Double actualSetupMillis = workEffort.getDouble("actualSetupMillis"); Double actualMilliSeconds = workEffort.getDouble("actualMilliSeconds"); if (actualSetupMillis == null) { - actualSetupMillis = new Double(0.0); + actualSetupMillis = 0.0; } if (actualMilliSeconds == null) { - actualMilliSeconds = new Double(0.0); + actualMilliSeconds = 0.0; } - actualTotalMilliSeconds += actualSetupMillis.doubleValue(); - actualTotalMilliSeconds += actualMilliSeconds.doubleValue(); + actualTotalMilliSeconds += actualSetupMillis; + actualTotalMilliSeconds += actualMilliSeconds; // Get the template (aka routing task) of the work effort GenericValue routingTaskAssoc = EntityQuery.use(delegator).from("WorkEffortAssoc") .where("workEffortIdTo", productionRunTaskId, @@ -1195,7 +1195,7 @@ public class ProductionRunServices { // compute the total time double totalTime = actualTotalMilliSeconds; if (costComponentCalc.get("perMilliSecond") != null) { - long perMilliSecond = costComponentCalc.getLong("perMilliSecond").longValue(); + long perMilliSecond = costComponentCalc.getLong("perMilliSecond"); if (perMilliSecond != 0) { totalTime = totalTime / perMilliSecond; } @@ -1247,11 +1247,11 @@ public class ProductionRunServices { String currencyUomId = (setupCost != null? setupCost.getString("amountUomId"): usageCost.getString("amountUomId")); BigDecimal setupCostAmount = ZERO; if (setupCost != null) { - setupCostAmount = setupCost.getBigDecimal("amount").multiply(BigDecimal.valueOf(actualSetupMillis.doubleValue())); + setupCostAmount = setupCost.getBigDecimal("amount").multiply(BigDecimal.valueOf(actualSetupMillis)); } BigDecimal usageCostAmount = ZERO; if (usageCost != null) { - usageCostAmount = usageCost.getBigDecimal("amount").multiply(BigDecimal.valueOf(actualMilliSeconds.doubleValue())); + usageCostAmount = usageCost.getBigDecimal("amount").multiply(BigDecimal.valueOf(actualMilliSeconds)); } BigDecimal fixedAssetCost = setupCostAmount.add(usageCostAmount).setScale(decimals, rounding); fixedAssetCost = fixedAssetCost.divide(BigDecimal.valueOf(3600000), decimals, rounding); @@ -1767,14 +1767,14 @@ public class ProductionRunServices { return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingProductionRunProductProducedNotStillAvailable", locale)); } - if (lotId == null && autoCreateLot.booleanValue()) { + if (lotId == null && autoCreateLot) { createLotIfNeeded = Boolean.TRUE; } try { // Find the lot GenericValue lot = EntityQuery.use(delegator).from("Lot").where("lotId", lotId).queryOne(); if (lot == null) { - if (createLotIfNeeded.booleanValue()) { + if (createLotIfNeeded) { Map createLotCtx = ctx.makeValidContext("createLot", ModelService.IN_PARAM, context); createLotCtx.put("creationDate", UtilDateTime.nowTimestamp()); Map serviceResults = dispatcher.runSync("createLot", createLotCtx); @@ -2362,7 +2362,7 @@ public class ProductionRunServices { BigDecimal totalQuantityProduced = quantityProduced.add(addQuantityProduced); BigDecimal totalQuantityRejected = quantityRejected.add(addQuantityRejected); - if (issueRequiredComponents.booleanValue() && addQuantityProduced.compareTo(ZERO) > 0) { + if (issueRequiredComponents && addQuantityProduced.compareTo(ZERO) > 0) { BigDecimal quantityToProduce = theTask.getBigDecimal("quantityToProduce"); if (quantityToProduce == null) { quantityToProduce = BigDecimal.ZERO; @@ -2424,16 +2424,16 @@ public class ProductionRunServices { if (addTaskTime != null) { Double actualMilliSeconds = theTask.getDouble("actualMilliSeconds"); if (actualMilliSeconds == null) { - actualMilliSeconds = Double.valueOf(0); + actualMilliSeconds = (double) 0; } - serviceContext.put("actualMilliSeconds", Double.valueOf(actualMilliSeconds.doubleValue() + addTaskTime.doubleValue())); + serviceContext.put("actualMilliSeconds", actualMilliSeconds + addTaskTime.doubleValue()); } if (addSetupTime != null) { Double actualSetupMillis = theTask.getDouble("actualSetupMillis"); if (actualSetupMillis == null) { - actualSetupMillis = Double.valueOf(0); + actualSetupMillis = (double) 0; } - serviceContext.put("actualSetupMillis", Double.valueOf(actualSetupMillis.doubleValue() + addSetupTime.doubleValue())); + serviceContext.put("actualSetupMillis", actualSetupMillis + addSetupTime.doubleValue()); } serviceContext.put("quantityProduced", totalQuantityProduced); serviceContext.put("quantityRejected", totalQuantityRejected); diff --git a/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/mrp/MrpServices.java b/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/mrp/MrpServices.java index fdf765d81f..035a0f9f9f 100644 --- a/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/mrp/MrpServices.java +++ b/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/mrp/MrpServices.java @@ -138,7 +138,7 @@ public class MrpServices { notAssignedDate = now; } else { Calendar calendar = UtilDateTime.toCalendar(now); - calendar.add(Calendar.YEAR, defaultYearsOffset.intValue()); + calendar.add(Calendar.YEAR, defaultYearsOffset); notAssignedDate = new Timestamp(calendar.getTimeInMillis()); } resultList = null; @@ -679,9 +679,9 @@ public class MrpServices { if (bomLevel == 0) { filterByConditions = EntityCondition.makeCondition(EntityCondition.makeCondition("billOfMaterialLevel", EntityOperator.EQUALS, null), EntityOperator.OR, - EntityCondition.makeCondition("billOfMaterialLevel", EntityOperator.EQUALS, Long.valueOf(bomLevel))); + EntityCondition.makeCondition("billOfMaterialLevel", EntityOperator.EQUALS, bomLevel)); } else { - filterByConditions = EntityCondition.makeCondition("billOfMaterialLevel", EntityOperator.EQUALS, Long.valueOf(bomLevel)); + filterByConditions = EntityCondition.makeCondition("billOfMaterialLevel", EntityOperator.EQUALS, bomLevel); } try { listInventoryEventForMRP = EntityQuery.use(delegator).from("MrpEventView") @@ -689,7 +689,7 @@ public class MrpServices { .orderBy("productId", "eventDate") .queryList(); } catch (GenericEntityException e) { - Long bomLevelToString = new Long(bomLevel); + Long bomLevelToString = bomLevel; return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingMrpErrorForBomLevel", UtilMisc.toMap("bomLevel", bomLevelToString.toString(), "errorString", e.getMessage()), locale)); } diff --git a/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/routing/RoutingServices.java b/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/routing/RoutingServices.java index 3ab2e09773..6ca3fbd7b9 100644 --- a/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/routing/RoutingServices.java +++ b/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/routing/RoutingServices.java @@ -75,7 +75,7 @@ public class RoutingServices { // FIXME: the ProductionRun.getEstimatedTaskTime(...) method will be removed and // its logic will be implemented inside this method. long estimatedTaskTime = ProductionRun.getEstimatedTaskTime(task, quantity, productId, routingId, dispatcher); - result.put("estimatedTaskTime", Long.valueOf(estimatedTaskTime)); + result.put("estimatedTaskTime", estimatedTaskTime); if (task != null && task.get("estimatedSetupMillis") != null) { result.put("setupTime", task.getBigDecimal("estimatedSetupMillis")); } diff --git a/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/techdata/TechDataServices.java b/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/techdata/TechDataServices.java index e966cdaea1..5aec065c23 100644 --- a/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/techdata/TechDataServices.java +++ b/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/techdata/TechDataServices.java @@ -220,7 +220,7 @@ public class TechDataServices { int moveDay = 0; Double capacity = null; Time startTime = null; - while (capacity == null || capacity.doubleValue()==0) { + while (capacity == null || capacity ==0) { switch (dayStart) { case Calendar.MONDAY: capacity = techDataCalendarWeek.getDouble("mondayCapacity"); @@ -251,14 +251,14 @@ public class TechDataServices { startTime = techDataCalendarWeek.getTime("sundayStartTime"); break; } - if (capacity == null || capacity.doubleValue() == 0) { + if (capacity == null || capacity == 0) { moveDay +=1; dayStart = (dayStart==7) ? 1 : dayStart +1; } } result.put("capacity",capacity); result.put("startTime",startTime); - result.put("moveDay",Integer.valueOf(moveDay)); + result.put("moveDay", moveDay); return result; } /** Used to to request the remain capacity available for dateFrom in a TechDataCalenda, @@ -281,7 +281,7 @@ public class TechDataServices { Calendar cDateTrav = Calendar.getInstance(); cDateTrav.setTime(dateFrom); Map position = dayStartCapacityAvailable(techDataCalendarWeek, cDateTrav.get(Calendar.DAY_OF_WEEK)); - int moveDay = ((Integer) position.get("moveDay")).intValue(); + int moveDay = (Integer) position.get("moveDay"); if (moveDay != 0) return 0; Time startTime = (Time) position.get("startTime"); Double capacity = (Double) position.get("capacity"); @@ -314,7 +314,7 @@ public class TechDataServices { cDateTrav.setTime(dateFrom); Map position = dayStartCapacityAvailable(techDataCalendarWeek, cDateTrav.get(Calendar.DAY_OF_WEEK)); Time startTime = (Time) position.get("startTime"); - int moveDay = ((Integer) position.get("moveDay")).intValue(); + int moveDay = (Integer) position.get("moveDay"); dateTo = (moveDay == 0) ? dateFrom : UtilDateTime.getDayStart(dateFrom,moveDay); Timestamp startAvailablePeriod = new Timestamp(UtilDateTime.getDayStart(dateTo).getTime() + startTime.getTime() + cDateTrav.get(Calendar.ZONE_OFFSET) + cDateTrav.get(Calendar.DST_OFFSET)); if (dateTo.before(startAvailablePeriod)) { @@ -325,7 +325,7 @@ public class TechDataServices { cDateTrav.setTime(dateTo); position = dayStartCapacityAvailable(techDataCalendarWeek, cDateTrav.get(Calendar.DAY_OF_WEEK)); startTime = (Time) position.get("startTime"); - moveDay = ((Integer) position.get("moveDay")).intValue(); + moveDay = (Integer) position.get("moveDay"); if (moveDay != 0) dateTo = UtilDateTime.getDayStart(dateTo,moveDay); dateTo.setTime(dateTo.getTime() + startTime.getTime() + cDateTrav.get(Calendar.ZONE_OFFSET) + cDateTrav.get(Calendar.DST_OFFSET)); } @@ -374,7 +374,7 @@ public class TechDataServices { int moveDay = 0; Double capacity = null; Time startTime = null; - while (capacity == null || capacity.doubleValue() == 0) { + while (capacity == null || capacity == 0) { switch (dayEnd) { case Calendar.MONDAY: capacity = techDataCalendarWeek.getDouble("mondayCapacity"); @@ -405,14 +405,14 @@ public class TechDataServices { startTime = techDataCalendarWeek.getTime("sundayStartTime"); break; } - if (capacity == null || capacity.doubleValue() == 0) { + if (capacity == null || capacity == 0) { moveDay -=1; dayEnd = (dayEnd==1) ? 7 : dayEnd - 1; } } result.put("capacity",capacity); result.put("startTime",startTime); - result.put("moveDay",Integer.valueOf(moveDay)); + result.put("moveDay", moveDay); return result; } /** Used to request the remaining capacity available for dateFrom in a TechDataCalenda, @@ -435,7 +435,7 @@ public class TechDataServices { Calendar cDateTrav = Calendar.getInstance(); cDateTrav.setTime(dateFrom); Map position = dayEndCapacityAvailable(techDataCalendarWeek, cDateTrav.get(Calendar.DAY_OF_WEEK)); - int moveDay = ((Integer) position.get("moveDay")).intValue(); + int moveDay = (Integer) position.get("moveDay"); if (moveDay != 0) return 0; Time startTime = (Time) position.get("startTime"); Double capacity = (Double) position.get("capacity"); @@ -468,9 +468,9 @@ public class TechDataServices { cDateTrav.setTime(dateFrom); Map position = dayEndCapacityAvailable(techDataCalendarWeek, cDateTrav.get(Calendar.DAY_OF_WEEK)); Time startTime = (Time) position.get("startTime"); - int moveDay = ((Integer) position.get("moveDay")).intValue(); + int moveDay = (Integer) position.get("moveDay"); Double capacity = (Double) position.get("capacity"); - dateTo = (moveDay == 0) ? dateFrom : UtilDateTime.getDayEnd(dateFrom, Long.valueOf(moveDay)); + dateTo = (moveDay == 0) ? dateFrom : UtilDateTime.getDayEnd(dateFrom, (long) moveDay); Timestamp endAvailablePeriod = new Timestamp(UtilDateTime.getDayStart(dateTo).getTime() + startTime.getTime() + capacity.longValue() + cDateTrav.get(Calendar.ZONE_OFFSET) + cDateTrav.get(Calendar.DST_OFFSET)); if (dateTo.after(endAvailablePeriod)) { dateTo = endAvailablePeriod; @@ -480,7 +480,7 @@ public class TechDataServices { cDateTrav.setTime(dateTo); position = dayEndCapacityAvailable(techDataCalendarWeek, cDateTrav.get(Calendar.DAY_OF_WEEK)); startTime = (Time) position.get("startTime"); - moveDay = ((Integer) position.get("moveDay")).intValue(); + moveDay = (Integer) position.get("moveDay"); capacity = (Double) position.get("capacity"); if (moveDay != 0) dateTo = UtilDateTime.getDayStart(dateTo,moveDay); dateTo.setTime(dateTo.getTime() + startTime.getTime() + capacity.longValue() + cDateTrav.get(Calendar.ZONE_OFFSET) + cDateTrav.get(Calendar.DST_OFFSET)); diff --git a/applications/marketing/src/main/java/org/apache/ofbiz/marketing/report/ReportHelper.java b/applications/marketing/src/main/java/org/apache/ofbiz/marketing/report/ReportHelper.java index 6219dcdb09..718ec5e895 100644 --- a/applications/marketing/src/main/java/org/apache/ofbiz/marketing/report/ReportHelper.java +++ b/applications/marketing/src/main/java/org/apache/ofbiz/marketing/report/ReportHelper.java @@ -64,21 +64,21 @@ public final class ReportHelper { reportValue.put("orders", orderValue.getLong("orderId")); // # of orders if (orderValue.getDouble("grandTotal") == null) { - reportValue.put("orderAmount", Double.valueOf(0)); + reportValue.put("orderAmount", (double) 0); } else { reportValue.put("orderAmount", orderValue.getDouble("grandTotal")); } if ((orderValue.getLong("orderId") == null) || (visit.getLong("visitId") == null) || (visit.getLong("visitId").intValue() == 0)) { - reportValue.put("conversionRate", Double.valueOf(0)); + reportValue.put("conversionRate", (double) 0); } else { - reportValue.put("conversionRate", Double.valueOf(orderValue.getLong("orderId").doubleValue() / visit.getLong("visitId").doubleValue())); + reportValue.put("conversionRate", orderValue.getLong("orderId").doubleValue() / visit.getLong("visitId").doubleValue()); } } else { // no matching orders - all those values are zeroes - reportValue.put("orders", Long.valueOf(0)); - reportValue.put("orderAmount", Double.valueOf(0)); - reportValue.put("conversionRate", Double.valueOf(0)); + reportValue.put("orders", 0L); + reportValue.put("orderAmount", (double) 0); + reportValue.put("conversionRate", (double) 0); } conversionRates.add(reportValue); diff --git a/applications/marketing/src/main/java/org/apache/ofbiz/marketing/tracking/TrackingCodeEvents.java b/applications/marketing/src/main/java/org/apache/ofbiz/marketing/tracking/TrackingCodeEvents.java index 1bcc62ffcc..c424f23980 100644 --- a/applications/marketing/src/main/java/org/apache/ofbiz/marketing/tracking/TrackingCodeEvents.java +++ b/applications/marketing/src/main/java/org/apache/ofbiz/marketing/tracking/TrackingCodeEvents.java @@ -148,9 +148,9 @@ public class TrackingCodeEvents { trackingCode.set("lastModifiedDate", UtilDateTime.nowTimestamp()); //use nearly unlimited trackable lifetime: 10 billion seconds, 310 years - trackingCode.set("trackableLifetime", Long.valueOf(10000000000L)); + trackingCode.set("trackableLifetime", 10000000000L); //use 2592000 seconds as billable lifetime: equals 1 month - trackingCode.set("billableLifetime", Long.valueOf(2592000)); + trackingCode.set("billableLifetime", 2592000L); trackingCode.set("comments", "This TrackingCode has default values because no default TrackingCode could be found."); @@ -224,9 +224,9 @@ public class TrackingCodeEvents { // if trackingCode.trackableLifetime not null and is > 0 write a trackable cookie with name in the form: TKCDT_{trackingCode.trackingCodeTypeId} and timeout will be trackingCode.trackableLifetime Long trackableLifetime = trackingCode.getLong("trackableLifetime"); - if (trackableLifetime != null && (trackableLifetime.longValue() > 0 || trackableLifetime.longValue() == -1)) { + if (trackableLifetime != null && (trackableLifetime > 0 || trackableLifetime == -1)) { Cookie trackableCookie = new Cookie("TKCDT_" + trackingCode.getString("trackingCodeTypeId"), trackingCode.getString("trackingCodeId")); - if (trackableLifetime.longValue() > 0) trackableCookie.setMaxAge(trackableLifetime.intValue()); + if (trackableLifetime > 0) trackableCookie.setMaxAge(trackableLifetime.intValue()); trackableCookie.setPath("/"); if (cookieDomain.length() > 0) trackableCookie.setDomain(cookieDomain); trackableCookie.setSecure(true); @@ -236,9 +236,9 @@ public class TrackingCodeEvents { // if trackingCode.billableLifetime not null and is > 0 write a billable cookie with name in the form: TKCDB_{trackingCode.trackingCodeTypeId} and timeout will be trackingCode.billableLifetime Long billableLifetime = trackingCode.getLong("billableLifetime"); - if (billableLifetime != null && (billableLifetime.longValue() > 0 || billableLifetime.longValue() == -1)) { + if (billableLifetime != null && (billableLifetime > 0 || billableLifetime == -1)) { Cookie billableCookie = new Cookie("TKCDB_" + trackingCode.getString("trackingCodeTypeId"), trackingCode.getString("trackingCodeId")); - if (billableLifetime.longValue() > 0) billableCookie.setMaxAge(billableLifetime.intValue()); + if (billableLifetime > 0) billableCookie.setMaxAge(billableLifetime.intValue()); billableCookie.setPath("/"); if (cookieDomain.length() > 0) billableCookie.setDomain(cookieDomain); billableCookie.setSecure(true); diff --git a/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderLookupServices.java b/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderLookupServices.java index b2f6803777..af3233ae34 100644 --- a/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderLookupServices.java +++ b/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderLookupServices.java @@ -626,15 +626,15 @@ public class OrderLookupServices { // format the param list String paramString = StringUtil.join(paramList, "&"); - result.put("highIndex", Integer.valueOf(highIndex)); - result.put("lowIndex", Integer.valueOf(lowIndex)); + result.put("highIndex", highIndex); + result.put("lowIndex", lowIndex); result.put("viewIndex", viewIndex); result.put("viewSize", viewSize); result.put("showAll", showAll); result.put("paramList", (paramString != null? paramString: "")); result.put("orderList", orderList); - result.put("orderListSize", Integer.valueOf(orderCount)); + result.put("orderListSize", orderCount); return result; } diff --git a/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReadHelper.java b/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReadHelper.java index 9086b61512..a3ff0b2dd9 100644 --- a/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReadHelper.java +++ b/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReadHelper.java @@ -1195,7 +1195,7 @@ public class OrderReadHelper { } if (pieces != null) { - piecesIncluded = pieces.longValue(); + piecesIncluded = pieces; } } } @@ -1222,7 +1222,7 @@ public class OrderReadHelper { itemInfo.put("quantity", getOrderItemQuantity(item)); itemInfo.put("weight", this.getItemWeight(item)); itemInfo.put("size", this.getItemSize(item)); - itemInfo.put("piecesIncluded", Long.valueOf(this.getItemPiecesIncluded(item))); + itemInfo.put("piecesIncluded", this.getItemPiecesIncluded(item)); itemInfo.put("featureSet", this.getItemFeatureSet(item)); return itemInfo; } diff --git a/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReturnServices.java b/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReturnServices.java index 8157eb0d9f..037146f32b 100644 --- a/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReturnServices.java +++ b/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReturnServices.java @@ -111,7 +111,7 @@ public class OrderReturnServices { if (countNewReturnItems == null) { countNewReturnItems = Boolean.FALSE; } - BigDecimal returnTotal = orh.getOrderReturnedTotal(countNewReturnItems.booleanValue()); + BigDecimal returnTotal = orh.getOrderReturnedTotal(countNewReturnItems); BigDecimal orderTotal = orh.getOrderGrandTotal(); BigDecimal available = orderTotal.subtract(returnTotal).subtract(adj); diff --git a/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java b/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java index 06955d6acb..c928d077fc 100644 --- a/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java +++ b/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java @@ -1492,7 +1492,7 @@ public class OrderServices { } EntityCondition cond = null; - if (!forceAll.booleanValue()) { + if (!forceAll) { List exprs = UtilMisc.toList(EntityCondition.makeCondition("grandTotal", EntityOperator.EQUALS, null), EntityCondition.makeCondition("remainingSubTotal", EntityOperator.EQUALS, null)); cond = EntityCondition.makeCondition(exprs, EntityOperator.OR); @@ -2462,7 +2462,7 @@ public class OrderServices { String roleTypeId = (String) context.get("roleTypeId"); Boolean removeOld = (Boolean) context.get("removeOld"); - if (removeOld != null && removeOld.booleanValue()) { + if (removeOld != null && removeOld) { try { delegator.removeByAnd("OrderRole", UtilMisc.toMap("orderId", orderId, "roleTypeId", roleTypeId)); } catch (GenericEntityException e) { @@ -5374,7 +5374,7 @@ public class OrderServices { // process payment Map payResp; try { - payResp = coh.processPayment(productStore, userLogin, false, manualHold.booleanValue()); + payResp = coh.processPayment(productStore, userLogin, false, manualHold); } catch (GeneralException e) { Debug.logError(e, module); return ServiceUtil.returnError(e.getMessage()); @@ -5955,7 +5955,7 @@ public class OrderServices { if (rowNumber == null) { Long count = EntityQuery.use(delegator).from("OrderItemShipGroupAssoc").where("orderId", orderId, "orderItemSeqId", orderItemSeqId).queryCount(); if (count != null) { - rowNumber = Integer.valueOf(count.intValue()); + rowNumber = count.intValue(); result.put("rowNumber", rowNumber); } } @@ -5982,7 +5982,7 @@ public class OrderServices { //if quantity is 0, delete this association only if there is several oisgaoc if (ZERO.compareTo(quantity) == 0) { // test if there is only one oisgaoc then display errror - if (rowNumber.intValue() == 1) { + if (rowNumber == 1) { String errMsg = mainErrorMessage + UtilProperties.getMessage(resource_error, "OrderQuantityAssociatedCannotBeNullOrNegative", locale); Debug.logError(errMsg, module); return ServiceUtil.returnError(errMsg); @@ -6003,8 +6003,8 @@ public class OrderServices { } //Only for multi service calling and the last row : test if orderItem quantity equals OrderItemShipGroupAssocs quantitys if (rowCount != null) { - int rowCountInt = rowCount .intValue(); - int rowNumberInt = rowNumber .intValue(); + int rowCountInt = rowCount; + int rowNumberInt = rowNumber; if (rowCountInt == rowNumberInt - 1) { try { message = validateOrderItemShipGroupAssoc(delegator, dispatcher, orderItem, totalQuantity, oisga, userLogin, locale); @@ -6070,8 +6070,8 @@ public class OrderServices { //Only for multi service calling and the last row : test if orderItem quantity equals OrderItemShipGroupAssocs quantitys if (rowCount != null && rowNumber != null ) { - int rowCountInt = rowCount .intValue(); - int rowNumberInt = rowNumber .intValue(); + int rowCountInt = rowCount; + int rowNumberInt = rowNumber; if (rowCountInt == rowNumberInt - 1) { try { message = validateOrderItemShipGroupAssoc(delegator, dispatcher, orderItem, totalQuantity, oisga, userLogin, locale); diff --git a/applications/order/src/main/java/org/apache/ofbiz/order/requirement/RequirementServices.java b/applications/order/src/main/java/org/apache/ofbiz/order/requirement/RequirementServices.java index 52ae1aa395..1ccb94e30e 100644 --- a/applications/order/src/main/java/org/apache/ofbiz/order/requirement/RequirementServices.java +++ b/applications/order/src/main/java/org/apache/ofbiz/order/requirement/RequirementServices.java @@ -195,7 +195,7 @@ public class RequirementServices { Map results = ServiceUtil.returnSuccess(); results.put("requirementsForSupplier", requirements); - results.put("distinctProductCount", Integer.valueOf(products.size())); + results.put("distinctProductCount", products.size()); results.put("quantityTotal", quantity); results.put("amountTotal", amountTotal); return results; diff --git a/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutEvents.java b/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutEvents.java index 5f9f21c90b..61cc749aba 100644 --- a/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutEvents.java +++ b/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutEvents.java @@ -534,7 +534,7 @@ public class CheckOutEvents { if (productStore == null || productStore.get("explodeOrderItems") == null) { return false; } - return productStore.getBoolean("explodeOrderItems").booleanValue(); + return productStore.getBoolean("explodeOrderItems"); } public static String checkShipmentNeeded(HttpServletRequest request, HttpServletResponse response) { diff --git a/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutHelper.java b/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutHelper.java index b628a9b35a..eb9a96bd51 100644 --- a/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutHelper.java +++ b/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutHelper.java @@ -807,7 +807,7 @@ public class CheckOutHelper { if (itemAdj != null) { for (int x = 0; x < itemAdj.size(); x++) { List adjs = itemAdj.get(x); - ShoppingCartItem item = shoppingCartItemIndexMap.get(Integer.valueOf(x)); + ShoppingCartItem item = shoppingCartItemIndexMap.get(x); if (adjs == null) { adjs = new LinkedList<>(); } @@ -843,7 +843,7 @@ public class CheckOutHelper { price.add(i, cartItem.getBasePrice()); quantity.add(i, cartItem.getQuantity()); shipAmt.add(i, BigDecimal.ZERO); // no per item shipping yet - shoppingCartItemIndexMap.put(Integer.valueOf(i), cartItem); + shoppingCartItemIndexMap.put(i, cartItem); } //add promotion adjustments diff --git a/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCart.java b/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCart.java index 90396dc931..f1911bc9d6 100644 --- a/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCart.java +++ b/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCart.java @@ -582,7 +582,7 @@ public class ShoppingCart implements Iterable, Serializable { if ("PURCHASE_ORDER".equals(getOrderType())) { supplierProduct = getSupplierProduct(productId, quantity, dispatcher); if (supplierProduct != null || "_NA_".equals(this.getPartyId())) { - item = ShoppingCartItem.makePurchaseOrderItem(Integer.valueOf(0), productId, selectedAmount, quantity, features, attributes, prodCatalogId, configWrapper, itemType, itemGroup, dispatcher, this, supplierProduct, shipBeforeDate, shipAfterDate, cancelBackOrderDate); + item = ShoppingCartItem.makePurchaseOrderItem(0, productId, selectedAmount, quantity, features, attributes, prodCatalogId, configWrapper, itemType, itemGroup, dispatcher, this, supplierProduct, shipBeforeDate, shipAfterDate, cancelBackOrderDate); } else { throw new CartItemModifyException("SupplierProduct not found"); } @@ -595,7 +595,7 @@ public class ShoppingCart implements Iterable, Serializable { } catch (GenericEntityException e) { Debug.logError(e, module); } - item = ShoppingCartItem.makeItem(Integer.valueOf(0), productId, selectedAmount, quantity, null, + item = ShoppingCartItem.makeItem(0, productId, selectedAmount, quantity, null, reservStart, reservLength, reservPersons, accommodationMapId, accommodationSpotId, shipBeforeDate, shipAfterDate, features, attributes, prodCatalogId, configWrapper, itemType, itemGroup, dispatcher, this, Boolean.TRUE, Boolean.TRUE, parentProductId, Boolean.FALSE, Boolean.FALSE); @@ -618,7 +618,7 @@ public class ShoppingCart implements Iterable, Serializable { public int addNonProductItem(String itemType, String description, String categoryId, BigDecimal price, BigDecimal quantity, Map attributes, String prodCatalogId, String itemGroupNumber, LocalDispatcher dispatcher) throws CartItemModifyException { ShoppingCart.ShoppingCartItemGroup itemGroup = this.getItemGroupByNumber(itemGroupNumber); - return this.addItem(0, ShoppingCartItem.makeItem(Integer.valueOf(0), itemType, description, categoryId, price, null, quantity, attributes, prodCatalogId, itemGroup, dispatcher, this, Boolean.TRUE)); + return this.addItem(0, ShoppingCartItem.makeItem(0, itemType, description, categoryId, price, null, quantity, attributes, prodCatalogId, itemGroup, dispatcher, this, Boolean.TRUE)); } /** Add an item to the shopping cart. */ @@ -2099,7 +2099,7 @@ public class ShoppingCart implements Iterable, Serializable { if (shipGroups.keySet() != null) { for (Integer shipGroup : shipGroups.keySet()) { - CartShipInfo cartShipInfo = this.getShipInfo(shipGroup.intValue()); + CartShipInfo cartShipInfo = this.getShipInfo(shipGroup); cartShipInfo.resetShipAfterDateIfBefore(item.getShipAfterDate()); cartShipInfo.resetShipBeforeDateIfAfter(item.getShipBeforeDate()); @@ -2470,7 +2470,7 @@ public class ShoppingCart implements Iterable, Serializable { public void setIsGift(int idx, Boolean isGift) { CartShipInfo csi = this.getShipInfo(idx); if (UtilValidate.isNotEmpty(isGift)) { - csi.isGift = isGift.booleanValue() ? "Y" : "N"; + csi.isGift = isGift ? "Y" : "N"; } } @@ -4190,7 +4190,7 @@ public class ShoppingCart implements Iterable, Serializable { CartShipInfo csi = shipInfo.get(i); if ((csi.supplierPartyId == null && supplierPartyId == null) || (UtilValidate.isNotEmpty(csi.supplierPartyId) && csi.supplierPartyId.equals(supplierPartyId))) { - shipGroups.put(Integer.valueOf(i), csi); + shipGroups.put(i, csi); } } return shipGroups; @@ -4341,7 +4341,7 @@ public class ShoppingCart implements Iterable, Serializable { } Map cartItemGroupQuantities = UtilGenerics.checkMap(supplierCartItems.get(cartItem)); - cartItemGroupQuantities.put(Integer.valueOf(shipGroupIndex), dropShipQuantity); + cartItemGroupQuantities.put(shipGroupIndex, dropShipQuantity); } } @@ -4354,7 +4354,7 @@ public class ShoppingCart implements Iterable, Serializable { // Attempt to get the first ship group for the supplierPartyId TreeMap supplierShipGroups = this.getShipGroupsBySupplier(supplierPartyId); if (! UtilValidate.isEmpty(supplierShipGroups)) { - newShipGroupIndex = (supplierShipGroups.firstKey()).intValue(); + newShipGroupIndex = supplierShipGroups.firstKey(); shipInfo = supplierShipGroups.get(supplierShipGroups.firstKey()); } if (newShipGroupIndex == -1) { @@ -4669,7 +4669,7 @@ public class ShoppingCart implements Iterable, Serializable { public void setMaySplit(Boolean maySplit) { if (UtilValidate.isNotEmpty(maySplit)) { - this.maySplit = maySplit.booleanValue() ? "Y" : "N"; + this.maySplit = maySplit ? "Y" : "N"; } } diff --git a/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartHelper.java b/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartHelper.java index 220bece93c..c2c57e9db2 100644 --- a/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartHelper.java +++ b/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartHelper.java @@ -271,7 +271,7 @@ public class ShoppingCartHelper { // Indicate there were no critical errors result = ServiceUtil.returnSuccess(); if (itemId != -1) { - result.put("itemId", Integer.valueOf(itemId)); + result.put("itemId", itemId); } return result; } diff --git a/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartItem.java b/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartItem.java index a9ff83acc1..29121328f9 100644 --- a/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartItem.java +++ b/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartItem.java @@ -223,7 +223,7 @@ public class ShoppingCartItem implements java.io.Serializable { if (cartLocation == null) { cart.addItemToEnd(newItem); } else { - cart.addItem(cartLocation.intValue(), newItem); + cart.addItem(cartLocation, newItem); } if (selectedAmount != null) { @@ -314,7 +314,7 @@ public class ShoppingCartItem implements java.io.Serializable { String itemType, ShoppingCart.ShoppingCartItemGroup itemGroup, LocalDispatcher dispatcher, ShoppingCart cart, Boolean triggerExternalOpsBool, Boolean triggerPriceRulesBool, String parentProductId, Boolean skipInventoryChecks, Boolean skipProductChecks) throws CartItemModifyException, ItemNotFoundException { Delegator delegator = cart.getDelegator(); - GenericValue product = findProduct(delegator, skipProductChecks.booleanValue(), prodCatalogId, productId, cart.getLocale()); + GenericValue product = findProduct(delegator, skipProductChecks, prodCatalogId, productId, cart.getLocale()); GenericValue parentProduct = null; if (parentProductId != null) @@ -392,8 +392,8 @@ public class ShoppingCartItem implements java.io.Serializable { unitPrice = unitPrice == null ? BigDecimal.ZERO : unitPrice; reservLength = reservLength == null ? BigDecimal.ZERO : reservLength; reservPersons = reservPersons == null ? BigDecimal.ZERO : reservPersons; - boolean triggerPriceRules = triggerPriceRulesBool == null ? true : triggerPriceRulesBool.booleanValue(); - boolean triggerExternalOps = triggerExternalOpsBool == null ? true : triggerExternalOpsBool.booleanValue(); + boolean triggerPriceRules = triggerPriceRulesBool == null ? true : triggerPriceRulesBool; + boolean triggerExternalOps = triggerExternalOpsBool == null ? true : triggerExternalOpsBool; // check to see if product is virtual if ("Y".equals(product.getString("isVirtual"))) { @@ -407,7 +407,7 @@ public class ShoppingCartItem implements java.io.Serializable { java.sql.Timestamp nowTimestamp = UtilDateTime.nowTimestamp(); - if (!skipProductChecks.booleanValue()) { + if (!skipProductChecks) { isValidCartProduct(configWrapper, product, nowTimestamp, cart.getLocale()); } @@ -476,7 +476,7 @@ public class ShoppingCartItem implements java.io.Serializable { if (cartLocation == null) { cart.addItemToEnd(newItem); } else { - cart.addItem(cartLocation.intValue(), newItem); + cart.addItem(cartLocation, newItem); } // We have to set the selectedAmount before calling setQuantity because @@ -487,7 +487,7 @@ public class ShoppingCartItem implements java.io.Serializable { } try { - newItem.setQuantity(quantity, dispatcher, cart, triggerExternalOps, true, triggerPriceRules, skipInventoryChecks.booleanValue()); + newItem.setQuantity(quantity, dispatcher, cart, triggerExternalOps, true, triggerPriceRules, skipInventoryChecks); } catch (CartItemModifyException e) { Debug.logWarning(e.getMessage(), module); cart.removeCartItem(cart.getItemIndex(newItem), dispatcher); @@ -598,10 +598,10 @@ public class ShoppingCartItem implements java.io.Serializable { if (cartLocation == null) { cart.addItemToEnd(newItem); } else { - cart.addItem(cartLocation.intValue(), newItem); + cart.addItem(cartLocation, newItem); } - boolean triggerExternalOps = triggerExternalOpsBool == null ? true : triggerExternalOpsBool.booleanValue(); + boolean triggerExternalOps = triggerExternalOpsBool == null ? true : triggerExternalOpsBool; try { newItem.setQuantity(quantity, dispatcher, cart, triggerExternalOps); @@ -1098,7 +1098,7 @@ public class ShoppingCartItem implements java.io.Serializable { throw new CartItemModifyException("There was an error while calculating the price: " + ServiceUtil.getErrorMessage(priceResult)); } Boolean validPriceFound = (Boolean) priceResult.get("validPriceFound"); - if (!validPriceFound.booleanValue()) { + if (!validPriceFound) { throw new CartItemModifyException("Could not find a valid price for the product with ID [" + this.getProductId() + "] and supplier with ID [" + partyId + "], not adding to cart."); } @@ -1789,7 +1789,7 @@ public class ShoppingCartItem implements java.io.Serializable { if (pieces == null) { return 1; } - return pieces.longValue(); + return pieces; } // non-product item assumed 1 piece return 1; @@ -1900,7 +1900,7 @@ public class ShoppingCartItem implements java.io.Serializable { itemInfo.put("weight", this.getWeight()); itemInfo.put("weightUomId", this.getProduct().getString("weightUomId")); itemInfo.put("size", this.getSize()); - itemInfo.put("piecesIncluded", Long.valueOf(this.getPiecesIncluded())); + itemInfo.put("piecesIncluded", this.getPiecesIncluded()); itemInfo.put("featureSet", this.getFeatureSet()); GenericValue product = getProduct(); if (product != null) { diff --git a/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartServices.java b/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartServices.java index 1e4ae5c330..45e03ead81 100644 --- a/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartServices.java +++ b/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartServices.java @@ -84,8 +84,8 @@ public class ShoppingCartServices { return ServiceUtil.returnSuccess(); } - cart.positionItemToGroup(itemIndex.intValue(), quantity, - fromGroupIndex.intValue(), toGroupIndex.intValue(), clearEmptyGroups.booleanValue()); + cart.positionItemToGroup(itemIndex, quantity, + fromGroupIndex, toGroupIndex, clearEmptyGroups); Debug.logInfo("Called cart.positionItemToGroup()", module); return ServiceUtil.returnSuccess(); @@ -102,9 +102,9 @@ public class ShoppingCartServices { Boolean isGift = (Boolean) context.get("isGift"); Locale locale = (Locale) context.get("locale"); - ShoppingCart.CartShipInfo csi = cart.getShipInfo(groupIndex.intValue()); + ShoppingCart.CartShipInfo csi = cart.getShipInfo(groupIndex); if (csi != null) { - int idx = groupIndex.intValue(); + int idx = groupIndex; if (UtilValidate.isNotEmpty(shipmentMethodString)) { int delimiterPos = shipmentMethodString.indexOf('@'); @@ -880,7 +880,7 @@ public class ShoppingCartServices { configWrapper = ProductConfigWorker.loadProductConfigWrapper(delegator, dispatcher, quoteItem.getString("configId"), productId, productStoreId, null, null, currency, locale, userLogin); } try { - itemIndex = cart.addItemToEnd(productId, amount, quantity, quoteUnitPrice, reservStart, reservLength, reservPersons,null,null, null, null, null, configWrapper, null, dispatcher, Boolean.valueOf(!applyQuoteAdjustments), Boolean.valueOf(quoteUnitPrice.compareTo(BigDecimal.ZERO) == 0), Boolean.FALSE, Boolean.FALSE); + itemIndex = cart.addItemToEnd(productId, amount, quantity, quoteUnitPrice, reservStart, reservLength, reservPersons,null,null, null, null, null, configWrapper, null, dispatcher, !applyQuoteAdjustments, quoteUnitPrice.compareTo(BigDecimal.ZERO) == 0, Boolean.FALSE, Boolean.FALSE); } catch (ItemNotFoundException | CartItemModifyException e) { Debug.logError(e, module); @@ -1197,7 +1197,7 @@ public class ShoppingCartServices { if (UtilValidate.isEmpty(vendorProduct)) { if (vendorMap.containsKey("_NA_")) { - index = ((Integer) vendorMap.get("_NA_")).intValue(); + index = (Integer) vendorMap.get("_NA_"); cart.positionItemToGroup(item, item.getQuantity(), 0, index, true); } else { index = cart.addShipInfo(); @@ -1212,7 +1212,7 @@ public class ShoppingCartServices { if (vendorProduct != null) { String vendorPartyId = vendorProduct.getString("vendorPartyId"); if (vendorMap.containsKey(vendorPartyId)) { - index = ((Integer) vendorMap.get(vendorPartyId)).intValue(); + index = (Integer) vendorMap.get(vendorPartyId); cart.positionItemToGroup(item, item.getQuantity(), 0, index, true); } else { index = cart.addShipInfo(); diff --git a/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/product/ProductDisplayWorker.java b/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/product/ProductDisplayWorker.java index 93d175de05..0a80709d55 100644 --- a/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/product/ProductDisplayWorker.java +++ b/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/product/ProductDisplayWorker.java @@ -204,9 +204,9 @@ public final class ProductDisplayWorker { Integer curOcc = productOccurances.get(product.get("productId")); if (curOcc == null) { - curOcc = Integer.valueOf(0); + curOcc = 0; } - productOccurances.put(product.getString("productId"), Integer.valueOf(curOcc.intValue() + 1)); + productOccurances.put(product.getString("productId"), curOcc + 1); } } } diff --git a/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/product/ProductPromoWorker.java b/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/product/ProductPromoWorker.java index a788de032b..7974a90ef3 100644 --- a/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/product/ProductPromoWorker.java +++ b/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/product/ProductPromoWorker.java @@ -463,7 +463,7 @@ public final class ProductPromoWorker { Iterator productPromoCodeIter = productPromoCodeList.iterator(); // support multiple promo codes for a single promo, ie if we run into a use limit for one code see if we can find another for this promo // check the use limit before each pass so if the promo use limit has been hit we don't keep on trying for the promo code use limit, if there is one of course - while ((useLimit == null || useLimit.longValue() > cart.getProductPromoUseCount(productPromoId)) && productPromoCodeIter.hasNext()) { + while ((useLimit == null || useLimit > cart.getProductPromoUseCount(productPromoId)) && productPromoCodeIter.hasNext()) { GenericValue productPromoCode = productPromoCodeIter.next(); String productPromoCodeId = productPromoCode.getString("productPromoCodeId"); Long codeUseLimit = getProductPromoCodeUseLimit(productPromoCode, partyId, delegator); @@ -529,9 +529,9 @@ public final class ProductPromoWorker { EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "ORDER_CANCELLED")), EntityOperator.AND); productPromoCustomerUseSize = EntityQuery.use(delegator).from("ProductPromoUseCheck").where(checkCondition).queryCount(); } - long perCustomerThisOrder = useLimitPerCustomer.longValue() - productPromoCustomerUseSize; - if (candidateUseLimit == null || candidateUseLimit.longValue() > perCustomerThisOrder) { - candidateUseLimit = Long.valueOf(perCustomerThisOrder); + long perCustomerThisOrder = useLimitPerCustomer - productPromoCustomerUseSize; + if (candidateUseLimit == null || candidateUseLimit > perCustomerThisOrder) { + candidateUseLimit = perCustomerThisOrder; } } @@ -543,9 +543,9 @@ public final class ProductPromoWorker { EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "ORDER_REJECTED"), EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "ORDER_CANCELLED")), EntityOperator.AND); long productPromoUseSize = EntityQuery.use(delegator).from("ProductPromoUseCheck").where(checkCondition).queryCount(); - long perPromotionThisOrder = useLimitPerPromotion.longValue() - productPromoUseSize; - if (candidateUseLimit == null || candidateUseLimit.longValue() > perPromotionThisOrder) { - candidateUseLimit = Long.valueOf(perPromotionThisOrder); + long perPromotionThisOrder = useLimitPerPromotion - productPromoUseSize; + if (candidateUseLimit == null || candidateUseLimit > perPromotionThisOrder) { + candidateUseLimit = perPromotionThisOrder; } } @@ -569,8 +569,8 @@ public final class ProductPromoWorker { EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "ORDER_CANCELLED")), EntityOperator.AND); productPromoCustomerUseSize = EntityQuery.use(delegator).from("ProductPromoUseCheck").where(checkCondition).queryCount(); } - long perCustomerThisOrder = codeUseLimitPerCustomer.longValue() - productPromoCustomerUseSize; - codeUseLimit = Long.valueOf(perCustomerThisOrder); + long perCustomerThisOrder = codeUseLimitPerCustomer - productPromoCustomerUseSize; + codeUseLimit = perCustomerThisOrder; } Long codeUseLimitPerCode = productPromoCode.getLong("useLimitPerCode"); @@ -581,9 +581,9 @@ public final class ProductPromoWorker { EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "ORDER_REJECTED"), EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "ORDER_CANCELLED")), EntityOperator.AND); long productPromoCodeUseSize = EntityQuery.use(delegator).from("ProductPromoUseCheck").where(checkCondition).queryCount(); - long perCodeThisOrder = codeUseLimitPerCode.longValue() - productPromoCodeUseSize; - if (codeUseLimit == null || codeUseLimit.longValue() > perCodeThisOrder) { - codeUseLimit = Long.valueOf(perCodeThisOrder); + long perCodeThisOrder = codeUseLimitPerCode - productPromoCodeUseSize; + if (codeUseLimit == null || codeUseLimit > perCodeThisOrder) { + codeUseLimit = perCodeThisOrder; } } @@ -651,7 +651,7 @@ public final class ProductPromoWorker { // check per customer and per promotion code use limits Long useLimit = getProductPromoCodeUseLimit(productPromoCode, partyId, delegator); - if (useLimit != null && useLimit.longValue() <= 0) { + if (useLimit != null && useLimit <= 0) { return UtilProperties.getMessage(resource_error, "productpromoworker.promotion_code_maximum_limit", UtilMisc.toMap("productPromoCodeId", productPromoCodeId), locale); } @@ -795,9 +795,9 @@ public final class ProductPromoWorker { boolean cartChanged = false; Map usageInfoMap = prepareProductUsageInfoMap(cart); String productPromoId = productPromo.getString("productPromoId"); - while ((useLimit == null || useLimit.longValue() > cart.getProductPromoUseCount(productPromoId)) && + while ((useLimit == null || useLimit > cart.getProductPromoUseCount(productPromoId)) && (!requireCode || UtilValidate.isNotEmpty(productPromoCodeId)) && - (codeUseLimit == null || codeUseLimit.longValue() > cart.getProductPromoCodeUse(productPromoCodeId))) { + (codeUseLimit == null || codeUseLimit > cart.getProductPromoCodeUse(productPromoCodeId))) { boolean promoUsed = false; BigDecimal totalDiscountAmount = BigDecimal.ZERO; BigDecimal quantityLeftInActions = BigDecimal.ZERO; @@ -964,7 +964,7 @@ public final class ProductPromoWorker { if (Debug.verboseOn()) Debug.logVerbose("Condition compare done, compareBase=" + compareBase, module); if (compareBase != null) { - int compare = compareBase.intValue(); + int compare = compareBase; if ("PPC_EQ".equals(operatorEnumId)) { if (compare == 0) return true; } else if ("PPC_NEQ".equals(operatorEnumId)) { @@ -1029,11 +1029,11 @@ public final class ProductPromoWorker { if ("PPIP_LPMUP_AMT".equals(inputParamEnumId)) { // NOTE: only check this after we know it's this type of cond, otherwise condValue may not be a number BigDecimal condValueBigDecimal = new BigDecimal(condValue); - compareBase = Integer.valueOf(amountOff.compareTo(condValueBigDecimal)); + compareBase = amountOff.compareTo(condValueBigDecimal); } else if ("PPIP_LPMUP_PER".equals(inputParamEnumId)) { // NOTE: only check this after we know it's this type of cond, otherwise condValue may not be a number BigDecimal condValueBigDecimal = new BigDecimal(condValue); - compareBase = Integer.valueOf(percentOff.compareTo(condValueBigDecimal)); + compareBase = percentOff.compareTo(condValueBigDecimal); } else { // condition doesn't apply to individual item, always passes return true; @@ -1042,7 +1042,7 @@ public final class ProductPromoWorker { Debug.logInfo("Checking condition for item productId=" + cartItem.getProductId() + ", listPrice=" + listPrice + ", basePrice=" + basePrice + ", amountOff=" + amountOff + ", percentOff=" + percentOff + ", condValue=" + condValue + ", compareBase=" + compareBase + ", productPromoCond=" + productPromoCond, module); if (compareBase != null) { - int compare = compareBase.intValue(); + int compare = compareBase; if ("PPC_EQ".equals(operatorEnumId)) { if (compare == 0) { return true; @@ -1218,7 +1218,7 @@ public final class ProductPromoWorker { if (productPromoAction.getString("productPromoId").equals(checkOrderAdjustment.get("productPromoId")) && productPromoAction.getString("productPromoRuleId").equals(checkOrderAdjustment.get("productPromoRuleId")) && productPromoAction.getString("productPromoActionSeqId").equals(checkOrderAdjustment.get("productPromoActionSeqId"))) { - return Integer.valueOf(i); + return i; } } } diff --git a/applications/order/src/main/java/org/apache/ofbiz/order/shoppinglist/ShoppingListEvents.java b/applications/order/src/main/java/org/apache/ofbiz/order/shoppinglist/ShoppingListEvents.java index 46d54a6e77..6b5faf76d6 100644 --- a/applications/order/src/main/java/org/apache/ofbiz/order/shoppinglist/ShoppingListEvents.java +++ b/applications/order/src/main/java/org/apache/ofbiz/order/shoppinglist/ShoppingListEvents.java @@ -142,7 +142,7 @@ public class ShoppingListEvents { Debug.logWarning(e, UtilProperties.getMessage(resource_error,"OrderIllegalCharacterInSelectedItemField", cart.getLocale()), module); } if (cartIdInt != null) { - ShoppingCartItem item = cart.findCartItem(cartIdInt.intValue()); + ShoppingCartItem item = cart.findCartItem(cartIdInt); if (allowPromo || !item.getIsPromo()) { Debug.logInfo("Adding cart item to shopping list [" + shoppingListId + "], allowPromo=" + allowPromo + ", item.getIsPromo()=" + item.getIsPromo() + ", item.getProductId()=" + item.getProductId() + ", item.getQuantity()=" + item.getQuantity(), module); Map serviceResult = null; diff --git a/applications/order/src/main/java/org/apache/ofbiz/order/shoppinglist/ShoppingListServices.java b/applications/order/src/main/java/org/apache/ofbiz/order/shoppinglist/ShoppingListServices.java index b054095c98..1765fe3459 100644 --- a/applications/order/src/main/java/org/apache/ofbiz/order/shoppinglist/ShoppingListServices.java +++ b/applications/order/src/main/java/org/apache/ofbiz/order/shoppinglist/ShoppingListServices.java @@ -82,15 +82,15 @@ public class ShoppingListServices { } if (startDate == null) { - switch (frequency.intValue()) { + switch (frequency) { case 5: - startDate = UtilDateTime.getWeekStart(UtilDateTime.nowTimestamp(), 0, interval.intValue()); + startDate = UtilDateTime.getWeekStart(UtilDateTime.nowTimestamp(), 0, interval); break; case 6: - startDate = UtilDateTime.getMonthStart(UtilDateTime.nowTimestamp(), 0, interval.intValue()); + startDate = UtilDateTime.getMonthStart(UtilDateTime.nowTimestamp(), 0, interval); break; case 7: - startDate = UtilDateTime.getYearStart(UtilDateTime.nowTimestamp(), 0, interval.intValue()); + startDate = UtilDateTime.getYearStart(UtilDateTime.nowTimestamp(), 0, interval); break; default: return ServiceUtil.returnError(UtilProperties.getMessage(resource_error,"OrderInvalidFrequencyForShoppingListRecurrence",locale)); @@ -105,7 +105,7 @@ public class ShoppingListServices { RecurrenceInfo recInfo = null; try { - recInfo = RecurrenceInfo.makeInfo(delegator, startTime, frequency.intValue(), interval.intValue(), -1, endTime); + recInfo = RecurrenceInfo.makeInfo(delegator, startTime, frequency, interval, -1, endTime); } catch (RecurrenceInfoException e) { Debug.logError(e, module); return ServiceUtil.returnError(UtilProperties.getMessage(resource_error,"OrderUnableToCreateShoppingListRecurrenceInformation",locale)); diff --git a/applications/order/src/main/java/org/apache/ofbiz/order/test/OrderTestServices.java b/applications/order/src/main/java/org/apache/ofbiz/order/test/OrderTestServices.java index 1a53a5b42b..d3dbecead8 100644 --- a/applications/order/src/main/java/org/apache/ofbiz/order/test/OrderTestServices.java +++ b/applications/order/src/main/java/org/apache/ofbiz/order/test/OrderTestServices.java @@ -55,7 +55,7 @@ public class OrderTestServices { LocalDispatcher dispatcher = dctx.getDispatcher(); Integer numberOfOrders = (Integer) context.get("numberOfOrders"); - int numberOfOrdersInt = numberOfOrders.intValue(); + int numberOfOrdersInt = numberOfOrders; for (int i = 1; i <= numberOfOrdersInt; i++) { try { ModelService modelService = dctx.getModelService("createTestSalesOrderSingle"); @@ -137,7 +137,7 @@ public class OrderTestServices { } catch (Exception exc) { Debug.logWarning("Error setting userLogin in the cart: " + exc.getMessage(), module); } - int numberOfProductsPerOrderInt = numberOfProductsPerOrder.intValue(); + int numberOfProductsPerOrderInt = numberOfProductsPerOrder; for (int j = 1; j <= numberOfProductsPerOrderInt; j++) { // get a product int k = r.nextInt(productsList.size()); @@ -163,7 +163,7 @@ public class OrderTestServices { resultMap.put("orderId", orderId); } Boolean shipOrder = (Boolean) context.get("shipOrder"); - if (shipOrder.booleanValue() && UtilValidate.isNotEmpty(orderId)) { + if (shipOrder && UtilValidate.isNotEmpty(orderId)) { try { Map result = dispatcher.runSync("quickShipEntireOrder", UtilMisc.toMap("orderId", orderId, "userLogin", userLogin)); if (ServiceUtil.isError(result)) { diff --git a/applications/order/src/main/java/org/apache/ofbiz/order/thirdparty/taxware/TaxwareUTL.java b/applications/order/src/main/java/org/apache/ofbiz/order/thirdparty/taxware/TaxwareUTL.java index 174c752072..643e6d622c 100644 --- a/applications/order/src/main/java/org/apache/ofbiz/order/thirdparty/taxware/TaxwareUTL.java +++ b/applications/order/src/main/java/org/apache/ofbiz/order/thirdparty/taxware/TaxwareUTL.java @@ -99,7 +99,7 @@ public class TaxwareUTL { // make the header file Record header = outHead.makeRecord("outHead"); - header.set("NUMBER_RECORDS", Long.valueOf(outItem.getRecords().size())); + header.set("NUMBER_RECORDS", (long) outItem.getRecords().size()); header.set("PROCESS_INDICATOR", "1"); outHead.addRecord(header); diff --git a/applications/party/src/main/java/org/apache/ofbiz/party/contact/ContactMechServices.java b/applications/party/src/main/java/org/apache/ofbiz/party/contact/ContactMechServices.java index 191fe4147e..cf4cb5045f 100644 --- a/applications/party/src/main/java/org/apache/ofbiz/party/contact/ContactMechServices.java +++ b/applications/party/src/main/java/org/apache/ofbiz/party/contact/ContactMechServices.java @@ -897,7 +897,7 @@ public class ContactMechServices { } } Boolean bShowOld = (Boolean)context.get("showOld"); - boolean showOld = (bShowOld != null && bShowOld.booleanValue()) ? true : false; + boolean showOld = (bShowOld != null && bShowOld) ? true : false; String contactMechTypeId = (String)context.get("contactMechTypeId"); List> valueMaps = ContactMechWorker.getPartyContactMechValueMaps(delegator, partyId, showOld, contactMechTypeId); result.put("valueMaps", valueMaps); @@ -967,7 +967,7 @@ public class ContactMechServices { String expireTime = EntityUtilProperties.getPropertyValue("security", "email_verification.expire.hours", delegator); Integer expTime = Integer.valueOf(expireTime); Calendar calendar = Calendar.getInstance(); - calendar.add(Calendar.HOUR, expTime.intValue()); + calendar.add(Calendar.HOUR, expTime); Date date = calendar.getTime(); Timestamp expireDate = UtilDateTime.toTimestamp(date); diff --git a/applications/party/src/main/java/org/apache/ofbiz/party/contact/ContactMechWorker.java b/applications/party/src/main/java/org/apache/ofbiz/party/contact/ContactMechWorker.java index 73df116565..0f3ba0516e 100644 --- a/applications/party/src/main/java/org/apache/ofbiz/party/contact/ContactMechWorker.java +++ b/applications/party/src/main/java/org/apache/ofbiz/party/contact/ContactMechWorker.java @@ -530,7 +530,7 @@ public class ContactMechWorker { if ("true".equals(request.getParameter("useValues"))) { tryEntity = true; } - target.put("tryEntity", Boolean.valueOf(tryEntity)); + target.put("tryEntity", tryEntity); try { Collection contactMechTypes = EntityQuery.use(delegator).from("ContactMechType").cache(true).queryList(); @@ -784,7 +784,7 @@ public class ContactMechWorker { if ("true".equals(request.getParameter("useValues"))) { tryEntity = true; } - target.put("tryEntity", Boolean.valueOf(tryEntity)); + target.put("tryEntity", tryEntity); try { Collection contactMechTypes = EntityQuery.use(delegator).from("ContactMechType").cache(true).queryList(); diff --git a/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyServices.java b/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyServices.java index 8a203a9b8a..64e723c780 100644 --- a/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyServices.java +++ b/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyServices.java @@ -833,7 +833,7 @@ public class PartyServices { } catch (Exception e) { viewIndex = 0; } - result.put("viewIndex", Integer.valueOf(viewIndex)); + result.put("viewIndex", viewIndex); int viewSize = 20; try { @@ -841,7 +841,7 @@ public class PartyServices { } catch (Exception e) { viewSize = 20; } - result.put("viewSize", Integer.valueOf(viewSize)); + result.put("viewSize", viewSize); // get the lookup flag String lookupFlag = (String) context.get("lookupFlag"); @@ -1238,10 +1238,10 @@ public class PartyServices { partyList = new LinkedList<>(); } result.put("partyList", partyList); - result.put("partyListSize", Integer.valueOf(partyListSize)); + result.put("partyListSize", partyListSize); result.put("paramList", paramList); - result.put("highIndex", Integer.valueOf(highIndex)); - result.put("lowIndex", Integer.valueOf(lowIndex)); + result.put("highIndex", highIndex); + result.put("lowIndex", lowIndex); return result; } @@ -1928,7 +1928,7 @@ public class PartyServices { } } - addrMap.put("sequenceNum", Long.valueOf(seq)); + addrMap.put("sequenceNum", (long) seq); Debug.logInfo("Creating map entry: " + addrMap, module); try { delegator.create(addrMap); diff --git a/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyWorker.java b/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyWorker.java index 5947133ec9..027ffde463 100644 --- a/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyWorker.java +++ b/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyWorker.java @@ -102,7 +102,7 @@ public class PartyWorker { // generate the sequenced number and pad Long seq = delegator.getNextSeqIdLong(clubSeqName); - clubId = clubId + UtilFormatOut.formatPaddedNumber(seq.longValue(), (length - clubId.length() - 1)); + clubId = clubId + UtilFormatOut.formatPaddedNumber(seq, (length - clubId.length() - 1)); // get the check digit int check = UtilValidate.getLuhnCheckDigit(clubId); diff --git a/applications/product/src/main/java/org/apache/ofbiz/product/category/CategoryServices.java b/applications/product/src/main/java/org/apache/ofbiz/product/category/CategoryServices.java index e81eab4dac..04e56fadce 100644 --- a/applications/product/src/main/java/org/apache/ofbiz/product/category/CategoryServices.java +++ b/applications/product/src/main/java/org/apache/ofbiz/product/category/CategoryServices.java @@ -85,7 +85,7 @@ public class CategoryServices { Delegator delegator = dctx.getDelegator(); String categoryId = (String) context.get("categoryId"); String productId = (String) context.get("productId"); - boolean activeOnly = (context.get("activeOnly") != null ? ((Boolean) context.get("activeOnly")).booleanValue() : true); + boolean activeOnly = (context.get("activeOnly") != null ? (Boolean) context.get("activeOnly") : true); Integer index = (Integer) context.get("index"); Timestamp introductionDateLimit = (Timestamp) context.get("introductionDateLimit"); Timestamp releaseDateLimit = (Timestamp) context.get("releaseDateLimit"); @@ -127,7 +127,7 @@ public class CategoryServices { if (productId != null && index == null) { for (GenericValue v: productCategoryMembers) { if (v.getString("productId").equals(productId)) { - index = Integer.valueOf(productCategoryMembers.indexOf(v)); + index = productCategoryMembers.indexOf(v); } } } @@ -143,16 +143,16 @@ public class CategoryServices { String previous = null; String next = null; - if (index.intValue() - 1 >= 0 && index.intValue() - 1 < productCategoryMembers.size()) { - previous = productCategoryMembers.get(index.intValue() - 1).getString("productId"); + if (index - 1 >= 0 && index - 1 < productCategoryMembers.size()) { + previous = productCategoryMembers.get(index - 1).getString("productId"); result.put("previousProductId", previous); } else { previous = productCategoryMembers.get(productCategoryMembers.size() - 1).getString("productId"); result.put("previousProductId", previous); } - if (index.intValue() + 1 < productCategoryMembers.size()) { - next = productCategoryMembers.get(index.intValue() + 1).getString("productId"); + if (index + 1 < productCategoryMembers.size()) { + next = productCategoryMembers.get(index + 1).getString("productId"); result.put("nextProductId", next); } else { next = productCategoryMembers.get(0).getString("productId"); @@ -211,8 +211,8 @@ public class CategoryServices { Delegator delegator = dctx.getDelegator(); LocalDispatcher dispatcher = dctx.getDispatcher(); String productCategoryId = (String) context.get("productCategoryId"); - boolean limitView = ((Boolean) context.get("limitView")).booleanValue(); - int defaultViewSize = ((Integer) context.get("defaultViewSize")).intValue(); + boolean limitView = (Boolean) context.get("limitView"); + int defaultViewSize = (Integer) context.get("defaultViewSize"); Timestamp introductionDateLimit = (Timestamp) context.get("introductionDateLimit"); Timestamp releaseDateLimit = (Timestamp) context.get("releaseDateLimit"); @@ -222,12 +222,12 @@ public class CategoryServices { String prodCatalogId = (String) context.get("prodCatalogId"); - boolean useCacheForMembers = (context.get("useCacheForMembers") == null || ((Boolean) context.get("useCacheForMembers")).booleanValue()); - boolean activeOnly = (context.get("activeOnly") == null || ((Boolean) context.get("activeOnly")).booleanValue()); + boolean useCacheForMembers = (context.get("useCacheForMembers") == null || (Boolean) context.get("useCacheForMembers")); + boolean activeOnly = (context.get("activeOnly") == null || (Boolean) context.get("activeOnly")); // checkViewAllow defaults to false, must be set to true and pass the prodCatalogId to enable boolean checkViewAllow = (prodCatalogId != null && context.get("checkViewAllow") != null && - ((Boolean) context.get("checkViewAllow")).booleanValue()); + (Boolean) context.get("checkViewAllow")); String viewProductCategoryId = null; if (checkViewAllow) { @@ -422,11 +422,11 @@ public class CategoryServices { } Map result = new HashMap(); - result.put("viewIndex", Integer.valueOf(viewIndex)); - result.put("viewSize", Integer.valueOf(viewSize)); - result.put("lowIndex", Integer.valueOf(lowIndex)); - result.put("highIndex", Integer.valueOf(highIndex)); - result.put("listSize", Integer.valueOf(listSize)); + result.put("viewIndex", viewIndex); + result.put("viewSize", viewSize); + result.put("lowIndex", lowIndex); + result.put("highIndex", highIndex); + result.put("listSize", listSize); if (productCategory != null) result.put("productCategory", productCategory); if (productCategoryMembers != null) result.put("productCategoryMembers", productCategoryMembers); return result; diff --git a/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoConfigUtil.java b/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoConfigUtil.java index d153139146..b6fbcbade7 100644 --- a/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoConfigUtil.java +++ b/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoConfigUtil.java @@ -188,7 +188,7 @@ public final class SeoConfigUtil { jSessionIdAnonEnabled = true; } } else { - jSessionIdAnonEnabled = Boolean.valueOf(DEFAULT_ANONYMOUS_VALUE).booleanValue(); + jSessionIdAnonEnabled = Boolean.valueOf(DEFAULT_ANONYMOUS_VALUE); } Debug.logInfo(" " + ELEMENT_ANONYMOUS + ": " + jSessionIdAnonEnabled, module); @@ -220,7 +220,7 @@ public final class SeoConfigUtil { } } } else { - jSessionIdUserEnabled = Boolean.valueOf(DEFAULT_USER_VALUE).booleanValue(); + jSessionIdUserEnabled = Boolean.valueOf(DEFAULT_USER_VALUE); } Debug.logInfo(" " + ELEMENT_USER + ": " + jSessionIdUserEnabled, module); } diff --git a/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoContextFilter.java b/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoContextFilter.java index 505024c186..5a67896e57 100644 --- a/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoContextFilter.java +++ b/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoContextFilter.java @@ -246,7 +246,7 @@ public class SeoContextFilter implements Filter { if (responseCodeInt == null) { response.setStatus(SeoConfigUtil.getDefaultResponseCode()); } else { - response.setStatus(responseCodeInt.intValue()); + response.setStatus(responseCodeInt); } response.setHeader("Location", uri); } else { diff --git a/applications/product/src/main/java/org/apache/ofbiz/product/category/ftl/UrlRegexpTransform.java b/applications/product/src/main/java/org/apache/ofbiz/product/category/ftl/UrlRegexpTransform.java index 71be635320..8631ee9cef 100644 --- a/applications/product/src/main/java/org/apache/ofbiz/product/category/ftl/UrlRegexpTransform.java +++ b/applications/product/src/main/java/org/apache/ofbiz/product/category/ftl/UrlRegexpTransform.java @@ -221,7 +221,7 @@ public class UrlRegexpTransform implements TemplateTransformModel { if (responseCodeInt == null) { response.setStatus(SeoConfigUtil.getDefaultResponseCode()); } else { - response.setStatus(responseCodeInt.intValue()); + response.setStatus(responseCodeInt); } response.setHeader("Location", uri); } else { diff --git a/applications/product/src/main/java/org/apache/ofbiz/product/config/ProductConfigWrapper.java b/applications/product/src/main/java/org/apache/ofbiz/product/config/ProductConfigWrapper.java index 18d6864e16..7d4e5f97b8 100644 --- a/applications/product/src/main/java/org/apache/ofbiz/product/config/ProductConfigWrapper.java +++ b/applications/product/src/main/java/org/apache/ofbiz/product/config/ProductConfigWrapper.java @@ -593,7 +593,7 @@ public class ProductConfigWrapper implements Serializable { if (mult.compareTo(BigDecimal.ZERO) == 0) { mult = BigDecimal.ONE; } - if (validPriceFound.booleanValue()) { + if (validPriceFound) { if (componentListPrice != null) { listPrice = componentListPrice; } @@ -668,7 +668,7 @@ public class ProductConfigWrapper implements Serializable { if (mult.compareTo(BigDecimal.ZERO) == 0) { mult = BigDecimal.ONE; } - if (validPriceFound.booleanValue()) { + if (validPriceFound) { if (componentListPrice != null) { listPrice = componentListPrice; } diff --git a/applications/product/src/main/java/org/apache/ofbiz/product/inventory/InventoryServices.java b/applications/product/src/main/java/org/apache/ofbiz/product/inventory/InventoryServices.java index 3e62156dd4..13d0db3e56 100644 --- a/applications/product/src/main/java/org/apache/ofbiz/product/inventory/InventoryServices.java +++ b/applications/product/src/main/java/org/apache/ofbiz/product/inventory/InventoryServices.java @@ -604,7 +604,7 @@ public class InventoryServices { /* Check the split preference. */ boolean maySplit = false; if (orderItemShipGroup.get("maySplit") != null) { - maySplit = orderItemShipGroup.getBoolean("maySplit").booleanValue(); + maySplit = orderItemShipGroup.getBoolean("maySplit"); } /* Figure out if we must cancel all items. */ @@ -937,9 +937,9 @@ public class InventoryServices { salesUsageViewEntity.addMemberEntity("OH", "OrderHeader"); salesUsageViewEntity.addMemberEntity("ItIss", "ItemIssuance"); salesUsageViewEntity.addMemberEntity("InvIt", "InventoryItem"); - salesUsageViewEntity.addViewLink("OI", "OH", Boolean.valueOf(false), ModelKeyMap.makeKeyMapList("orderId")); - salesUsageViewEntity.addViewLink("OI", "ItIss", Boolean.valueOf(false), ModelKeyMap.makeKeyMapList("orderId", "orderId", "orderItemSeqId", "orderItemSeqId")); - salesUsageViewEntity.addViewLink("ItIss", "InvIt", Boolean.valueOf(false), ModelKeyMap.makeKeyMapList("inventoryItemId")); + salesUsageViewEntity.addViewLink("OI", "OH", Boolean.FALSE, ModelKeyMap.makeKeyMapList("orderId")); + salesUsageViewEntity.addViewLink("OI", "ItIss", Boolean.FALSE, ModelKeyMap.makeKeyMapList("orderId", "orderId", "orderItemSeqId", "orderItemSeqId")); + salesUsageViewEntity.addViewLink("ItIss", "InvIt", Boolean.FALSE, ModelKeyMap.makeKeyMapList("inventoryItemId")); salesUsageViewEntity.addAlias("OI", "productId"); salesUsageViewEntity.addAlias("OH", "statusId"); salesUsageViewEntity.addAlias("OH", "orderTypeId"); @@ -952,8 +952,8 @@ public class InventoryServices { productionUsageViewEntity.addMemberEntity("WEIA", "WorkEffortInventoryAssign"); productionUsageViewEntity.addMemberEntity("WE", "WorkEffort"); productionUsageViewEntity.addMemberEntity("II", "InventoryItem"); - productionUsageViewEntity.addViewLink("WEIA", "WE", Boolean.valueOf(false), ModelKeyMap.makeKeyMapList("workEffortId")); - productionUsageViewEntity.addViewLink("WEIA", "II", Boolean.valueOf(false), ModelKeyMap.makeKeyMapList("inventoryItemId")); + productionUsageViewEntity.addViewLink("WEIA", "WE", Boolean.FALSE, ModelKeyMap.makeKeyMapList("workEffortId")); + productionUsageViewEntity.addViewLink("WEIA", "II", Boolean.FALSE, ModelKeyMap.makeKeyMapList("inventoryItemId")); productionUsageViewEntity.addAlias("WEIA", "quantity"); productionUsageViewEntity.addAlias("WE", "actualCompletionDate"); productionUsageViewEntity.addAlias("WE", "workEffortTypeId"); diff --git a/applications/product/src/main/java/org/apache/ofbiz/product/price/PriceServices.java b/applications/product/src/main/java/org/apache/ofbiz/product/price/PriceServices.java index 29dd016fe5..0a185031b3 100644 --- a/applications/product/src/main/java/org/apache/ofbiz/product/price/PriceServices.java +++ b/applications/product/src/main/java/org/apache/ofbiz/product/price/PriceServices.java @@ -402,7 +402,7 @@ public class PriceServices { result.put("averageCost", averageCostValue != null ? averageCostValue.getBigDecimal("price") : null); result.put("promoPrice", promoPriceValue != null ? promoPriceValue.getBigDecimal("price") : null); result.put("specialPromoPrice", specialPromoPriceValue != null ? specialPromoPriceValue.getBigDecimal("price") : null); - result.put("validPriceFound", Boolean.valueOf(validPriceFound)); + result.put("validPriceFound", validPriceFound); result.put("isSale", Boolean.FALSE); result.put("orderItemPriceInfos", orderItemPriceInfos); @@ -544,7 +544,7 @@ public class PriceServices { Map priceResults = new HashMap(); try { priceResults = dispatcher.runSync("convertUom", UtilMisc. toMap("uomId", currencyDefaultUomId, "uomIdTo", currencyUomIdTo, - "originalValue", tempPrice, "defaultDecimalScale", Long.valueOf(2), "defaultRoundingMode", "HalfUp")); + "originalValue", tempPrice, "defaultDecimalScale", 2L, "defaultRoundingMode", "HalfUp")); if (ServiceUtil.isError(priceResults) || (priceResults.get("convertedValue") == null)) { Debug.logWarning("Unable to convert " + entry.getKey() + " for product " + productId, module); } @@ -1021,8 +1021,8 @@ public class PriceServices { calcResults.put("defaultPrice", defaultPrice); calcResults.put("averageCost", averageCost); calcResults.put("orderItemPriceInfos", orderItemPriceInfos); - calcResults.put("isSale", Boolean.valueOf(isSale)); - calcResults.put("validPriceFound", Boolean.valueOf(validPriceFound)); + calcResults.put("isSale", isSale); + calcResults.put("validPriceFound", validPriceFound); return calcResults; } @@ -1251,7 +1251,7 @@ public class PriceServices { priceFound = EntityUtil.getFirst(agreementPrices); try { Map priceConvertMap = UtilMisc.toMap("uomId", priceFound.getString("currencyUomId"), "uomIdTo", currencyUomId, - "originalValue", priceFound.getBigDecimal("price"), "defaultDecimalScale" , Long.valueOf(2) , "defaultRoundingMode" , "HalfUp"); + "originalValue", priceFound.getBigDecimal("price"), "defaultDecimalScale" , 2L, "defaultRoundingMode" , "HalfUp"); Map priceResults = dispatcher.runSync("convertUom", priceConvertMap); if (ServiceUtil.isError(priceResults) || (priceResults.get("convertedValue") == null)) { Debug.logWarning("Unable to convert " + priceFound + " for product " + productId , module); @@ -1375,7 +1375,7 @@ public class PriceServices { } result.put("price", price); - result.put("validPriceFound", Boolean.valueOf(validPriceFound)); + result.put("validPriceFound", validPriceFound); result.put("orderItemPriceInfos", orderItemPriceInfos); return result; } diff --git a/applications/product/src/main/java/org/apache/ofbiz/product/product/KeywordIndex.java b/applications/product/src/main/java/org/apache/ofbiz/product/product/KeywordIndex.java index f9e42817bc..8e4ffd58ae 100644 --- a/applications/product/src/main/java/org/apache/ofbiz/product/product/KeywordIndex.java +++ b/applications/product/src/main/java/org/apache/ofbiz/product/product/KeywordIndex.java @@ -93,11 +93,11 @@ public class KeywordIndex { int pidWeight = 1; try { - pidWeight = EntityUtilProperties.getPropertyAsInteger("prodsearch", "index.weight.Product.productId", 0).intValue(); + pidWeight = EntityUtilProperties.getPropertyAsInteger("prodsearch", "index.weight.Product.productId", 0); } catch (Exception e) { Debug.logWarning("Could not parse weight number: " + e.toString(), module); } - keywords.put(product.getString("productId").toLowerCase(Locale.getDefault()), Long.valueOf(pidWeight)); + keywords.put(product.getString("productId").toLowerCase(Locale.getDefault()), (long) pidWeight); // Product fields - default is 0 if not found in the properties file if (!"0".equals(EntityUtilProperties.getPropertyValue("prodsearch", "index.weight.Product.productName", "0", delegator))) { @@ -154,7 +154,7 @@ public class KeywordIndex { for (GenericValue variantProductAssoc: variantProductAssocs) { int weight = 1; try { - weight = EntityUtilProperties.getPropertyAsInteger("prodsearch", "index.weight.Variant.Product.productId", 0).intValue(); + weight = EntityUtilProperties.getPropertyAsInteger("prodsearch", "index.weight.Variant.Product.productId", 0); } catch (Exception e) { Debug.logWarning("Could not parse weight number: " + e.toString(), module); } @@ -170,7 +170,7 @@ public class KeywordIndex { 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); } @@ -194,7 +194,7 @@ public class KeywordIndex { } List toBeStored = new LinkedList<>(); - int keywordMaxLength = EntityUtilProperties.getPropertyAsInteger("prodsearch", "product.keyword.max.length", 0).intValue(); + int keywordMaxLength = EntityUtilProperties.getPropertyAsInteger("prodsearch", "product.keyword.max.length", 0); for (Map.Entry entry: keywords.entrySet()) { if (entry.getKey().length() <= keywordMaxLength) { GenericValue productKeyword = delegator.makeValue("ProductKeyword", UtilMisc.toMap("productId", product.getString("productId"), "keyword", entry.getKey(), "keywordTypeId", "KWT_KEYWORD", "relevancyWeight", entry.getValue())); @@ -232,7 +232,7 @@ public class KeywordIndex { int weight = 1; try { - weight = EntityUtilProperties.getPropertyAsInteger("prodsearch", "index.weight." + value.getEntityName() + "." + fieldName, 1).intValue(); + weight = EntityUtilProperties.getPropertyAsInteger("prodsearch", "index.weight." + value.getEntityName() + "." + fieldName, 1); } catch (Exception e) { Debug.logWarning("Could not parse weight number: " + e.toString(), module); } diff --git a/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductSearch.java b/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductSearch.java index 4ec17127b7..744f9b1903 100644 --- a/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductSearch.java +++ b/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductSearch.java @@ -236,7 +236,7 @@ public class ProductSearch { double totalSeconds = ((double)endMillis - (double)startMillis)/1000.0; // store info about results in the database, attached to the user's visitId, if specified - this.saveSearchResultInfo(Long.valueOf(productIds.size()), Double.valueOf(totalSeconds)); + this.saveSearchResultInfo((long) productIds.size(), totalSeconds); return productIds; } @@ -667,7 +667,7 @@ public class ProductSearch { resultSortOrder.setSortOrder(this); } - dynamicViewEntity.addAlias("PROD", "mainProductId", "productId", null, null, Boolean.valueOf(productIdGroupBy), null); + dynamicViewEntity.addAlias("PROD", "mainProductId", "productId", null, null, productIdGroupBy, null); EntityListIterator eli = null; try { @@ -694,7 +694,7 @@ public class ProductSearch { } public ArrayList makeProductIdList(EntityListIterator eli) { - ArrayList productIds = new ArrayList<>(maxResults == null ? 100 : maxResults.intValue()); + ArrayList productIds = new ArrayList<>(maxResults == null ? 100 : maxResults); if (eli == null) { Debug.logWarning("The eli is null, returning zero results", module); return productIds; @@ -707,11 +707,11 @@ public class ProductSearch { if (initialResult != null) { hasResults = true; } - if (resultOffset != null && resultOffset.intValue() > 1) { + if (resultOffset != null && resultOffset > 1) { if (Debug.infoOn()) { Debug.logInfo("Before relative, current index=" + eli.currentIndex(), module); } - hasResults = eli.relative(resultOffset.intValue() - 1); + hasResults = eli.relative(resultOffset - 1); initialResult = null; } @@ -729,9 +729,9 @@ public class ProductSearch { // nothing to get... int failTotal = 0; if (this.resultOffset != null) { - failTotal = this.resultOffset.intValue() - 1; + failTotal = this.resultOffset - 1; } - this.totalResults = Integer.valueOf(failTotal); + this.totalResults = failTotal; return productIds; } @@ -745,7 +745,7 @@ public class ProductSearch { productIds.add(searchResult.getString("mainProductId")); productIdSet.add(searchResult.getString("mainProductId")); - while ((maxResults == null || numRetreived < maxResults.intValue()) && ((searchResult = eli.next()) != null)) { + while ((maxResults == null || numRetreived < maxResults) && ((searchResult = eli.next()) != null)) { String productId = searchResult.getString("mainProductId"); if (!productIdSet.contains(productId)) { productIds.add(productId); @@ -759,12 +759,12 @@ public class ProductSearch { if (searchResult != null) { this.totalResults = eli.getResultsSizeAfterPartialList(); } - if (this.totalResults == null || this.totalResults.intValue() == 0) { + if (this.totalResults == null || this.totalResults == 0) { int total = numRetreived; if (this.resultOffset != null) { - total += (this.resultOffset.intValue() - 1); + total += (this.resultOffset - 1); } - this.totalResults = Integer.valueOf(total); + this.totalResults = total; } Debug.logInfo("Got search values, numRetreived=" + numRetreived + ", totalResults=" + totalResults + ", maxResults=" + maxResults + ", resultOffset=" + resultOffset + ", duplicatesFound(in the current results)=" + duplicatesFound, module); @@ -1543,7 +1543,7 @@ public class ProductSearch { this.anySuffix = anySuffix; this.isAnd = isAnd; if (removeStems != null) { - this.removeStems = removeStems.booleanValue(); + this.removeStems = removeStems; } else { this.removeStems = UtilProperties.propertyValueEquals("keywordsearch", "remove.stems", "true"); } diff --git a/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductSearchEvents.java b/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductSearchEvents.java index dc190797db..bd70c9dc3d 100644 --- a/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductSearchEvents.java +++ b/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductSearchEvents.java @@ -306,7 +306,7 @@ public class ProductSearchEvents { pfa.create(); numAdded++; } - Map messageMap = UtilMisc.toMap("numAdded", Integer.valueOf(numAdded), "productFeatureId", productFeatureId); + Map messageMap = UtilMisc.toMap("numAdded", numAdded, "productFeatureId", productFeatureId); String eventMsg = UtilProperties.getMessage(resource, "productSearchEvents.added_param_features", messageMap, locale) + "."; request.setAttribute("_EVENT_MESSAGE_", eventMsg); } catch (GenericEntityException e) { @@ -354,7 +354,7 @@ public class ProductSearchEvents { String productId = searchResultView.getString("mainProductId"); numRemoved += delegator.removeByAnd("ProductFeatureAppl", UtilMisc.toMap("productId", productId, "productFeatureId", productFeatureId)); } - Map messageMap = UtilMisc.toMap("numRemoved", Integer.valueOf(numRemoved), "productFeatureId", productFeatureId); + Map messageMap = UtilMisc.toMap("numRemoved", numRemoved, "productFeatureId", productFeatureId); String eventMsg = UtilProperties.getMessage(resource, "productSearchEvents.removed_param_features", messageMap, locale) + "."; request.setAttribute("_EVENT_MESSAGE_", eventMsg); } catch (GenericEntityException e) { diff --git a/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductSearchSession.java b/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductSearchSession.java index d4c08a7ca2..3fb2a54729 100644 --- a/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductSearchSession.java +++ b/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductSearchSession.java @@ -178,7 +178,7 @@ public class ProductSearchSession { } catch (Exception e) { Debug.logError(e, "Error in formatting of VIEW_INDEX [" + viewIndexStr + "], setting to 20", module); if (this.viewIndex == null) { - this.setViewIndex(Integer.valueOf(20)); + this.setViewIndex(20); } } } @@ -213,7 +213,7 @@ public class ProductSearchSession { } catch (Exception e) { Debug.logError(e, "Error in formatting of VIEW_SIZE [" + viewSizeStr + "], setting to 20", module); if (this.viewSize == null) { - this.setViewSize(Integer.valueOf(20)); + this.setViewSize(20); } } } @@ -250,7 +250,7 @@ public class ProductSearchSession { */ public void setPreviousViewSize(Integer previousViewSize) { if (previousViewSize == null) { - this.previousViewSize = Integer.valueOf(20); + this.previousViewSize = 20; } else { this.previousViewSize = previousViewSize; } @@ -573,7 +573,7 @@ public class ProductSearchSession { String searchCategoryId = (String) parameters.get("SEARCH_CATEGORY_ID"); String searchSubCategories = (String) parameters.get("SEARCH_SUB_CATEGORIES"); String searchCategoryExc = (String) parameters.get("SEARCH_CATEGORY_EXC"); - Boolean exclude = UtilValidate.isEmpty(searchCategoryExc) ? null : Boolean.valueOf(!"N".equals(searchCategoryExc)); + Boolean exclude = UtilValidate.isEmpty(searchCategoryExc) ? null : !"N".equals(searchCategoryExc); searchAddConstraint(new ProductSearch.CategoryConstraint(searchCategoryId, !"N".equals(searchSubCategories), exclude), session); constraintsChanged = true; } @@ -583,7 +583,7 @@ public class ProductSearchSession { String searchCategoryId = (String) parameters.get("SEARCH_CATEGORY_ID" + catNum); String searchSubCategories = (String) parameters.get("SEARCH_SUB_CATEGORIES" + catNum); String searchCategoryExc = (String) parameters.get("SEARCH_CATEGORY_EXC" + catNum); - Boolean exclude = UtilValidate.isEmpty(searchCategoryExc) ? null : Boolean.valueOf(!"N".equals(searchCategoryExc)); + Boolean exclude = UtilValidate.isEmpty(searchCategoryExc) ? null : !"N".equals(searchCategoryExc); searchAddConstraint(new ProductSearch.CategoryConstraint(searchCategoryId, !"N".equals(searchSubCategories), exclude), session); constraintsChanged = true; } @@ -595,7 +595,7 @@ public class ProductSearchSession { String searchCategoryId = (String) parameters.get("S_CAT" + catNum); String searchSubCategories = (String) parameters.get("S_CSB" + catNum); String searchCategoryExc = (String) parameters.get("S_CEX" + catNum); - Boolean exclude = UtilValidate.isEmpty(searchCategoryExc) ? null : Boolean.valueOf(!"N".equals(searchCategoryExc)); + Boolean exclude = UtilValidate.isEmpty(searchCategoryExc) ? null : !"N".equals(searchCategoryExc); searchAddConstraint(new ProductSearch.CategoryConstraint(searchCategoryId, !"N".equals(searchSubCategories), exclude), session); constraintsChanged = true; } @@ -657,7 +657,7 @@ public class ProductSearchSession { if (UtilValidate.isNotEmpty(productFeatureId)) { String paramNameExt = parameterName.substring("SEARCH_FEAT".length()); String searchCategoryExc = (String) parameters.get("SEARCH_FEAT_EXC" + paramNameExt); - Boolean exclude = UtilValidate.isEmpty(searchCategoryExc) ? null : Boolean.valueOf(!"N".equals(searchCategoryExc)); + Boolean exclude = UtilValidate.isEmpty(searchCategoryExc) ? null : !"N".equals(searchCategoryExc); //Debug.logInfo("parameterName=" + parameterName + ", paramNameExt=" + paramNameExt + ", searchCategoryExc=" + searchCategoryExc + ", exclude=" + exclude, module); searchAddConstraint(new ProductSearch.FeatureConstraint(productFeatureId, exclude), session); constraintsChanged = true; @@ -669,7 +669,7 @@ public class ProductSearchSession { if (UtilValidate.isNotEmpty(productFeatureId)) { String paramNameExt = parameterName.substring("S_PFI".length()); String searchCategoryExc = (String) parameters.get("S_PFX" + paramNameExt); - Boolean exclude = UtilValidate.isEmpty(searchCategoryExc) ? null : Boolean.valueOf(!"N".equals(searchCategoryExc)); + Boolean exclude = UtilValidate.isEmpty(searchCategoryExc) ? null : !"N".equals(searchCategoryExc); searchAddConstraint(new ProductSearch.FeatureConstraint(productFeatureId, exclude), session); constraintsChanged = true; } @@ -681,7 +681,7 @@ public class ProductSearchSession { if (UtilValidate.isNotEmpty(productFeatureCategoryId)) { String paramNameExt = parameterName.substring("SEARCH_PROD_FEAT_CAT".length()); String searchProdFeatureCategoryExc = (String) parameters.get("SEARCH_PROD_FEAT_CAT_EXC" + paramNameExt); - Boolean exclude = UtilValidate.isEmpty(searchProdFeatureCategoryExc) ? null : Boolean.valueOf(!"N".equals(searchProdFeatureCategoryExc)); + Boolean exclude = UtilValidate.isEmpty(searchProdFeatureCategoryExc) ? null : !"N".equals(searchProdFeatureCategoryExc); searchAddConstraint(new ProductSearch.FeatureCategoryConstraint(productFeatureCategoryId, exclude), session); constraintsChanged = true; } @@ -692,7 +692,7 @@ public class ProductSearchSession { if (UtilValidate.isNotEmpty(productFeatureCategoryId)) { String paramNameExt = parameterName.substring("S_FCI".length()); String searchProdFeatureCategoryExc = (String) parameters.get("S_FCX" + paramNameExt); - Boolean exclude = UtilValidate.isEmpty(searchProdFeatureCategoryExc) ? null : Boolean.valueOf(!"N".equals(searchProdFeatureCategoryExc)); + Boolean exclude = UtilValidate.isEmpty(searchProdFeatureCategoryExc) ? null : !"N".equals(searchProdFeatureCategoryExc); searchAddConstraint(new ProductSearch.FeatureCategoryConstraint(productFeatureCategoryId, exclude), session); constraintsChanged = true; } @@ -704,7 +704,7 @@ public class ProductSearchSession { if (UtilValidate.isNotEmpty(productFeatureGroupId)) { String paramNameExt = parameterName.substring("SEARCH_PROD_FEAT_GRP".length()); String searchProdFeatureGroupExc = (String) parameters.get("SEARCH_PROD_FEAT_GRP_EXC" + paramNameExt); - Boolean exclude = UtilValidate.isEmpty(searchProdFeatureGroupExc) ? null : Boolean.valueOf(!"N".equals(searchProdFeatureGroupExc)); + Boolean exclude = UtilValidate.isEmpty(searchProdFeatureGroupExc) ? null : !"N".equals(searchProdFeatureGroupExc); searchAddConstraint(new ProductSearch.FeatureGroupConstraint(productFeatureGroupId, exclude), session); constraintsChanged = true; } @@ -715,7 +715,7 @@ public class ProductSearchSession { if (UtilValidate.isNotEmpty(productFeatureGroupId)) { String paramNameExt = parameterName.substring("S_FGI".length()); String searchProdFeatureGroupExc = (String) parameters.get("S_FGX" + paramNameExt); - Boolean exclude = UtilValidate.isEmpty(searchProdFeatureGroupExc) ? null : Boolean.valueOf(!"N".equals(searchProdFeatureGroupExc)); + Boolean exclude = UtilValidate.isEmpty(searchProdFeatureGroupExc) ? null : !"N".equals(searchProdFeatureGroupExc); searchAddConstraint(new ProductSearch.FeatureGroupConstraint(productFeatureGroupId, exclude), session); constraintsChanged = true; } @@ -906,17 +906,17 @@ public class ProductSearchSession { Integer viewIndexInteger = productSearchOptions.getViewIndex(); if (viewIndexInteger != null) { - viewIndex = viewIndexInteger.intValue(); + viewIndex = viewIndexInteger; } Integer viewSizeInteger = productSearchOptions.getViewSize(); if (viewSizeInteger != null) { - viewSize = viewSizeInteger.intValue(); + viewSize = viewSizeInteger; } Integer previousViewSizeInteger = productSearchOptions.getPreviousViewSize(); if (previousViewSizeInteger != null) { - previousViewSize = previousViewSizeInteger.intValue(); + previousViewSize = previousViewSizeInteger; } String pag = productSearchOptions.getPaging(); @@ -976,8 +976,8 @@ public class ProductSearchSession { resultOffsetInt = 1; } int maxResultsInt = viewSize - addOnTopListSize; - Integer resultOffset = Integer.valueOf(resultOffsetInt); - Integer maxResults = Integer.valueOf(maxResultsInt); + Integer resultOffset = resultOffsetInt; + Integer maxResults = maxResultsInt; ResultSortOrder resultSortOrder = ProductSearchOptions.getResultSortOrder(request); @@ -1006,7 +1006,7 @@ public class ProductSearchSession { Integer totalResults = productSearchContext.getTotalResults(); if (totalResults != null) { - listSize = listSize + totalResults.intValue(); + listSize = listSize + totalResults; } } @@ -1022,11 +1022,11 @@ public class ProductSearchSession { Map result = new HashMap<>(); result.put("productIds", productIds); - result.put("viewIndex", Integer.valueOf(viewIndex)); - result.put("viewSize", Integer.valueOf(viewSize)); - result.put("listSize", Integer.valueOf(listSize)); - result.put("lowIndex", Integer.valueOf(lowIndex)); - result.put("highIndex", Integer.valueOf(highIndex)); + result.put("viewIndex", viewIndex); + result.put("viewSize", viewSize); + result.put("listSize", listSize); + result.put("lowIndex", lowIndex); + result.put("highIndex", highIndex); result.put("paging", paging); result.put("previousViewSize", previousViewSize); result.put("searchConstraintStrings", searchConstraintStrings); @@ -1073,7 +1073,7 @@ public class ProductSearchSession { searchParamString.append("&S_CEX"); searchParamString.append(categoriesCount); searchParamString.append("="); - searchParamString.append(cc.exclude.booleanValue() ? "Y" : "N"); + searchParamString.append(cc.exclude ? "Y" : "N"); } } else if (psc instanceof ProductSearch.FeatureConstraint) { ProductSearch.FeatureConstraint fc = (ProductSearch.FeatureConstraint) psc; @@ -1091,7 +1091,7 @@ public class ProductSearchSession { searchParamString.append("&S_PFX"); searchParamString.append(featuresCount); searchParamString.append("="); - searchParamString.append(fc.exclude.booleanValue() ? "Y" : "N"); + searchParamString.append(fc.exclude ? "Y" : "N"); } } else if (psc instanceof ProductSearch.FeatureCategoryConstraint) { ProductSearch.FeatureCategoryConstraint pfcc = (ProductSearch.FeatureCategoryConstraint) psc; @@ -1109,7 +1109,7 @@ public class ProductSearchSession { searchParamString.append("&S_FCX"); searchParamString.append(featureCategoriesCount); searchParamString.append("="); - searchParamString.append(pfcc.exclude.booleanValue() ? "Y" : "N"); + searchParamString.append(pfcc.exclude ? "Y" : "N"); } } else if (psc instanceof ProductSearch.FeatureGroupConstraint) { ProductSearch.FeatureGroupConstraint pfgc = (ProductSearch.FeatureGroupConstraint) psc; @@ -1127,7 +1127,7 @@ public class ProductSearchSession { searchParamString.append("&S_FGX"); searchParamString.append(featureGroupsCount); searchParamString.append("="); - searchParamString.append(pfgc.exclude.booleanValue() ? "Y" : "N"); + searchParamString.append(pfgc.exclude ? "Y" : "N"); } } else if (psc instanceof ProductSearch.KeywordConstraint) { ProductSearch.KeywordConstraint kc = (ProductSearch.KeywordConstraint) psc; @@ -1318,7 +1318,7 @@ public class ProductSearchSession { entityConditionList.add(EntityCondition.makeCondition("ppcPrice", EntityOperator.LESS_THAN_EQUAL_TO, priceHigh)); entityConditionList.add(EntityCondition.makeCondition("ppcProductPriceTypeId", EntityOperator.EQUALS, "LIST_PRICE")); - Long priceRangeCount = Long.valueOf(0); + Long priceRangeCount = 0L; EntityQuery eq = EntityQuery.use(delegator) .select(UtilMisc.toSet(fieldsToSelect)) .from(dynamicViewEntity) @@ -1374,7 +1374,7 @@ public class ProductSearchSession { ProductSearch.getAllSubCategoryIds(productCategoryId, productCategoryIdSet, delegator, productSearchContext.nowTimestamp); entityConditionList.add(EntityCondition.makeCondition("pcmcProductCategoryId", EntityOperator.IN, productCategoryIdSet)); - Long categoryCount = Long.valueOf(0); + Long categoryCount = 0L; EntityQuery eq = EntityQuery.use(delegator) .select(UtilMisc.toSet(fieldsToSelect)) .from(dynamicViewEntity) diff --git a/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductUtilServices.java b/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductUtilServices.java index 1f0e275175..16065c4e50 100644 --- a/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductUtilServices.java +++ b/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductUtilServices.java @@ -191,7 +191,7 @@ public final class ProductUtilServices { EntityCondition.makeCondition("fromDate", EntityOperator.LESS_THAN, nowTimestamp), EntityCondition.makeCondition("thruDate", EntityOperator.EQUALS, null) ), EntityOperator.AND); - EntityCondition havingCond = EntityCondition.makeCondition("productIdCount", EntityOperator.GREATER_THAN, Long.valueOf(1)); + EntityCondition havingCond = EntityCondition.makeCondition("productIdCount", EntityOperator.GREATER_THAN, 1L); try (EntityListIterator eli = EntityQuery.use(delegator).select("productId", "productCategoryId", "productIdCount").from(dve).where(condition).having(havingCond).queryIterator()) { GenericValue pcm = null; @@ -247,7 +247,7 @@ public final class ProductUtilServices { EntityOperator.OR, EntityCondition.makeCondition("salesDiscontinuationDate", EntityOperator.GREATER_THAN, nowTimestamp)) ), EntityOperator.AND); - EntityCondition havingCond = EntityCondition.makeCondition("productIdToCount", EntityOperator.EQUALS, Long.valueOf(1)); + EntityCondition havingCond = EntityCondition.makeCondition("productIdToCount", EntityOperator.EQUALS, 1L); EntityQuery eq = EntityQuery.use(delegator) .select("productId", "productIdToCount") .from(dve) @@ -335,14 +335,14 @@ public final class ProductUtilServices { String productId = (String) context.get("productId"); Boolean removeOldBool = (Boolean) context.get("removeOld"); - boolean removeOld = removeOldBool.booleanValue(); + boolean removeOld = removeOldBool; Locale locale = (Locale) context.get("locale"); String errMsg = null; Boolean testBool = (Boolean) context.get("test"); boolean test = false; if (testBool != null) { - test = testBool.booleanValue(); + test = testBool; } try { diff --git a/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductWorker.java b/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductWorker.java index 252b7f5869..cfec5d2bf8 100644 --- a/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductWorker.java +++ b/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductWorker.java @@ -74,7 +74,7 @@ public final class ProductWorker { if (chargeShipping == null) { return true; } - return chargeShipping.booleanValue(); + return chargeShipping; } throw new IllegalArgumentException(errMsg); } @@ -148,7 +148,7 @@ public final class ProductWorker { if (taxable == null) { return true; } - return taxable.booleanValue(); + return taxable; } throw new IllegalArgumentException(errMsg); } diff --git a/applications/product/src/main/java/org/apache/ofbiz/product/store/ProductStoreWorker.java b/applications/product/src/main/java/org/apache/ofbiz/product/store/ProductStoreWorker.java index 0d498383fb..356b597f53 100644 --- a/applications/product/src/main/java/org/apache/ofbiz/product/store/ProductStoreWorker.java +++ b/applications/product/src/main/java/org/apache/ofbiz/product/store/ProductStoreWorker.java @@ -632,7 +632,7 @@ public final class ProductStoreWorker { Debug.logError("Error calling isStoreInventoryRequired service, result is: " + invReqResult, module); return false; } - requiredOkay = Boolean.valueOf(wantRequired.booleanValue() == "Y".equals(invReqResult.get("requireInventory"))); + requiredOkay = wantRequired == "Y".equals(invReqResult.get("requireInventory")); } Boolean availableOkay = null; @@ -642,10 +642,10 @@ public final class ProductStoreWorker { Debug.logError("Error calling isStoreInventoryAvailable service, result is: " + invAvailResult, module); return false; } - availableOkay = Boolean.valueOf(wantAvailable.booleanValue() == "Y".equals(invAvailResult.get("available"))); + availableOkay = wantAvailable == "Y".equals(invAvailResult.get("available")); } - if ((requiredOkay == null || requiredOkay.booleanValue()) && (availableOkay == null || availableOkay.booleanValue())) { + if ((requiredOkay == null || requiredOkay) && (availableOkay == null || availableOkay)) { return true; } else { return false; diff --git a/applications/product/src/main/java/org/apache/ofbiz/product/subscription/SubscriptionServices.java b/applications/product/src/main/java/org/apache/ofbiz/product/subscription/SubscriptionServices.java index ac565e16b1..44deb528f6 100644 --- a/applications/product/src/main/java/org/apache/ofbiz/product/subscription/SubscriptionServices.java +++ b/applications/product/src/main/java/org/apache/ofbiz/product/subscription/SubscriptionServices.java @@ -127,7 +127,7 @@ public class SubscriptionServices { calendar.setTime(thruDate); int[] times = UomWorker.uomTimeToCalTime(useTimeUomId); if (times != null) { - calendar.add(times[0], (useTime.intValue() * times[1])); + calendar.add(times[0], (useTime * times[1])); } else { Debug.logWarning("Don't know anything about useTimeUomId [" + useTimeUomId + "], defaulting to month", module); calendar.add(Calendar.MONTH, useTime); @@ -189,7 +189,7 @@ public class SubscriptionServices { Integer qty = (Integer) context.get("quantity"); Locale locale = (Locale) context.get("locale"); if (qty == null) { - qty = Integer.valueOf(1); + qty = 1; } Timestamp orderCreatedDate = (Timestamp) context.get("orderCreatedDate"); @@ -212,9 +212,9 @@ public class SubscriptionServices { for (GenericValue productSubscriptionResource: productSubscriptionResourceList) { Long useTime = productSubscriptionResource.getLong("useTime"); - Integer newUseTime = Integer.valueOf(0); + Integer newUseTime = 0; if (useTime != null) { - newUseTime = Integer.valueOf(useTime.intValue() * qty.intValue()); + newUseTime = useTime.intValue() * qty; } Map subContext = UtilMisc.makeMapWritable(context); subContext.put("useTime", newUseTime); @@ -287,7 +287,7 @@ public class SubscriptionServices { subContext.put("orderId", orderId); subContext.put("orderItemSeqId", orderItem.get("orderItemSeqId")); subContext.put("inventoryItemId", orderItem.get("fromInventoryItemId")); - subContext.put("quantity", Integer.valueOf(qty.intValue())); + subContext.put("quantity", qty.intValue()); Map ctx = dctx.getModelService("processExtendSubscriptionByProduct").makeValid(subContext, ModelService.IN_PARAM); Map thisResult = dispatcher.runSync("processExtendSubscriptionByProduct", ctx); if (ServiceUtil.isError(thisResult)) { diff --git a/applications/product/src/main/java/org/apache/ofbiz/shipment/packing/PackingServices.java b/applications/product/src/main/java/org/apache/ofbiz/shipment/packing/PackingServices.java index 079250fe6b..5ee12066bc 100644 --- a/applications/product/src/main/java/org/apache/ofbiz/shipment/packing/PackingServices.java +++ b/applications/product/src/main/java/org/apache/ofbiz/shipment/packing/PackingServices.java @@ -65,7 +65,7 @@ public class PackingServices { } try { - session.addOrIncreaseLine(orderId, null, shipGroupSeqId, productId, quantity, packageSeq.intValue(), weight, false); + session.addOrIncreaseLine(orderId, null, shipGroupSeqId, productId, quantity, packageSeq, weight, false); } catch (GeneralException e) { Debug.logError(e, module); return ServiceUtil.returnError(e.getMessage()); @@ -194,7 +194,7 @@ public class PackingServices { } } for (int numPackage=0; numPackage result = ServiceUtil.returnSuccess(); - result.put("nextPackageSeq", Integer.valueOf(nextSeq)); + result.put("nextPackageSeq", nextSeq); return result; } @@ -219,7 +219,7 @@ public class PackingServices { PackingSession session = (PackingSession) context.get("packingSession"); int nextSeq = session.clearLastPackage(); Map result = ServiceUtil.returnSuccess(); - result.put("nextPackageSeq", Integer.valueOf(nextSeq)); + result.put("nextPackageSeq", nextSeq); return result; } @@ -234,7 +234,7 @@ public class PackingServices { Locale locale = (Locale) context.get("locale"); PackingSessionLine line = session.findLine(orderId, orderItemSeqId, shipGroupSeqId, - productId, inventoryItemId, packageSeqId.intValue()); + productId, inventoryItemId, packageSeqId); // remove the line if (line != null) { diff --git a/applications/product/src/main/java/org/apache/ofbiz/shipment/packing/PackingSession.java b/applications/product/src/main/java/org/apache/ofbiz/shipment/packing/PackingSession.java index bcb9e9f0f9..51accab9f2 100644 --- a/applications/product/src/main/java/org/apache/ofbiz/shipment/packing/PackingSession.java +++ b/applications/product/src/main/java/org/apache/ofbiz/shipment/packing/PackingSession.java @@ -973,7 +973,7 @@ public class PackingSession implements java.io.Serializable { Set packageSeqIds = new TreeSet(); if (! UtilValidate.isEmpty(this.getLines())) { for (PackingSessionLine line: this.getLines()) { - packageSeqIds.add(Integer.valueOf(line.getPackageSeq())); + packageSeqIds.add(line.getPackageSeq()); } } return UtilMisc.makeListWritable(packageSeqIds); @@ -981,9 +981,9 @@ public class PackingSession implements java.io.Serializable { public void setPackageWeight(int packageSeqId, BigDecimal packageWeight) { if (UtilValidate.isEmpty(packageWeight)) { - packageWeights.remove(Integer.valueOf(packageSeqId)); + packageWeights.remove(packageSeqId); } else { - packageWeights.put(Integer.valueOf(packageSeqId), packageWeight); + packageWeights.put(packageSeqId, packageWeight); } } @@ -1007,9 +1007,9 @@ public class PackingSession implements java.io.Serializable { // These methods (setShipmentBoxType and getShipmentBoxType) are added so that each package will have different box type. public void setShipmentBoxType(int packageSeqId, String shipmentBoxType) { if (UtilValidate.isEmpty(shipmentBoxType)) { - shipmentBoxTypes.remove(Integer.valueOf(packageSeqId)); + shipmentBoxTypes.remove(packageSeqId); } else { - shipmentBoxTypes.put(Integer.valueOf(packageSeqId), shipmentBoxType); + shipmentBoxTypes.put(packageSeqId, shipmentBoxType); } } diff --git a/applications/product/src/main/java/org/apache/ofbiz/shipment/shipment/ShipmentServices.java b/applications/product/src/main/java/org/apache/ofbiz/shipment/shipment/ShipmentServices.java index 99f7077b77..192e6482c6 100644 --- a/applications/product/src/main/java/org/apache/ofbiz/shipment/shipment/ShipmentServices.java +++ b/applications/product/src/main/java/org/apache/ofbiz/shipment/shipment/ShipmentServices.java @@ -436,7 +436,7 @@ public class ShipmentServices { } // there will be only one of each priority; latest will replace - estimatePriority.put(Integer.valueOf(prioritySum), currentEstimate); + estimatePriority.put(prioritySum, currentEstimate); } // locate the highest priority estimate; or the latest entered @@ -633,7 +633,7 @@ public class ShipmentServices { stageShip.set("postalCodeExt", address.get("postalCodeExt")); stageShip.set("countryGeoId", address.get("countryGeoId")); stageShip.set("stateProvinceGeoId", address.get("stateProvinceGeoId")); - stageShip.set("numberOfPackages", Long.valueOf(packages.size())); + stageShip.set("numberOfPackages", (long) packages.size()); stageShip.set("handlingInstructions", shipment.get("handlingInstructions")); toStore.add(stageShip); diff --git a/applications/product/src/main/java/org/apache/ofbiz/shipment/shipment/ShipmentWorker.java b/applications/product/src/main/java/org/apache/ofbiz/shipment/shipment/ShipmentWorker.java index be78f05ff2..cf52bf28fd 100644 --- a/applications/product/src/main/java/org/apache/ofbiz/shipment/shipment/ShipmentWorker.java +++ b/applications/product/src/main/java/org/apache/ofbiz/shipment/shipment/ShipmentWorker.java @@ -114,7 +114,7 @@ public final class ShipmentWorker { if (UtilValidate.isNotEmpty(shippableItemInfo)) { for (Map itemInfo: shippableItemInfo) { - long pieces = ((Long) itemInfo.get("piecesIncluded")).longValue(); + long pieces = (Long) itemInfo.get("piecesIncluded"); BigDecimal totalQuantity = (BigDecimal) itemInfo.get("quantity"); BigDecimal totalWeight = (BigDecimal) itemInfo.get("weight"); String productId = (String) itemInfo.get("productId"); diff --git a/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/fedex/FedexServices.java b/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/fedex/FedexServices.java index f7d87381a6..866612de01 100644 --- a/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/fedex/FedexServices.java +++ b/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/fedex/FedexServices.java @@ -156,7 +156,7 @@ public class FedexServices { Boolean replaceMeterNumber = (Boolean) context.get("replaceMeterNumber"); - if (! replaceMeterNumber.booleanValue()) { + if (!replaceMeterNumber) { String meterNumber = getShipmentGatewayConfigValue(delegator, shipmentGatewayConfigId, "accessMeterNumber", resource, "shipment.fedex.access.meterNumber"); if (UtilValidate.isNotEmpty(meterNumber)) { return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, diff --git a/applications/securityext/src/main/java/org/apache/ofbiz/securityext/login/LoginEvents.java b/applications/securityext/src/main/java/org/apache/ofbiz/securityext/login/LoginEvents.java index c2534d78e0..9e60901cd1 100644 --- a/applications/securityext/src/main/java/org/apache/ofbiz/securityext/login/LoginEvents.java +++ b/applications/securityext/src/main/java/org/apache/ofbiz/securityext/login/LoginEvents.java @@ -250,11 +250,11 @@ public class LoginEvents { } if (useEncryption) { // password encrypted, can't send, generate new password and email to user - passwordToSend = RandomStringUtils.randomAlphanumeric(EntityUtilProperties.getPropertyAsInteger("security", "password.length.min", 5).intValue()); + passwordToSend = RandomStringUtils.randomAlphanumeric(EntityUtilProperties.getPropertyAsInteger("security", "password.length.min", 5)); if ("true".equals(EntityUtilProperties.getPropertyValue("security", "password.lowercase", delegator))){ passwordToSend=passwordToSend.toLowerCase(Locale.getDefault()); } - autoPassword = RandomStringUtils.randomAlphanumeric(EntityUtilProperties.getPropertyAsInteger("security", "password.length.min", 5).intValue()); + autoPassword = RandomStringUtils.randomAlphanumeric(EntityUtilProperties.getPropertyAsInteger("security", "password.length.min", 5)); EntityCrypto entityCrypto = new EntityCrypto(delegator,null); try { passwordToSend = entityCrypto.encrypt(keyValue, EncryptMethod.TRUE, autoPassword); @@ -323,7 +323,7 @@ public class LoginEvents { // set the needed variables in new context Map bodyParameters = new HashMap<>(); - bodyParameters.put("useEncryption", Boolean.valueOf(useEncryption)); + bodyParameters.put("useEncryption", useEncryption); bodyParameters.put("password", UtilFormatOut.checkNull(passwordToSend)); bodyParameters.put("locale", UtilHttp.getLocale(request)); bodyParameters.put("userLogin", supposedUserLogin); diff --git a/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/ICalConverter.java b/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/ICalConverter.java index 3e909e89ea..3285699fb3 100644 --- a/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/ICalConverter.java +++ b/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/ICalConverter.java @@ -227,7 +227,7 @@ public class ICalConverter { } Dur dur = iCalObj.getDuration(); TimeDuration td = new TimeDuration(0, 0, (dur.getWeeks() * 7) + dur.getDays(), dur.getHours(), dur.getMinutes(), dur.getSeconds(), 0); - return Double.valueOf(TimeDuration.toLong(td)); + return (double) TimeDuration.toLong(td); } protected static Timestamp fromLastModified(PropertyList propertyList) { @@ -259,7 +259,7 @@ public class ICalConverter { if (iCalObj == null) { return null; } - return Long.valueOf(iCalObj.getPercentage()); + return (long) iCalObj.getPercentage(); } protected static Double fromPriority(PropertyList propertyList) { @@ -267,7 +267,7 @@ public class ICalConverter { if (iCalObj == null) { return null; } - return Double.valueOf(iCalObj.getLevel()); + return (double) iCalObj.getLevel(); } protected static String fromStatus(PropertyList propertyList) { @@ -455,7 +455,7 @@ public class ICalConverter { Map serviceResult = invokeService("workEffortICalendarPermission", serviceMap, context); Boolean hasPermission = (Boolean) serviceResult.get("hasPermission"); if (hasPermission != null) { - return hasPermission.booleanValue(); + return hasPermission; } return false; } diff --git a/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/WorkEffortKeywordIndex.java b/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/WorkEffortKeywordIndex.java index 0a51145db1..aa4bcb83a3 100644 --- a/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/WorkEffortKeywordIndex.java +++ b/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/WorkEffortKeywordIndex.java @@ -62,11 +62,11 @@ public class WorkEffortKeywordIndex { List strings = new LinkedList<>(); int widWeight = 1; try { - widWeight = EntityUtilProperties.getPropertyAsInteger("workeffort", "index.weight.WorkEffort.workEffortId", 1).intValue(); + widWeight = EntityUtilProperties.getPropertyAsInteger("workeffort", "index.weight.WorkEffort.workEffortId", 1); } catch (Exception e) { Debug.logWarning("Could not parse weight number: " + e.toString(), module); } - keywords.put(workEffort.getString("workEffortId").toLowerCase(Locale.getDefault()), Long.valueOf(widWeight)); + keywords.put(workEffort.getString("workEffortId").toLowerCase(Locale.getDefault()), (long) widWeight); addWeightedKeywordSourceString(workEffort, "workEffortName", strings); addWeightedKeywordSourceString(workEffort, "workEffortTypeId", strings); @@ -92,7 +92,7 @@ public class WorkEffortKeywordIndex { for (String workEffortContentTypeId: workEffortContentTypes.split(",")) { int weight = 1; try { - weight = EntityUtilProperties.getPropertyAsInteger("workeffort", "index.weight.WorkEffortContent." + workEffortContentTypeId, 1).intValue(); + weight = EntityUtilProperties.getPropertyAsInteger("workeffort", "index.weight.WorkEffortContent." + workEffortContentTypeId, 1); } catch (Exception e) { Debug.logWarning("Could not parse weight number: " + e.toString(), module); } @@ -144,7 +144,7 @@ public class WorkEffortKeywordIndex { int weight = 1; try { - weight = EntityUtilProperties.getPropertyAsInteger("workeffort", "index.weight." + value.getEntityName() + "." + fieldName, 1).intValue(); + weight = EntityUtilProperties.getPropertyAsInteger("workeffort", "index.weight." + value.getEntityName() + "." + fieldName, 1); } catch (Exception e) { Debug.logWarning("Could not parse weight number: " + e.toString(), module); } diff --git a/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/WorkEffortSearch.java b/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/WorkEffortSearch.java index 812c4378e7..c1c0f30723 100644 --- a/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/WorkEffortSearch.java +++ b/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/WorkEffortSearch.java @@ -194,7 +194,7 @@ public class WorkEffortSearch { double totalSeconds = ((double)endMillis - (double)startMillis)/1000.0; // store info about results in the database, attached to the user's visitId, if specified - this.saveSearchResultInfo(Long.valueOf(workEffortIds.size()), Double.valueOf(totalSeconds)); + this.saveSearchResultInfo((long) workEffortIds.size(), totalSeconds); return workEffortIds; } catch (GenericEntityException e) { Debug.logError(e, module); @@ -302,7 +302,7 @@ public class WorkEffortSearch { if (resultSortOrder != null) { resultSortOrder.setSortOrder(this); } - dynamicViewEntity.addAlias("WEFF", "workEffortId", null, null, null, Boolean.valueOf(workEffortIdGroupBy), null); + dynamicViewEntity.addAlias("WEFF", "workEffortId", null, null, null, workEffortIdGroupBy, null); EntityListIterator eli = null; try { @@ -327,7 +327,7 @@ public class WorkEffortSearch { } public ArrayList makeWorkEffortIdList(EntityListIterator eli) { - ArrayList workEffortIds = new ArrayList<>(maxResults == null ? 100 : maxResults.intValue()); + ArrayList workEffortIds = new ArrayList<>(maxResults == null ? 100 : maxResults); if (eli == null) { Debug.logWarning("The eli is null, returning zero results", module); return workEffortIds; @@ -341,11 +341,11 @@ public class WorkEffortSearch { if (initialResult != null) { hasResults = true; } - if (resultOffset != null && resultOffset.intValue() > 1) { + if (resultOffset != null && resultOffset > 1) { if (Debug.infoOn()) { Debug.logInfo("Before relative, current index=" + eli.currentIndex(), module); } - hasResults = eli.relative(resultOffset.intValue() - 1); + hasResults = eli.relative(resultOffset - 1); initialResult = null; } @@ -363,9 +363,9 @@ public class WorkEffortSearch { // nothing to get... int failTotal = 0; if (this.resultOffset != null) { - failTotal = this.resultOffset.intValue() - 1; + failTotal = this.resultOffset - 1; } - this.totalResults = Integer.valueOf(failTotal); + this.totalResults = failTotal; return workEffortIds; } @@ -379,7 +379,7 @@ public class WorkEffortSearch { workEffortIds.add(searchResult.getString("workEffortId")); workEffortIdSet.add(searchResult.getString("workEffortId")); - while (((searchResult = eli.next()) != null) && (maxResults == null || numRetreived < maxResults.intValue())) { + while (((searchResult = eli.next()) != null) && (maxResults == null || numRetreived < maxResults)) { String workEffortId = searchResult.getString("workEffortId"); if (!workEffortIdSet.contains(workEffortId)) { workEffortIds.add(workEffortId); @@ -393,12 +393,12 @@ public class WorkEffortSearch { if (searchResult != null) { this.totalResults = eli.getResultsSizeAfterPartialList(); } - if (this.totalResults == null || this.totalResults.intValue() == 0) { + if (this.totalResults == null || this.totalResults == 0) { int total = numRetreived; if (this.resultOffset != null) { - total += (this.resultOffset.intValue() - 1); + total += (this.resultOffset - 1); } - this.totalResults = Integer.valueOf(total); + this.totalResults = total; } Debug.logInfo("Got search values, numRetreived=" + numRetreived + ", totalResults=" + totalResults + ", maxResults=" + maxResults + ", resultOffset=" + resultOffset + ", duplicatesFound(in the current results)=" + duplicatesFound, module); @@ -924,7 +924,7 @@ public class WorkEffortSearch { this.anySuffix = anySuffix; this.isAnd = isAnd; if (removeStems != null) { - this.removeStems = removeStems.booleanValue(); + this.removeStems = removeStems; } else { this.removeStems = UtilProperties.propertyValueEquals("keywordsearch", "remove.stems", "true"); } diff --git a/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/WorkEffortSearchEvents.java b/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/WorkEffortSearchEvents.java index 75b84940c2..2ccf69e587 100644 --- a/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/WorkEffortSearchEvents.java +++ b/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/WorkEffortSearchEvents.java @@ -53,19 +53,19 @@ public class WorkEffortSearchEvents { Integer viewIndexInteger = workEffortSearchOptions.getViewIndex(); if (viewIndexInteger != null) { - viewIndex = viewIndexInteger.intValue(); + viewIndex = viewIndexInteger; } Integer viewSizeInteger = workEffortSearchOptions.getViewSize(); if (viewSizeInteger != null) { - viewSize = viewSizeInteger.intValue(); + viewSize = viewSizeInteger; } lowIndex = viewIndex * viewSize; highIndex = (viewIndex + 1) * viewSize; // setup resultOffset and maxResults, noting that resultOffset is 1 based, not zero based as these numbers - Integer resultOffset = Integer.valueOf(lowIndex + 1); - Integer maxResults = Integer.valueOf(viewSize); + Integer resultOffset = lowIndex + 1; + Integer maxResults = viewSize; // ========== Do the actual search ArrayList workEffortIds = null; @@ -89,7 +89,7 @@ public class WorkEffortSearchEvents { Integer totalResults = workEffortSearchContext.getTotalResults(); if (totalResults != null) { - listSize = totalResults.intValue(); + listSize = totalResults; } } @@ -105,11 +105,11 @@ public class WorkEffortSearchEvents { Map result = new HashMap<>(); result.put("workEffortIds", workEffortIds); - result.put("viewIndex", Integer.valueOf(viewIndex)); - result.put("viewSize", Integer.valueOf(viewSize)); - result.put("listSize", Integer.valueOf(listSize)); - result.put("lowIndex", Integer.valueOf(lowIndex)); - result.put("highIndex", Integer.valueOf(highIndex)); + result.put("viewIndex", viewIndex); + result.put("viewSize", viewSize); + result.put("listSize", listSize); + result.put("lowIndex", lowIndex); + result.put("highIndex", highIndex); result.put("searchConstraintStrings", searchConstraintStrings); result.put("searchSortOrderString", searchSortOrderString); diff --git a/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/WorkEffortSearchSession.java b/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/WorkEffortSearchSession.java index 053fbee950..c8f8b936f3 100644 --- a/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/WorkEffortSearchSession.java +++ b/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/WorkEffortSearchSession.java @@ -268,7 +268,7 @@ public class WorkEffortSearchSession { } catch (Exception e) { Debug.logError(e, "Error formatting VIEW_INDEX, setting to 0", module); // we could just do nothing here, but we know something was specified so we don't want to use the previous value from the session - workEffortSearchOptions.setViewIndex(Integer.valueOf(0)); + workEffortSearchOptions.setViewIndex(0); } } @@ -278,7 +278,7 @@ public class WorkEffortSearchSession { workEffortSearchOptions.setViewSize(Integer.valueOf(viewSizeStr)); } catch (Exception e) { Debug.logError(e, "Error formatting VIEW_SIZE, setting to 20", module); - workEffortSearchOptions.setViewSize(Integer.valueOf(20)); + workEffortSearchOptions.setViewSize(20); } } } diff --git a/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/WorkEffortServices.java b/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/WorkEffortServices.java index 46915bc399..5611e42794 100644 --- a/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/WorkEffortServices.java +++ b/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/WorkEffortServices.java @@ -337,7 +337,7 @@ public class WorkEffortServices { } } canView = (UtilValidate.isNotEmpty(workEffortPartyAssignments)) ? Boolean.TRUE : Boolean.FALSE; - if (!canView.booleanValue() && security.hasEntityPermission("WORKEFFORTMGR", "_VIEW", userLogin)) { + if (!canView && security.hasEntityPermission("WORKEFFORTMGR", "_VIEW", userLogin)) { canView = Boolean.TRUE; } @@ -535,12 +535,12 @@ public class WorkEffortServices { Integer periodTypeObject = (Integer) context.get("periodType"); int periodType = 0; if (periodTypeObject != null) { - periodType = periodTypeObject.intValue(); + periodType = periodTypeObject; } int numPeriods = 0; if (numPeriodsInteger != null) { - numPeriods = numPeriodsInteger.intValue(); + numPeriods = numPeriodsInteger; } // get a timestamp (date) for the beginning of today and for beginning of numDays+1 days from now @@ -731,7 +731,7 @@ public class WorkEffortServices { if (length % periodLen == 0 && startDate.getTime() > periodRange.start().getTime()) { periodSpan++; } - calEntry.put("periodSpan", Integer.valueOf(periodSpan)); + calEntry.put("periodSpan", periodSpan); DateRange calEntryRange = new DateRange((weRange.start().before(startStamp) ? startStamp : weRange.start()), (weRange.end().after(endStamp) ? endStamp : weRange.end())); calEntry.put("calEntryRange", calEntryRange); if (firstEntry) { @@ -740,7 +740,7 @@ public class WorkEffortServices { firstEntry = false; } else { boolean startOfPeriod = ((weRange.start().getTime() - periodRange.start().getTime()) >= 0); - calEntry.put("startOfPeriod", Boolean.valueOf(startOfPeriod)); + calEntry.put("startOfPeriod", startOfPeriod); } curWorkEfforts.add(calEntry); } @@ -758,7 +758,7 @@ public class WorkEffortServices { } Map result = new HashMap<>(); result.put("periods", periods); - result.put("maxConcurrentEntries", Integer.valueOf(maxConcurrentEntries)); + result.put("maxConcurrentEntries", maxConcurrentEntries); return result; } @@ -800,17 +800,17 @@ public class WorkEffortServices { GenericValue inventoryItemDetail = EntityQuery.use(delegator).from("InventoryItemDetail").where("inventoryItemId", inventoryItem.getString("inventoryItemId")).orderBy("inventoryItemDetailSeqId").queryFirst(); if (inventoryItemDetail != null && inventoryItemDetail.get("quantityOnHandDiff") != null) { Double inventoryItemQty = inventoryItemDetail.getDouble("quantityOnHandDiff"); - producedQtyTot = producedQtyTot + inventoryItemQty.doubleValue(); + producedQtyTot = producedQtyTot + inventoryItemQty; } } } double estimatedQuantity = 0.0; if (incomingProductionRun.get("estimatedQuantity") != null) { - estimatedQuantity = incomingProductionRun.getDouble("estimatedQuantity").doubleValue(); + estimatedQuantity = incomingProductionRun.getDouble("estimatedQuantity"); } double remainingQuantity = estimatedQuantity - producedQtyTot; // the qty that still needs to be produced if (remainingQuantity > 0) { - incomingProductionRun.set("estimatedQuantity", Double.valueOf(remainingQuantity)); + incomingProductionRun.set("estimatedQuantity", remainingQuantity); } else { continue; } @@ -824,9 +824,9 @@ public class WorkEffortServices { } Double remainingQuantityTot = (Double)quantitySummary.get("estimatedQuantityTotal"); if (remainingQuantityTot == null) { - quantitySummary.put("estimatedQuantityTotal", Double.valueOf(remainingQuantity)); + quantitySummary.put("estimatedQuantityTotal", remainingQuantity); } else { - quantitySummary.put("estimatedQuantityTotal", Double.valueOf(remainingQuantity + remainingQuantityTot.doubleValue())); + quantitySummary.put("estimatedQuantityTotal", remainingQuantity + remainingQuantityTot); } List incomingProductionRunList = UtilGenerics.checkList(quantitySummary.get("incomingProductionRunList")); @@ -861,7 +861,7 @@ public class WorkEffortServices { String weFacilityId = outgoingProductionRun.getString("facilityId"); Double neededQuantity = outgoingProductionRun.getDouble("estimatedQuantity"); if (neededQuantity == null) { - neededQuantity = Double.valueOf(0); + neededQuantity = (double) 0; } Map quantitySummary = UtilGenerics.checkMap(summaryOutByFacility.get(weFacilityId)); @@ -874,7 +874,7 @@ public class WorkEffortServices { if (remainingQuantityTot == null) { quantitySummary.put("estimatedQuantityTotal", neededQuantity); } else { - quantitySummary.put("estimatedQuantityTotal", Double.valueOf(neededQuantity.doubleValue() + remainingQuantityTot.doubleValue())); + quantitySummary.put("estimatedQuantityTotal", neededQuantity + remainingQuantityTot); } List outgoingProductionRunList = UtilGenerics.checkList(quantitySummary.get("outgoingProductionRunList")); @@ -955,7 +955,7 @@ public class WorkEffortServices { if (temporalExpression != null) { eventDateTime = temporalExpression.first(cal).getTime(); Date reminderDateTime = null; - long reminderOffset = reminder.get("reminderOffset") == null ? 0 : reminder.getLong("reminderOffset").longValue(); + long reminderOffset = reminder.get("reminderOffset") == null ? 0 : reminder.getLong("reminderOffset"); if (reminderStamp == null) { if (reminderOffset != 0) { cal.setTime(eventDateTime); @@ -991,7 +991,7 @@ public class WorkEffortServices { } else { newReminderDateTime = temporalExpression.next(cal).getTime(); } - reminder.set("currentCount", Long.valueOf(currentCount + 1)); + reminder.set("currentCount", (long) (currentCount + 1)); reminder.set("reminderDateTime", new Timestamp(newReminderDateTime.getTime())); reminder.store(); } @@ -1027,7 +1027,7 @@ public class WorkEffortServices { cal.setTime(now); duration.addToCalendar(cal); reminderDateTime = cal.getTime(); - reminder.set("currentCount", Long.valueOf(currentCount + 1)); + reminder.set("currentCount", (long) (currentCount + 1)); reminder.set("reminderDateTime", new Timestamp(reminderDateTime.getTime())); reminder.store(); } diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/conversion/BooleanConverters.java b/framework/base/src/main/java/org/apache/ofbiz/base/conversion/BooleanConverters.java index c4ccc4088c..ba2c15f1b2 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/conversion/BooleanConverters.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/conversion/BooleanConverters.java @@ -28,7 +28,7 @@ public class BooleanConverters implements ConverterLoader { } public Integer convert(Boolean obj) throws ConversionException { - return obj.booleanValue() ? 1 : 0; + return obj ? 1 : 0; } } @@ -50,7 +50,7 @@ public class BooleanConverters implements ConverterLoader { } public String convert(Boolean obj) throws ConversionException { - return obj.booleanValue() ? "true" : "false"; + return obj ? "true" : "false"; } } @@ -60,7 +60,7 @@ public class BooleanConverters implements ConverterLoader { } public Boolean convert(Integer obj) throws ConversionException { - return obj.intValue() == 0 ? false : true; + return obj == 0 ? false : true; } } diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/conversion/DateTimeConverters.java b/framework/base/src/main/java/org/apache/ofbiz/base/conversion/DateTimeConverters.java index 318953f54d..d5f0d5c07c 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/conversion/DateTimeConverters.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/conversion/DateTimeConverters.java @@ -194,7 +194,7 @@ public class DateTimeConverters implements ConverterLoader { } public Double convert(TimeDuration obj) throws ConversionException { - return Double.valueOf(TimeDuration.toLong(obj)); + return (double) TimeDuration.toLong(obj); } } @@ -204,7 +204,7 @@ public class DateTimeConverters implements ConverterLoader { } public Float convert(TimeDuration obj) throws ConversionException { - return Float.valueOf(TimeDuration.toLong(obj)); + return (float) TimeDuration.toLong(obj); } } @@ -264,7 +264,7 @@ public class DateTimeConverters implements ConverterLoader { } public Calendar convert(Long obj, Locale locale, TimeZone timeZone) throws ConversionException { - return UtilDateTime.toCalendar(new java.util.Date(obj.longValue()), timeZone, locale); + return UtilDateTime.toCalendar(new java.util.Date(obj), timeZone, locale); } public Calendar convert(Long obj, Locale locale, TimeZone timeZone, String formatString) throws ConversionException { diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/conversion/NumberConverters.java b/framework/base/src/main/java/org/apache/ofbiz/base/conversion/NumberConverters.java index 48c15d84ba..11d0852011 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/conversion/NumberConverters.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/conversion/NumberConverters.java @@ -152,7 +152,7 @@ public class NumberConverters implements ConverterLoader { } public BigDecimal convert(Double obj) throws ConversionException { - return BigDecimal.valueOf(obj.doubleValue()); + return BigDecimal.valueOf(obj); } } @@ -231,7 +231,7 @@ public class NumberConverters implements ConverterLoader { } public BigDecimal convert(Integer obj) throws ConversionException { - return BigDecimal.valueOf(obj.intValue()); + return BigDecimal.valueOf(obj); } } @@ -262,7 +262,7 @@ public class NumberConverters implements ConverterLoader { } public BigDecimal convert(Long obj) throws ConversionException { - return BigDecimal.valueOf(obj.longValue()); + return BigDecimal.valueOf(obj); } } diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/ObjectType.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/ObjectType.java index f67948d9ab..bb2726ccbb 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/ObjectType.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/ObjectType.java @@ -753,13 +753,13 @@ public class ObjectType { Boolean value1Boolean = (Boolean) convertedValue1; Boolean value2Boolean = (Boolean) convertedValue2; if ("equals".equals(operator)) { - if ((value1Boolean.booleanValue() && value2Boolean.booleanValue()) || (!value1Boolean.booleanValue() && !value2Boolean.booleanValue())) { + if ((value1Boolean && value2Boolean) || (!value1Boolean && !value2Boolean)) { result = 0; } else { result = 1; } } else if ("not-equals".equals(operator)) { - if ((!value1Boolean.booleanValue() && value2Boolean.booleanValue()) || (value1Boolean.booleanValue() && !value2Boolean.booleanValue())) { + if ((!value1Boolean && value2Boolean) || (value1Boolean && !value2Boolean)) { result = 0; } else { result = 1; diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilDateTime.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilDateTime.java index d841be6add..8c7bac3013 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilDateTime.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilDateTime.java @@ -127,7 +127,7 @@ public final class UtilDateTime { StringBuilder sb = new StringBuilder(); for (int i = parts.size() - 1; i >= 0 && count > 0; i--) { Double D = parts.get(i); - double d = D.doubleValue(); + double d = D; if (d < 1) { continue; } @@ -225,7 +225,7 @@ public final class UtilDateTime { } public static java.sql.Timestamp getDayEnd(java.sql.Timestamp stamp) { - return getDayEnd(stamp, Long.valueOf(0)); + return getDayEnd(stamp, 0L); } public static java.sql.Timestamp getDayEnd(java.sql.Timestamp stamp, Long daysLater) { @@ -821,7 +821,7 @@ public final class UtilDateTime { } public static Timestamp getDayEnd(Timestamp stamp, TimeZone timeZone, Locale locale) { - return getDayEnd(stamp, Long.valueOf(0), timeZone, locale); + return getDayEnd(stamp, 0L, timeZone, locale); } public static Timestamp getDayEnd(Timestamp stamp, Long daysLater, TimeZone timeZone, Locale locale) { diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilFormatOut.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilFormatOut.java index 37f929d0da..87f881d204 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilFormatOut.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilFormatOut.java @@ -84,10 +84,10 @@ public final class UtilFormatOut { public static Double formatPriceNumber(double price) { try { - return Double.valueOf(priceDecimalFormat.parse(formatPrice(price)).doubleValue()); + return priceDecimalFormat.parse(formatPrice(price)).doubleValue(); } catch (ParseException e) { Debug.logError(e, module); - return Double.valueOf(price); + return price; } } diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilHttp.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilHttp.java index df54a843dd..705e73b74d 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilHttp.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilHttp.java @@ -125,7 +125,7 @@ public final class UtilHttp { * @return The resulting Map */ public static Map getParameterMap(HttpServletRequest request, Set nameSet, Boolean onlyIncludeOrSkip) { - boolean onlyIncludeOrSkipPrim = onlyIncludeOrSkip == null ? true : onlyIncludeOrSkip.booleanValue(); + boolean onlyIncludeOrSkipPrim = onlyIncludeOrSkip == null ? true : onlyIncludeOrSkip; Map paramMap = new HashMap<>(); // add all the actual HTTP request parameters @@ -191,7 +191,7 @@ public final class UtilHttp { } public static Map getPathInfoOnlyParameterMap(String pathInfoStr, Set nameSet, Boolean onlyIncludeOrSkip) { - boolean onlyIncludeOrSkipPrim = onlyIncludeOrSkip == null ? true : onlyIncludeOrSkip.booleanValue(); + boolean onlyIncludeOrSkipPrim = onlyIncludeOrSkip == null ? true : onlyIncludeOrSkip; Map paramMap = new HashMap<>(); // now add in all path info parameters /~name1=value1/~name2=value2/ @@ -1389,7 +1389,7 @@ public final class UtilHttp { HttpSession session = request.getSession(); Boolean javaScriptEnabled = (Boolean) session.getAttribute("javaScriptEnabled"); if (javaScriptEnabled != null) { - return javaScriptEnabled.booleanValue(); + return javaScriptEnabled; } return false; } @@ -1470,10 +1470,10 @@ public final class UtilHttp { public static String getNextUniqueId(HttpServletRequest request) { Integer uniqueIdNumber= (Integer)request.getAttribute("UNIQUE_ID"); if (uniqueIdNumber == null) { - uniqueIdNumber = Integer.valueOf(1); + uniqueIdNumber = 1; } - request.setAttribute("UNIQUE_ID", Integer.valueOf(uniqueIdNumber.intValue() + 1)); + request.setAttribute("UNIQUE_ID", uniqueIdNumber + 1); return "autoId_" + uniqueIdNumber; } diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilMisc.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilMisc.java index 485dec86f0..4ba5d32880 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilMisc.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilMisc.java @@ -243,9 +243,9 @@ public final class UtilMisc { } else if (currentNumberObj instanceof BigDecimal) { currentNumber = (BigDecimal) currentNumberObj; } else if (currentNumberObj instanceof Double) { - currentNumber = new BigDecimal(((Double) currentNumberObj).doubleValue()); + currentNumber = new BigDecimal((Double) currentNumberObj); } else if (currentNumberObj instanceof Long) { - currentNumber = new BigDecimal(((Long) currentNumberObj).longValue()); + currentNumber = new BigDecimal((Long) currentNumberObj); } else { throw new IllegalArgumentException("In addToBigDecimalInMap found a Map value of a type not supported: " + currentNumberObj.getClass().getName()); } @@ -416,7 +416,7 @@ public final class UtilMisc { */ public static double toDouble(Object obj) { Double result = toDoubleObject(obj); - return result == null ? 0.0 : result.doubleValue(); + return result == null ? 0.0 : result; } /** Converts an Object to a Double. Returns @@ -432,7 +432,7 @@ public final class UtilMisc { return (Double) obj; } if (obj instanceof Number) { - return Double.valueOf(((Number) obj).doubleValue()); + return ((Number) obj).doubleValue(); } Double result = null; try { @@ -448,7 +448,7 @@ public final class UtilMisc { */ public static int toInteger(Object obj) { Integer result = toIntegerObject(obj); - return result == null ? 0 : result.intValue(); + return result == null ? 0 : result; } /** Converts an Object to an Integer. Returns @@ -480,7 +480,7 @@ public final class UtilMisc { */ public static long toLong(Object obj) { Long result = toLongObject(obj); - return result == null ? 0 : result.longValue(); + return result == null ? 0 : result; } /** Converts an Object to a Long. Returns @@ -496,7 +496,7 @@ public final class UtilMisc { return (Long) obj; } if (obj instanceof Number) { - return Long.valueOf(((Number) obj).longValue()); + return ((Number) obj).longValue(); } Long result = null; try { diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/string/UelUtil.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/string/UelUtil.java index 46cb9cb033..4322a632b2 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/string/UelUtil.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/string/UelUtil.java @@ -543,11 +543,11 @@ public final class UelUtil { } else if ("boolean".equals(createObjectType)) { return Boolean.FALSE; } else if ("integer".equals(createObjectType)) { - return Integer.valueOf(0); + return 0; } else if ("long".equals(createObjectType)) { - return Long.valueOf(0); + return 0L; } else if ("double".equals(createObjectType)) { - return Double.valueOf(0); + return (double) 0; } else if ("bigDecimal".equals(createObjectType)) { return BigDecimal.ZERO; } diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/test/UtilObjectTests.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/test/UtilObjectTests.java index a755798649..f4425fcda1 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/test/UtilObjectTests.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/test/UtilObjectTests.java @@ -209,7 +209,7 @@ public class UtilObjectTests extends GenericTestCaseBase { } public void testGetBytes_Object() { - assertNotNull("long", UtilObject.getBytes(Long.valueOf(0))); + assertNotNull("long", UtilObject.getBytes(0L)); assertNotNull("injector good", UtilObject.getBytes(new SerializationInjector(false, false))); boolean errorOn = Debug.isOn(Debug.ERROR); try { @@ -222,7 +222,7 @@ public class UtilObjectTests extends GenericTestCaseBase { } public void testGetObject() { - Long one = Long.valueOf(1); + Long one = 1L; byte[] oneBytes = UtilObject.getBytes(one); assertNotNull("oneBytes", oneBytes); assertEquals("one getObject", one, UtilObject.getObject(oneBytes)); @@ -249,7 +249,7 @@ public class UtilObjectTests extends GenericTestCaseBase { } public void testGetByteCount() throws Exception { - assertNotSame("long", 0, UtilObject.getByteCount(Long.valueOf(0))); + assertNotSame("long", 0, UtilObject.getByteCount(0L)); Exception caught = null; try { UtilObject.getByteCount(this); @@ -271,8 +271,8 @@ public class UtilObjectTests extends GenericTestCaseBase { } public void testCompareToHelper() { - Long one = Long.valueOf(1); - Long two = Long.valueOf(2); + Long one = 1L; + Long two = 2L; assertComparison("one <-> two", -1, UtilObject.compareToHelper(one, two)); assertComparison("one <-> one", 0, UtilObject.compareToHelper(one, one)); assertComparison("two <-> one", 1, UtilObject.compareToHelper(two, one)); diff --git a/framework/common/src/main/java/org/apache/ofbiz/common/CommonServices.java b/framework/common/src/main/java/org/apache/ofbiz/common/CommonServices.java index 861ddd0bee..83af117dae 100644 --- a/framework/common/src/main/java/org/apache/ofbiz/common/CommonServices.java +++ b/framework/common/src/main/java/org/apache/ofbiz/common/CommonServices.java @@ -304,7 +304,7 @@ public class CommonServices { public static Map makeALotOfVisits(DispatchContext dctx, Map context) { Delegator delegator = dctx.getDelegator(); - int count = ((Integer) context.get("count")).intValue(); + int count = (Integer) context.get("count"); for (int i = 0; i < count; i++) { GenericValue v = delegator.makeValue("Visit"); diff --git a/framework/common/src/main/java/org/apache/ofbiz/common/FindServices.java b/framework/common/src/main/java/org/apache/ofbiz/common/FindServices.java index 62cf87caf9..5fd652695f 100644 --- a/framework/common/src/main/java/org/apache/ofbiz/common/FindServices.java +++ b/framework/common/src/main/java/org/apache/ofbiz/common/FindServices.java @@ -464,18 +464,18 @@ public class FindServices { public static Map performFindList(DispatchContext dctx, Map context) { Integer viewSize = (Integer) context.get("viewSize"); if (viewSize == null) { - viewSize = Integer.valueOf(20); // default + viewSize = 20; // default } context.put("viewSize", viewSize); Integer viewIndex = (Integer) context.get("viewIndex"); if (viewIndex == null) { - viewIndex = Integer.valueOf(0); // default + viewIndex = 0; // default } context.put("viewIndex", viewIndex); Map result = performFind(dctx,context); - int start = viewIndex.intValue() * viewSize.intValue(); + int start = viewIndex * viewSize; List list = null; Integer listSize = 0; try (EntityListIterator it = (EntityListIterator) result.get("listIt")) { diff --git a/framework/common/src/main/java/org/apache/ofbiz/common/FtpServices.java b/framework/common/src/main/java/org/apache/ofbiz/common/FtpServices.java index 817e5fbe39..e594296700 100644 --- a/framework/common/src/main/java/org/apache/ofbiz/common/FtpServices.java +++ b/framework/common/src/main/java/org/apache/ofbiz/common/FtpServices.java @@ -64,8 +64,8 @@ public class FtpServices { try { Integer defaultTimeout = (Integer) context.get("defaultTimeout"); if (UtilValidate.isNotEmpty(defaultTimeout)) { - Debug.logInfo("[putFile] set default timeout to: " + defaultTimeout.intValue() + " milliseconds", module); - ftp.setDefaultTimeout(defaultTimeout.intValue()); + Debug.logInfo("[putFile] set default timeout to: " + defaultTimeout + " milliseconds", module); + ftp.setDefaultTimeout(defaultTimeout); } Debug.logInfo("[putFile] connecting to: " + (String) context.get("hostname"), module); ftp.connect((String) context.get("hostname")); @@ -81,12 +81,12 @@ public class FtpServices { errorList.add(UtilProperties.getMessage(resource, "CommonFtpLoginFailure", UtilMisc.toMap("username", username, "password", password), locale)); } else { Boolean binaryTransfer = (Boolean) context.get("binaryTransfer"); - boolean binary = (binaryTransfer == null) ? false : binaryTransfer.booleanValue(); + boolean binary = (binaryTransfer == null) ? false : binaryTransfer; if (binary) { ftp.setFileType(FTP.BINARY_FILE_TYPE); } Boolean passiveMode = (Boolean) context.get("passiveMode"); - boolean passive = (passiveMode == null) ? true : passiveMode.booleanValue(); + boolean passive = (passiveMode == null) ? true : passiveMode; if (passive) { ftp.enterLocalPassiveMode(); } @@ -149,8 +149,8 @@ public class FtpServices { try { Integer defaultTimeout = (Integer) context.get("defaultTimeout"); if (UtilValidate.isNotEmpty(defaultTimeout)) { - Debug.logInfo("[getFile] Set default timeout to: " + defaultTimeout.intValue() + " milliseconds", module); - ftp.setDefaultTimeout(defaultTimeout.intValue()); + Debug.logInfo("[getFile] Set default timeout to: " + defaultTimeout + " milliseconds", module); + ftp.setDefaultTimeout(defaultTimeout); } ftp.connect((String) context.get("hostname")); if (!FTPReply.isPositiveCompletion(ftp.getReplyCode())) { @@ -162,12 +162,12 @@ public class FtpServices { errorList.add(UtilProperties.getMessage(resource, "CommonFtpLoginFailure", UtilMisc.toMap("username", username, "password", password), locale)); } else { Boolean binaryTransfer = (Boolean) context.get("binaryTransfer"); - boolean binary = (binaryTransfer == null) ? false : binaryTransfer.booleanValue(); + boolean binary = (binaryTransfer == null) ? false : binaryTransfer; if (binary) { ftp.setFileType(FTP.BINARY_FILE_TYPE); } Boolean passiveMode = (Boolean) context.get("passiveMode"); - boolean passive = (passiveMode == null) ? false : passiveMode.booleanValue(); + boolean passive = (passiveMode == null) ? false : passiveMode; if (passive) { ftp.enterLocalPassiveMode(); } diff --git a/framework/common/src/main/java/org/apache/ofbiz/common/KeywordSearchUtil.java b/framework/common/src/main/java/org/apache/ofbiz/common/KeywordSearchUtil.java index dd00519828..79af7af565 100644 --- a/framework/common/src/main/java/org/apache/ofbiz/common/KeywordSearchUtil.java +++ b/framework/common/src/main/java/org/apache/ofbiz/common/KeywordSearchUtil.java @@ -169,9 +169,9 @@ public final class KeywordSearchUtil { // group by word, add up weight Long curWeight = keywords.get(token); if (curWeight == null) { - keywords.put(token, Long.valueOf(1)); + keywords.put(token, 1L); } else { - keywords.put(token, Long.valueOf(curWeight.longValue() + 1)); + keywords.put(token, curWeight + 1); } } } diff --git a/framework/common/src/main/java/org/apache/ofbiz/common/login/LdapAuthenticationServices.java b/framework/common/src/main/java/org/apache/ofbiz/common/login/LdapAuthenticationServices.java index 1d38873c71..aadc1a60f3 100644 --- a/framework/common/src/main/java/org/apache/ofbiz/common/login/LdapAuthenticationServices.java +++ b/framework/common/src/main/java/org/apache/ofbiz/common/login/LdapAuthenticationServices.java @@ -60,7 +60,7 @@ public class LdapAuthenticationServices { } String dn = null; Delegator delegator = ctx.getDelegator(); - boolean isServiceAuth = context.get("isServiceAuth") != null && ((Boolean) context.get("isServiceAuth")).booleanValue(); + boolean isServiceAuth = context.get("isServiceAuth") != null && (Boolean) context.get("isServiceAuth"); GenericValue userLogin = null; try { userLogin = EntityQuery.use(delegator).from("UserLogin").where("userLoginId", username).cache(isServiceAuth).queryOne(); diff --git a/framework/common/src/main/java/org/apache/ofbiz/common/login/LoginServices.java b/framework/common/src/main/java/org/apache/ofbiz/common/login/LoginServices.java index 05ff005fed..b399d1446c 100644 --- a/framework/common/src/main/java/org/apache/ofbiz/common/login/LoginServices.java +++ b/framework/common/src/main/java/org/apache/ofbiz/common/login/LoginServices.java @@ -99,7 +99,7 @@ public class LoginServices { boolean useEncryption = "true".equals(EntityUtilProperties.getPropertyValue("security", "password.encrypt", delegator)); // if isServiceAuth is not specified, default to not a service auth - boolean isServiceAuth = context.get("isServiceAuth") != null && ((Boolean) context.get("isServiceAuth")).booleanValue(); + boolean isServiceAuth = context.get("isServiceAuth") != null && (Boolean) context.get("isServiceAuth"); String username = (String) context.get("login.username"); if (username == null) { @@ -234,8 +234,8 @@ public class LoginServices { // reset failed login count if necessary Long currentFailedLogins = userLogin.getLong("successiveFailedLogins"); - if (currentFailedLogins != null && currentFailedLogins.longValue() > 0) { - userLogin.set("successiveFailedLogins", Long.valueOf(0)); + if (currentFailedLogins != null && currentFailedLogins > 0) { + userLogin.set("successiveFailedLogins", 0L); } else if (!hasLoggedOut) { // successful login & no logout flag, no need to change anything, so don't do the store doStore = false; @@ -273,9 +273,9 @@ public class LoginServices { Long currentFailedLogins = userLogin.getLong("successiveFailedLogins"); if (currentFailedLogins == null) { - currentFailedLogins = Long.valueOf(1); + currentFailedLogins = 1L; } else { - currentFailedLogins = Long.valueOf(currentFailedLogins.longValue() + 1); + currentFailedLogins = currentFailedLogins + 1; } userLogin.set("successiveFailedLogins", currentFailedLogins); @@ -289,7 +289,7 @@ public class LoginServices { Debug.logWarning("Could not parse max.failed.logins from security.properties, using default of 3", module); } - if (maxFailedLogins > 0 && currentFailedLogins.longValue() >= maxFailedLogins) { + if (maxFailedLogins > 0 && currentFailedLogins >= maxFailedLogins) { userLogin.set("enabled", "N"); userLogin.set("disabledDateTime", UtilDateTime.nowTimestamp()); } @@ -439,7 +439,7 @@ public class LoginServices { public static void createUserLoginPasswordHistory(Delegator delegator,String userLoginId, String currentPassword) throws GenericEntityException{ int passwordChangeHistoryLimit = 0; try { - passwordChangeHistoryLimit = EntityUtilProperties.getPropertyAsInteger("security", "password.change.history.limit", 0).intValue(); + passwordChangeHistoryLimit = EntityUtilProperties.getPropertyAsInteger("security", "password.change.history.limit", 0); } catch (NumberFormatException nfe) { //No valid value is found so don't bother to save any password history passwordChangeHistoryLimit = 0; @@ -946,7 +946,7 @@ public class LoginServices { int passwordChangeHistoryLimit = 0; try { - passwordChangeHistoryLimit = EntityUtilProperties.getPropertyAsInteger("security", "password.change.history.limit", 0).intValue(); + passwordChangeHistoryLimit = EntityUtilProperties.getPropertyAsInteger("security", "password.change.history.limit", 0); } catch (NumberFormatException nfe) { //No valid value is found so don't bother to save any password history passwordChangeHistoryLimit = 0; @@ -979,7 +979,7 @@ public class LoginServices { int minPasswordLength = 0; try { - minPasswordLength = EntityUtilProperties.getPropertyAsInteger("security", "password.length.min", 0).intValue(); + minPasswordLength = EntityUtilProperties.getPropertyAsInteger("security", "password.length.min", 0); } catch (NumberFormatException nfe) { minPasswordLength = 0; } diff --git a/framework/common/src/main/java/org/apache/ofbiz/common/qrcode/QRCodeEvents.java b/framework/common/src/main/java/org/apache/ofbiz/common/qrcode/QRCodeEvents.java index ae9c53d527..5f44768455 100644 --- a/framework/common/src/main/java/org/apache/ofbiz/common/qrcode/QRCodeEvents.java +++ b/framework/common/src/main/java/org/apache/ofbiz/common/qrcode/QRCodeEvents.java @@ -111,7 +111,7 @@ public class QRCodeEvents { if (UtilValidate.isNotEmpty(encoding)) { context.put("encoding", encoding); } - if (UtilValidate.isNotEmpty(verifyOutput) && verifyOutput.booleanValue()) { + if (UtilValidate.isNotEmpty(verifyOutput) && verifyOutput) { context.put("verifyOutput", verifyOutput); } if (UtilValidate.isNotEmpty(logoImageMaxWidth)) { diff --git a/framework/common/src/main/java/org/apache/ofbiz/common/qrcode/QRCodeServices.java b/framework/common/src/main/java/org/apache/ofbiz/common/qrcode/QRCodeServices.java index 0e5427f1d3..cfb1a21cc4 100644 --- a/framework/common/src/main/java/org/apache/ofbiz/common/qrcode/QRCodeServices.java +++ b/framework/common/src/main/java/org/apache/ofbiz/common/qrcode/QRCodeServices.java @@ -124,13 +124,13 @@ public class QRCodeServices { if (width == null) { width = Integer.parseInt(QRCODE_DEFAULT_WIDTH); } - if (width.intValue() < MIN_SIZE || width.intValue() > MAX_SIZE) { + if (width < MIN_SIZE || width > MAX_SIZE) { return ServiceUtil.returnError(UtilProperties.getMessage("QRCodeUiLabels", "SizeOutOfBorderError", new Object[] {"width", String.valueOf(width), String.valueOf(MIN_SIZE), String.valueOf(MAX_SIZE)}, locale)); } if (height == null) { height = Integer.parseInt(QRCODE_DEFAULT_HEIGHT); } - if (height.intValue() < MIN_SIZE || height.intValue() > MAX_SIZE) { + if (height < MIN_SIZE || height > MAX_SIZE) { return ServiceUtil.returnError(UtilProperties.getMessage("QRCodeUiLabels", "SizeOutOfBorderError", new Object[] { "height", String.valueOf(height), String.valueOf(MIN_SIZE), String.valueOf(MAX_SIZE) }, locale)); } @@ -165,7 +165,7 @@ public class QRCodeServices { BufferedImage newBufferedImage = null; if (UtilValidate.isNotEmpty(logoBufferedImage)) { - if (UtilValidate.isNotEmpty(logoImageMaxWidth) && UtilValidate.isNotEmpty(logoImageMaxHeight) && (logoBufferedImage.getWidth() > logoImageMaxWidth.intValue() || logoBufferedImage.getHeight() > logoImageMaxHeight.intValue())) { + if (UtilValidate.isNotEmpty(logoImageMaxWidth) && UtilValidate.isNotEmpty(logoImageMaxHeight) && (logoBufferedImage.getWidth() > logoImageMaxWidth || logoBufferedImage.getHeight() > logoImageMaxHeight)) { Map typeMap = new HashMap<>(); typeMap.put("width", logoImageMaxWidth.toString()); typeMap.put("height", logoImageMaxHeight.toString()); @@ -181,7 +181,7 @@ public class QRCodeServices { graphics.dispose(); } - if (UtilValidate.isNotEmpty(verifyOutput) && verifyOutput.booleanValue()) { + if (UtilValidate.isNotEmpty(verifyOutput) && verifyOutput) { Decoder decoder = new Decoder(); Map decodeHints = new EnumMap<>(DecodeHintType.class); decodeHints.put(DecodeHintType.TRY_HARDER, Boolean.TRUE); diff --git a/framework/datafile/src/main/java/org/apache/ofbiz/datafile/Record.java b/framework/datafile/src/main/java/org/apache/ofbiz/datafile/Record.java index b17dec2aee..019ab26aff 100644 --- a/framework/datafile/src/main/java/org/apache/ofbiz/datafile/Record.java +++ b/framework/datafile/src/main/java/org/apache/ofbiz/datafile/Record.java @@ -163,7 +163,7 @@ public class Record implements Serializable { } if (value != null || setIfNull) { if (value instanceof Boolean) { - value = ((Boolean) value).booleanValue() ? "Y" : "N"; + value = (Boolean) value ? "Y" : "N"; } fields.put(name, value); } @@ -256,7 +256,7 @@ public class Record implements Serializable { double divisor = Math.pow(10.0, decimalPlaces); number = number / divisor; - set(name, Double.valueOf(number)); + set(name, number); } // standard types else if (fieldType.equals("java.lang.String") || fieldType.equals("String")) { if (field.format.equals("EncryptedString")) { @@ -283,11 +283,11 @@ public class Record implements Serializable { } else if (fieldType.equals("java.lang.Double") || fieldType.equals("Double")) { set(name, Double.valueOf(value)); } else if (fieldType.equals("LEShort")) { - set(name, Short.valueOf(readLEShort(value.getBytes(UtilIO.getUtf8())))); + set(name, readLEShort(value.getBytes(UtilIO.getUtf8()))); } else if (fieldType.equals("LEInteger")) { - set(name, Integer.valueOf(readLEInt(value.getBytes(UtilIO.getUtf8())))); + set(name, readLEInt(value.getBytes(UtilIO.getUtf8()))); } else if (fieldType.equals("LELong")) { - set(name, Long.valueOf(readLELong(value.getBytes(UtilIO.getUtf8())))); + set(name, readLELong(value.getBytes(UtilIO.getUtf8()))); } else { throw new IllegalArgumentException("Field type " + fieldType + " not currently supported. Sorry."); } @@ -336,7 +336,7 @@ public class Record implements Serializable { // of decimal places in the formatting string then place it in a Double double decimalPlaces = Double.parseDouble(field.format); double multiplier = Math.pow(10.0, decimalPlaces); - double dnum = multiplier * ((Double) value).doubleValue(); + double dnum = multiplier * (Double) value; long number = Math.round(dnum); str = padFrontZeros(Long.toString(number), field.length); diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/GenericDelegator.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/GenericDelegator.java index ac9b79d8f8..e7a0f4589c 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/GenericDelegator.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/GenericDelegator.java @@ -2338,8 +2338,8 @@ public class GenericDelegator implements Delegator { } try { int seqVal = Integer.parseInt(currentSeqId); - if (highestSeqVal == null || seqVal > highestSeqVal.intValue()) { - highestSeqVal = Integer.valueOf(seqVal); + if (highestSeqVal == null || seqVal > highestSeqVal) { + highestSeqVal = seqVal; } } catch (NumberFormatException e) { Debug.logWarning("Error in make-next-seq-id converting SeqId [" + currentSeqId + "] in field: " + seqFieldName + " from entity: " + value.getEntityName() + " to a number: " + e.toString(), module); @@ -2347,7 +2347,7 @@ public class GenericDelegator implements Delegator { } } - int seqValToUse = (highestSeqVal == null ? 1 : highestSeqVal.intValue() + incrementBy); + int seqValToUse = (highestSeqVal == null ? 1 : highestSeqVal + incrementBy); String newSeqId = sequencedIdPrefix + UtilFormatOut.formatPaddedNumber(seqValToUse, numericPadding); value.set(seqFieldName, newSeqId); diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/GenericEntity.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/GenericEntity.java index 77084743f3..d0221bdac3 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/GenericEntity.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/GenericEntity.java @@ -478,7 +478,7 @@ public class GenericEntity implements Map, LocalizedMap, try { int fieldType = SqlJdbcUtil.getType(type.getJavaType()); if (fieldType != 10) { - value = ((Boolean) value).booleanValue() ? "Y" : "N"; + value = (Boolean) value ? "Y" : "N"; } } catch (GenericNotImplementedException e) { throw new IllegalArgumentException(e.getMessage()); @@ -738,7 +738,7 @@ public class GenericEntity implements Map, LocalizedMap, // this "hack" is needed for now until the Double/BigDecimal issues are all resolved Object value = get(name); if (value instanceof BigDecimal) { - return Double.valueOf(((BigDecimal) value).doubleValue()); + return ((BigDecimal) value).doubleValue(); } return (Double) value; } @@ -748,7 +748,7 @@ public class GenericEntity implements Map, LocalizedMap, // NOTE: for things to generally work properly BigDecimal should really be used as the java-type in the field type def XML files Object value = get(name); if (value instanceof Double) { - return new BigDecimal(((Double) value).doubleValue()); + return new BigDecimal((Double) value); } return (BigDecimal) value; } @@ -967,7 +967,7 @@ public class GenericEntity implements Map, LocalizedMap, } Iterator iter = null; if (pks != null) { - if (pks.booleanValue()) { + if (pks) { iter = this.getModelEntity().getPksIterator(); } else { iter = this.getModelEntity().getNopksIterator(); diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/condition/EntityComparisonOperator.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/condition/EntityComparisonOperator.java index add2016d42..9774da628e 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/condition/EntityComparisonOperator.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/condition/EntityComparisonOperator.java @@ -137,7 +137,7 @@ public abstract class EntityComparisonOperator extends EntityOperator map, L lhs, R rhs) { - return Boolean.valueOf(mapMatches(delegator, map, lhs, rhs)); + return mapMatches(delegator, map, lhs, rhs); } @Override diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/CursorStatement.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/CursorStatement.java index c5322f257b..6db3f17188 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/CursorStatement.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/CursorStatement.java @@ -81,9 +81,9 @@ public class CursorStatement extends AbstractCursorHandler { } else if ("setCursorName".equals(method.getName())) { setCursorName((String) args[0]); } else if ("getFetchSize".equals(method.getName())) { - return Integer.valueOf(getFetchSize()); + return getFetchSize(); } else if ("setFetchSize".equals(method.getName())) { - setFetchSize(((Integer) args[0]).intValue()); + setFetchSize((Integer) args[0]); } return super.invoke(stmt, proxy, method, args); } diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/JdbcValueHandler.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/JdbcValueHandler.java index 9d8b469b55..80ed6a5d97 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/JdbcValueHandler.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/JdbcValueHandler.java @@ -381,7 +381,7 @@ public abstract class JdbcValueHandler { @Override public Boolean getValue(ResultSet rs, int columnIndex) throws SQLException { boolean value = rs.getBoolean(columnIndex); - return rs.wasNull() ? null : Boolean.valueOf(value); + return rs.wasNull() ? null : value; } @Override protected JdbcValueHandler newInstance(int sqlType) { @@ -523,7 +523,7 @@ public abstract class JdbcValueHandler { @Override public Double getValue(ResultSet rs, int columnIndex) throws SQLException { double value = rs.getDouble(columnIndex); - return rs.wasNull() ? null : Double.valueOf(value); + return rs.wasNull() ? null : value; } @Override protected JdbcValueHandler newInstance(int sqlType) { @@ -549,7 +549,7 @@ public abstract class JdbcValueHandler { @Override public Float getValue(ResultSet rs, int columnIndex) throws SQLException { float value = rs.getFloat(columnIndex); - return rs.wasNull() ? null : Float.valueOf(value); + return rs.wasNull() ? null : value; } @Override protected JdbcValueHandler newInstance(int sqlType) { @@ -575,7 +575,7 @@ public abstract class JdbcValueHandler { @Override public Integer getValue(ResultSet rs, int columnIndex) throws SQLException { int value = rs.getInt(columnIndex); - return rs.wasNull() ? null : Integer.valueOf(value); + return rs.wasNull() ? null : value; } @Override protected JdbcValueHandler newInstance(int sqlType) { @@ -601,7 +601,7 @@ public abstract class JdbcValueHandler { @Override public Long getValue(ResultSet rs, int columnIndex) throws SQLException { long value = rs.getLong(columnIndex); - return rs.wasNull() ? null : Long.valueOf(value); + return rs.wasNull() ? null : value; } @Override protected JdbcValueHandler newInstance(int sqlType) { @@ -699,7 +699,7 @@ public abstract class JdbcValueHandler { @Override public Short getValue(ResultSet rs, int columnIndex) throws SQLException { short value = rs.getShort(columnIndex); - return rs.wasNull() ? null : Short.valueOf(value); + return rs.wasNull() ? null : value; } @Override protected JdbcValueHandler newInstance(int sqlType) { diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/SQLProcessor.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/SQLProcessor.java index 4dd4cdcf73..82df48f958 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/SQLProcessor.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/SQLProcessor.java @@ -631,7 +631,7 @@ public class SQLProcessor implements AutoCloseable { */ public void setValue(Integer field) throws SQLException { if (field != null) { - _ps.setInt(_ind, field.intValue()); + _ps.setInt(_ind, field); } else { _ps.setNull(_ind, Types.NUMERIC); } @@ -647,7 +647,7 @@ public class SQLProcessor implements AutoCloseable { */ public void setValue(Long field) throws SQLException { if (field != null) { - _ps.setLong(_ind, field.longValue()); + _ps.setLong(_ind, field); } else { _ps.setNull(_ind, Types.NUMERIC); } @@ -663,7 +663,7 @@ public class SQLProcessor implements AutoCloseable { */ public void setValue(Float field) throws SQLException { if (field != null) { - _ps.setFloat(_ind, field.floatValue()); + _ps.setFloat(_ind, field); } else { _ps.setNull(_ind, Types.NUMERIC); } @@ -679,7 +679,7 @@ public class SQLProcessor implements AutoCloseable { */ public void setValue(Double field) throws SQLException { if (field != null) { - _ps.setDouble(_ind, field.doubleValue()); + _ps.setDouble(_ind, field); } else { _ps.setNull(_ind, Types.NUMERIC); } @@ -711,7 +711,7 @@ public class SQLProcessor implements AutoCloseable { */ public void setValue(Boolean field) throws SQLException { if (field != null) { - _ps.setBoolean(_ind, field.booleanValue()); + _ps.setBoolean(_ind, field); } else { _ps.setNull(_ind, Types.BOOLEAN); } diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/SqlJdbcUtil.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/SqlJdbcUtil.java index 92c5f6a3a7..298743294a 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/SqlJdbcUtil.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/SqlJdbcUtil.java @@ -713,7 +713,7 @@ public final class SqlJdbcUtil { if (rs.wasNull()) { entity.dangerousSetNoCheckButFast(curField, null); } else { - entity.dangerousSetNoCheckButFast(curField, Integer.valueOf(intValue)); + entity.dangerousSetNoCheckButFast(curField, intValue); } break; @@ -722,7 +722,7 @@ public final class SqlJdbcUtil { if (rs.wasNull()) { entity.dangerousSetNoCheckButFast(curField, null); } else { - entity.dangerousSetNoCheckButFast(curField, Long.valueOf(longValue)); + entity.dangerousSetNoCheckButFast(curField, longValue); } break; @@ -731,7 +731,7 @@ public final class SqlJdbcUtil { if (rs.wasNull()) { entity.dangerousSetNoCheckButFast(curField, null); } else { - entity.dangerousSetNoCheckButFast(curField, Float.valueOf(floatValue)); + entity.dangerousSetNoCheckButFast(curField, floatValue); } break; @@ -740,7 +740,7 @@ public final class SqlJdbcUtil { if (rs.wasNull()) { entity.dangerousSetNoCheckButFast(curField, null); } else { - entity.dangerousSetNoCheckButFast(curField, Double.valueOf(doubleValue)); + entity.dangerousSetNoCheckButFast(curField, doubleValue); } break; @@ -758,7 +758,7 @@ public final class SqlJdbcUtil { if (rs.wasNull()) { entity.dangerousSetNoCheckButFast(curField, null); } else { - entity.dangerousSetNoCheckButFast(curField, Boolean.valueOf(booleanValue)); + entity.dangerousSetNoCheckButFast(curField, booleanValue); } break; } @@ -961,7 +961,7 @@ public final class SqlJdbcUtil { if (val == null) { throw new GenericNotImplementedException("Java type " + fieldType + " not currently supported. Sorry."); } - return val.intValue(); + return val; } public static void addValueSingle(StringBuffer buffer, ModelField field, Object value, List params) { diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelViewEntity.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelViewEntity.java index 291079fa8b..6c9c9c442e 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelViewEntity.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelViewEntity.java @@ -464,7 +464,7 @@ public class ModelViewEntity extends ModelEntity { continue; } if (alias.isPk != null) { - isPk = alias.isPk.booleanValue(); + isPk = alias.isPk; } else { isPk = aliasedField.getIsPk(); } @@ -871,7 +871,7 @@ public class ModelViewEntity extends ModelEntity { String primKeyValue = UtilXml.checkEmpty(aliasElement.getAttribute("prim-key")); if (UtilValidate.isNotEmpty(primKeyValue)) { - this.isPk = Boolean.valueOf("true".equals(primKeyValue)); + this.isPk = "true".equals(primKeyValue); } else { this.isPk = null; } @@ -903,7 +903,7 @@ public class ModelViewEntity extends ModelEntity { this.colAlias = UtilXml.checkEmpty(colAlias, ModelUtil.javaNameToDbName(UtilXml.checkEmpty(this.name))); this.isPk = isPk; if (groupBy != null) { - this.groupBy = groupBy.booleanValue(); + this.groupBy = groupBy; } else { this.groupBy = false; } @@ -1141,7 +1141,7 @@ public class ModelViewEntity extends ModelEntity { this.entityAlias = entityAlias; this.relEntityAlias = relEntityAlias; if (relOptional != null) { - this.relOptional = relOptional.booleanValue(); + this.relOptional = relOptional; } else { this.relOptional = false; } diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/test/EntityTestSuite.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/test/EntityTestSuite.java index b5b3a4a227..7809f93ecd 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/test/EntityTestSuite.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/test/EntityTestSuite.java @@ -388,7 +388,7 @@ public class EntityTestSuite extends EntityTestCase { testing.put("testingName", "leaf-#" + node.getString("testingNodeId")); testing.put("description", "level1 leaf"); testing.put("comments", "No-comments"); - testing.put("testingSize", Long.valueOf(10)); + testing.put("testingSize", 10L); testing.put("testingDate", now); newValues.add(testing); @@ -484,15 +484,15 @@ public class EntityTestSuite extends EntityTestCase { testValue = EntityQuery.use(delegator).from("TestingType").where("testingTypeId", "TEST-DISTINCT-1").cache(true).queryOne(); assertNotNull("Found newly created type value", testValue); - delegator.create("Testing", "testingId", "TEST-DISTINCT-1", "testingTypeId", "TEST-DISTINCT-1", "testingSize", Long.valueOf(10), "comments", "No-comments"); - delegator.create("Testing", "testingId", "TEST-DISTINCT-2", "testingTypeId", "TEST-DISTINCT-1", "testingSize", Long.valueOf(10), "comments", "Some-comments"); - delegator.create("Testing", "testingId", "TEST-DISTINCT-3", "testingTypeId", "TEST-DISTINCT-1", "testingSize", Long.valueOf(9), "comments", "No-comments"); - delegator.create("Testing", "testingId", "TEST-DISTINCT-4", "testingTypeId", "TEST-DISTINCT-1", "testingSize", Long.valueOf(11), "comments", "Some-comments"); + delegator.create("Testing", "testingId", "TEST-DISTINCT-1", "testingTypeId", "TEST-DISTINCT-1", "testingSize", 10L, "comments", "No-comments"); + delegator.create("Testing", "testingId", "TEST-DISTINCT-2", "testingTypeId", "TEST-DISTINCT-1", "testingSize", 10L, "comments", "Some-comments"); + delegator.create("Testing", "testingId", "TEST-DISTINCT-3", "testingTypeId", "TEST-DISTINCT-1", "testingSize", 9L, "comments", "No-comments"); + delegator.create("Testing", "testingId", "TEST-DISTINCT-4", "testingTypeId", "TEST-DISTINCT-1", "testingSize", 11L, "comments", "Some-comments"); List testingSize10 = EntityQuery.use(delegator) .select("testingSize", "comments") .from("Testing") - .where("testingSize", Long.valueOf(10), "comments", "No-comments") + .where("testingSize", 10L, "comments", "No-comments") .distinct() .cache() .queryList(); diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/transaction/GenericXaResource.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/transaction/GenericXaResource.java index 4591e9d2bf..bb2f605bc5 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/transaction/GenericXaResource.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/transaction/GenericXaResource.java @@ -159,7 +159,7 @@ public abstract class GenericXaResource extends Thread implements XAResource { * @see javax.transaction.xa.XAResource#getTransactionTimeout() */ public int getTransactionTimeout() throws XAException { - return this.timeout == null ? 0 : this.timeout.intValue(); + return this.timeout == null ? 0 : this.timeout; } /** @@ -167,7 +167,7 @@ public abstract class GenericXaResource extends Thread implements XAResource { * Note: the valus is saved but in the current implementation this is not used. */ public boolean setTransactionTimeout(int seconds) throws XAException { - this.timeout = (seconds == 0 ? null : Integer.valueOf(seconds)); + this.timeout = (seconds == 0 ? null : seconds); return true; } @@ -205,7 +205,7 @@ public abstract class GenericXaResource extends Thread implements XAResource { try { if (timeout != null) { // sleep until the transaction times out - sleep(timeout.intValue() * 1000L); + sleep(timeout * 1000L); if (active) { // get the current status diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityListIterator.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityListIterator.java index 8ba5f082ce..59eb3eabce 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityListIterator.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityListIterator.java @@ -487,7 +487,7 @@ public class EntityListIterator implements AutoCloseable, ListIterator result = ServiceUtil.returnSuccess(); - result.put("records", Integer.valueOf(records)); + result.put("records", records); return result; } @@ -374,7 +374,7 @@ public class EntityDataServices { } // step 5 - repair field sizes - if (fixSizes.booleanValue()) { + if (fixSizes) { Debug.logImportant("Updating column field size changes", module); List fieldsWrongSize = new LinkedList(); dbUtil.checkDb(modelEntities, fieldsWrongSize, messages, true, true, true, true); diff --git a/framework/entityext/src/main/java/org/apache/ofbiz/entityext/eca/EntityEcaCondition.java b/framework/entityext/src/main/java/org/apache/ofbiz/entityext/eca/EntityEcaCondition.java index 3cf8a0acb8..4b58ebb136 100644 --- a/framework/entityext/src/main/java/org/apache/ofbiz/entityext/eca/EntityEcaCondition.java +++ b/framework/entityext/src/main/java/org/apache/ofbiz/entityext/eca/EntityEcaCondition.java @@ -91,7 +91,7 @@ public final class EntityEcaCondition implements java.io.Serializable { } else { conditionReply = (Boolean) conditionServiceResult.get("conditionReply"); } - return conditionReply.booleanValue(); + return conditionReply; } catch (GenericServiceException gse) { throw new GenericEntityException("Error in calling condition service "+conditionService+". "+gse.getMessage()); } @@ -119,7 +119,7 @@ public final class EntityEcaCondition implements java.io.Serializable { } } if (cond != null) { - return cond.booleanValue(); + return cond; } else { return false; } diff --git a/framework/entityext/src/main/java/org/apache/ofbiz/entityext/eca/EntityEcaSetField.java b/framework/entityext/src/main/java/org/apache/ofbiz/entityext/eca/EntityEcaSetField.java index ba2cc1f25c..2deb46e531 100644 --- a/framework/entityext/src/main/java/org/apache/ofbiz/entityext/eca/EntityEcaSetField.java +++ b/framework/entityext/src/main/java/org/apache/ofbiz/entityext/eca/EntityEcaSetField.java @@ -78,7 +78,7 @@ public final class EntityEcaSetField { return s.toLowerCase(); } if ("hash-code".equalsIgnoreCase(format)) { - return Integer.valueOf(s.hashCode()); + return s.hashCode(); } if ("long".equalsIgnoreCase(format)) { return Long.valueOf(s); diff --git a/framework/entityext/src/main/java/org/apache/ofbiz/entityext/permission/EntityPermissionChecker.java b/framework/entityext/src/main/java/org/apache/ofbiz/entityext/permission/EntityPermissionChecker.java index 32b0fe9cb1..3cde15712f 100644 --- a/framework/entityext/src/main/java/org/apache/ofbiz/entityext/permission/EntityPermissionChecker.java +++ b/framework/entityext/src/main/java/org/apache/ofbiz/entityext/permission/EntityPermissionChecker.java @@ -1054,7 +1054,7 @@ public class EntityPermissionChecker { public String dumpAsText() { List fieldNames = UtilMisc.toList("roleFieldName", "auxiliaryFieldName", "statusFieldName"); - Map widths = UtilMisc.toMap("roleFieldName", Integer.valueOf(24), "auxiliaryFieldName", Integer.valueOf(24), "statusFieldName", Integer.valueOf(24)); + Map widths = UtilMisc.toMap("roleFieldName", 24, "auxiliaryFieldName", 24, "statusFieldName", 24); StringBuilder buf = new StringBuilder(); Integer wid = null; @@ -1066,13 +1066,13 @@ public class EntityPermissionChecker { for (String fld: fieldNames) { wid = widths.get(fld); buf.append(fld); - for (int i=0; i < (wid.intValue() - fld.length()); i++) buf.append("^"); + for (int i = 0; i < (wid - fld.length()); i++) buf.append("^"); buf.append(" "); } buf.append("\n"); for (String fld: fieldNames) { wid = widths.get(fld); - for (int i=0; i < wid.intValue(); i++) buf.append("-"); + for (int i = 0; i < wid; i++) buf.append("-"); buf.append(" "); } buf.append("\n"); @@ -1095,7 +1095,7 @@ public class EntityPermissionChecker { } wid = widths.get("roleFieldName"); buf.append(roleTypeId); - for (int i=0; i < (wid.intValue() - roleTypeId.length()); i++) buf.append("^"); + for (int i = 0; i < (wid - roleTypeId.length()); i++) buf.append("^"); buf.append(" "); String auxiliaryFieldValue = contentPurposeOperation.getString(this.auxiliaryFieldName); @@ -1104,7 +1104,7 @@ public class EntityPermissionChecker { } wid = widths.get("auxiliaryFieldName"); buf.append(auxiliaryFieldValue); - for (int i=0; i < (wid.intValue() - auxiliaryFieldValue.length()); i++) buf.append("^"); + for (int i = 0; i < (wid - auxiliaryFieldValue.length()); i++) buf.append("^"); buf.append(" "); String statusId = contentPurposeOperation.getString(this.statusFieldName); diff --git a/framework/entityext/src/main/java/org/apache/ofbiz/entityext/synchronization/EntitySyncContext.java b/framework/entityext/src/main/java/org/apache/ofbiz/entityext/synchronization/EntitySyncContext.java index fe6fc2bebf..01e75f034c 100644 --- a/framework/entityext/src/main/java/org/apache/ofbiz/entityext/synchronization/EntitySyncContext.java +++ b/framework/entityext/src/main/java/org/apache/ofbiz/entityext/synchronization/EntitySyncContext.java @@ -266,7 +266,7 @@ public class EntitySyncContext { long splitMillis = defaultSyncSplitMillis; Long syncSplitMillis = entitySync.getLong("syncSplitMillis"); if (syncSplitMillis != null) { - splitMillis = syncSplitMillis.longValue(); + splitMillis = syncSplitMillis; } return splitMillis; } @@ -275,7 +275,7 @@ public class EntitySyncContext { long splitMillis = defaultOfflineSyncSplitMillis; Long syncSplitMillis = entitySync.getLong("offlineSyncSplitMillis"); if (syncSplitMillis != null) { - splitMillis = syncSplitMillis.longValue(); + splitMillis = syncSplitMillis; } return splitMillis; } @@ -284,7 +284,7 @@ public class EntitySyncContext { long syncEndBufferMillis = defaultSyncEndBufferMillis; Long syncEndBufferMillisLong = entitySync.getLong("syncEndBufferMillis"); if (syncEndBufferMillisLong != null) { - syncEndBufferMillis = syncEndBufferMillisLong.longValue(); + syncEndBufferMillis = syncEndBufferMillisLong; } return syncEndBufferMillis; } @@ -293,7 +293,7 @@ public class EntitySyncContext { long maxRunningNoUpdateMillis = defaultMaxRunningNoUpdateMillis; Long maxRunningNoUpdateMillisLong = entitySync.getLong("maxRunningNoUpdateMillis"); if (maxRunningNoUpdateMillisLong != null) { - maxRunningNoUpdateMillis = maxRunningNoUpdateMillisLong.longValue(); + maxRunningNoUpdateMillis = maxRunningNoUpdateMillisLong; } return maxRunningNoUpdateMillis; } @@ -771,26 +771,26 @@ public class EntitySyncContext { // store result of service call on history with results so far, should run in own tx Map updateHistoryMap = UtilMisc.toMap("entitySyncId", entitySyncId, "startDate", startDate, "lastSuccessfulSynchTime", this.currentRunEndTime, "lastCandidateEndTime", this.getNextRunEndTime(), - "lastSplitStartTime", Long.valueOf(this.splitStartTime)); - updateHistoryMap.put("toCreateInserted", Long.valueOf(toCreateInserted)); - updateHistoryMap.put("toCreateUpdated", Long.valueOf(toCreateUpdated)); - updateHistoryMap.put("toCreateNotUpdated", Long.valueOf(toCreateNotUpdated)); - updateHistoryMap.put("toStoreInserted", Long.valueOf(toStoreInserted)); - updateHistoryMap.put("toStoreUpdated", Long.valueOf(toStoreUpdated)); - updateHistoryMap.put("toStoreNotUpdated", Long.valueOf(toStoreNotUpdated)); - updateHistoryMap.put("toRemoveDeleted", Long.valueOf(toRemoveDeleted)); - updateHistoryMap.put("toRemoveAlreadyDeleted", Long.valueOf(toRemoveAlreadyDeleted)); - updateHistoryMap.put("runningTimeMillis", Long.valueOf(runningTimeMillis)); - updateHistoryMap.put("totalStoreCalls", Long.valueOf(totalStoreCalls)); - updateHistoryMap.put("totalSplits", Long.valueOf(totalSplits)); - updateHistoryMap.put("totalRowsExported", Long.valueOf(totalRowsExported)); - updateHistoryMap.put("totalRowsToCreate", Long.valueOf(totalRowsToCreate)); - updateHistoryMap.put("totalRowsToStore", Long.valueOf(totalRowsToStore)); - updateHistoryMap.put("totalRowsToRemove", Long.valueOf(totalRowsToRemove)); - updateHistoryMap.put("perSplitMinMillis", Long.valueOf(perSplitMinMillis)); - updateHistoryMap.put("perSplitMaxMillis", Long.valueOf(perSplitMaxMillis)); - updateHistoryMap.put("perSplitMinItems", Long.valueOf(perSplitMinItems)); - updateHistoryMap.put("perSplitMaxItems", Long.valueOf(perSplitMaxItems)); + "lastSplitStartTime", this.splitStartTime); + updateHistoryMap.put("toCreateInserted", toCreateInserted); + updateHistoryMap.put("toCreateUpdated", toCreateUpdated); + updateHistoryMap.put("toCreateNotUpdated", toCreateNotUpdated); + updateHistoryMap.put("toStoreInserted", toStoreInserted); + updateHistoryMap.put("toStoreUpdated", toStoreUpdated); + updateHistoryMap.put("toStoreNotUpdated", toStoreNotUpdated); + updateHistoryMap.put("toRemoveDeleted", toRemoveDeleted); + updateHistoryMap.put("toRemoveAlreadyDeleted", toRemoveAlreadyDeleted); + updateHistoryMap.put("runningTimeMillis", runningTimeMillis); + updateHistoryMap.put("totalStoreCalls", totalStoreCalls); + updateHistoryMap.put("totalSplits", totalSplits); + updateHistoryMap.put("totalRowsExported", totalRowsExported); + updateHistoryMap.put("totalRowsToCreate", totalRowsToCreate); + updateHistoryMap.put("totalRowsToStore", totalRowsToStore); + updateHistoryMap.put("totalRowsToRemove", totalRowsToRemove); + updateHistoryMap.put("perSplitMinMillis", perSplitMinMillis); + updateHistoryMap.put("perSplitMaxMillis", perSplitMaxMillis); + updateHistoryMap.put("perSplitMinItems", perSplitMinItems); + updateHistoryMap.put("perSplitMaxItems", perSplitMaxItems); updateHistoryMap.put("userLogin", userLogin); Map updateEsHistRunResult = dispatcher.runSync("updateEntitySyncHistory", updateHistoryMap); @@ -984,14 +984,14 @@ public class EntitySyncContext { this.totalStoreCalls++; - long toCreateInsertedCur = remoteStoreResult.get("toCreateInserted") == null ? 0 : ((Long) remoteStoreResult.get("toCreateInserted")).longValue(); - long toCreateUpdatedCur = remoteStoreResult.get("toCreateUpdated") == null ? 0 : ((Long) remoteStoreResult.get("toCreateUpdated")).longValue(); - long toCreateNotUpdatedCur = remoteStoreResult.get("toCreateNotUpdated") == null ? 0 : ((Long) remoteStoreResult.get("toCreateNotUpdated")).longValue(); - long toStoreInsertedCur = remoteStoreResult.get("toStoreInserted") == null ? 0 : ((Long) remoteStoreResult.get("toStoreInserted")).longValue(); - long toStoreUpdatedCur = remoteStoreResult.get("toStoreUpdated") == null ? 0 : ((Long) remoteStoreResult.get("toStoreUpdated")).longValue(); - long toStoreNotUpdatedCur = remoteStoreResult.get("toStoreNotUpdated") == null ? 0 : ((Long) remoteStoreResult.get("toStoreNotUpdated")).longValue(); - long toRemoveDeletedCur = remoteStoreResult.get("toRemoveDeleted") == null ? 0 : ((Long) remoteStoreResult.get("toRemoveDeleted")).longValue(); - long toRemoveAlreadyDeletedCur = remoteStoreResult.get("toRemoveAlreadyDeleted") == null ? 0 : ((Long) remoteStoreResult.get("toRemoveAlreadyDeleted")).longValue(); + long toCreateInsertedCur = remoteStoreResult.get("toCreateInserted") == null ? 0 : (Long) remoteStoreResult.get("toCreateInserted"); + long toCreateUpdatedCur = remoteStoreResult.get("toCreateUpdated") == null ? 0 : (Long) remoteStoreResult.get("toCreateUpdated"); + long toCreateNotUpdatedCur = remoteStoreResult.get("toCreateNotUpdated") == null ? 0 : (Long) remoteStoreResult.get("toCreateNotUpdated"); + long toStoreInsertedCur = remoteStoreResult.get("toStoreInserted") == null ? 0 : (Long) remoteStoreResult.get("toStoreInserted"); + long toStoreUpdatedCur = remoteStoreResult.get("toStoreUpdated") == null ? 0 : (Long) remoteStoreResult.get("toStoreUpdated"); + long toStoreNotUpdatedCur = remoteStoreResult.get("toStoreNotUpdated") == null ? 0 : (Long) remoteStoreResult.get("toStoreNotUpdated"); + long toRemoveDeletedCur = remoteStoreResult.get("toRemoveDeleted") == null ? 0 : (Long) remoteStoreResult.get("toRemoveDeleted"); + long toRemoveAlreadyDeletedCur = remoteStoreResult.get("toRemoveAlreadyDeleted") == null ? 0 : (Long) remoteStoreResult.get("toRemoveAlreadyDeleted"); this.toCreateInserted += toCreateInsertedCur; this.toCreateUpdated += toCreateUpdatedCur; diff --git a/framework/entityext/src/main/java/org/apache/ofbiz/entityext/synchronization/EntitySyncServices.java b/framework/entityext/src/main/java/org/apache/ofbiz/entityext/synchronization/EntitySyncServices.java index 6b7c90cf22..802a571b87 100644 --- a/framework/entityext/src/main/java/org/apache/ofbiz/entityext/synchronization/EntitySyncServices.java +++ b/framework/entityext/src/main/java/org/apache/ofbiz/entityext/synchronization/EntitySyncServices.java @@ -240,14 +240,14 @@ public class EntitySyncServices { } Map result = ServiceUtil.returnSuccess(); - result.put("toCreateInserted", Long.valueOf(toCreateInserted)); - result.put("toCreateUpdated", Long.valueOf(toCreateUpdated)); - result.put("toCreateNotUpdated", Long.valueOf(toCreateNotUpdated)); - result.put("toStoreInserted", Long.valueOf(toStoreInserted)); - result.put("toStoreUpdated", Long.valueOf(toStoreUpdated)); - result.put("toStoreNotUpdated", Long.valueOf(toStoreNotUpdated)); - result.put("toRemoveDeleted", Long.valueOf(toRemoveDeleted)); - result.put("toRemoveAlreadyDeleted", Long.valueOf(toRemoveAlreadyDeleted)); + result.put("toCreateInserted", toCreateInserted); + result.put("toCreateUpdated", toCreateUpdated); + result.put("toCreateNotUpdated", toCreateNotUpdated); + result.put("toStoreInserted", toStoreInserted); + result.put("toStoreUpdated", toStoreUpdated); + result.put("toStoreNotUpdated", toStoreNotUpdated); + result.put("toRemoveDeleted", toRemoveDeleted); + result.put("toRemoveAlreadyDeleted", toRemoveAlreadyDeleted); if (Debug.infoOn()) Debug.logInfo("Finisching storeEntitySyncData (" + entitySyncId + ") - [" + keysToRemove.size() + "] to remove. Actually removed: " + toRemoveDeleted + " already removed: " + toRemoveAlreadyDeleted, module); return result; } catch (GenericEntityException e) { @@ -609,7 +609,7 @@ public class EntitySyncServices { for (GenericValue entitySyncRemove: entitySyncRemoveList) { Double curKrih = entitySyncRemove.getDouble("keepRemoveInfoHours"); if (curKrih != null) { - double curKrihVal = curKrih.doubleValue(); + double curKrihVal = curKrih; if (curKrihVal > keepRemoveInfoHours) { keepRemoveInfoHours = curKrihVal; } diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/conditional/ValidateMethodCondition.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/conditional/ValidateMethodCondition.java index 38b5baf7b0..41e733af7e 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/conditional/ValidateMethodCondition.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/conditional/ValidateMethodCondition.java @@ -93,7 +93,7 @@ public final class ValidateMethodCondition extends MethodOperation implements Co Class valClass = methodContext.getLoader().loadClass(className); Method valMethod = valClass.getMethod(methodName, paramTypes); Boolean resultBool = (Boolean) valMethod.invoke(null, params); - return resultBool.booleanValue(); + return resultBool; } catch (Exception e) { throw new MiniLangRuntimeException(e, this); } diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/TransactionCommit.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/TransactionCommit.java index 1ced394518..ce369e00f5 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/TransactionCommit.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/TransactionCommit.java @@ -55,7 +55,7 @@ public final class TransactionCommit extends MethodOperation { boolean beganTransaction = false; Boolean beganTransactionBoolean = beganTransactionFma.get(methodContext.getEnvMap()); if (beganTransactionBoolean != null) { - beganTransaction = beganTransactionBoolean.booleanValue(); + beganTransaction = beganTransactionBoolean; } try { TransactionUtil.commit(beganTransaction); diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/TransactionRollback.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/TransactionRollback.java index f9c3b0aea6..6a0ef5b537 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/TransactionRollback.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/TransactionRollback.java @@ -55,7 +55,7 @@ public final class TransactionRollback extends MethodOperation { boolean beganTransaction = false; Boolean beganTransactionBoolean = beganTransactionFma.get(methodContext.getEnvMap()); if (beganTransactionBoolean != null) { - beganTransaction = beganTransactionBoolean.booleanValue(); + beganTransaction = beganTransactionBoolean; } try { TransactionUtil.rollback(beganTransaction, "Explicit rollback in simple-method [" + this.simpleMethod.getShortDescription() + "]", null); diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/envops/ToString.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/envops/ToString.java index c9326a17b7..ee52cde6e9 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/envops/ToString.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/envops/ToString.java @@ -78,7 +78,7 @@ public final class ToString extends MethodOperation { throw new MiniLangRuntimeException("Exception thrown while converting field to a string: " + e.getMessage(), this); } if (this.numericPadding != null) { - value = StringUtil.padNumberString(value.toString(), this.numericPadding.intValue()); + value = StringUtil.padNumberString(value.toString(), this.numericPadding); } fieldFma.put(methodContext.getEnvMap(), value); } diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/otherops/Calculate.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/otherops/Calculate.java index 70815b2847..9d4188d8b8 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/otherops/Calculate.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/otherops/Calculate.java @@ -129,7 +129,7 @@ public final class Calculate extends MethodOperation { String decimalScaleString = decimalScaleFse.expandString(methodContext.getEnvMap()); int decimalScale = 2; if (!decimalScaleString.isEmpty()) { - decimalScale = Integer.valueOf(decimalScaleString).intValue(); + decimalScale = Integer.valueOf(decimalScaleString); } BigDecimal resultValue = BigDecimal.ZERO.setScale(decimalScale, roundingMode); for (Calculate.SubCalc calcop : calcops) { @@ -139,18 +139,18 @@ public final class Calculate extends MethodOperation { Object resultObj = null; switch (type) { case TYPE_DOUBLE: - resultObj = Double.valueOf(resultValue.doubleValue()); + resultObj = resultValue.doubleValue(); break; case TYPE_FLOAT: - resultObj = Float.valueOf(resultValue.floatValue()); + resultObj = resultValue.floatValue(); break; case TYPE_LONG: resultValue = resultValue.setScale(0, roundingMode); - resultObj = Long.valueOf(resultValue.longValue()); + resultObj = resultValue.longValue(); break; case TYPE_INTEGER: resultValue = resultValue.setScale(0, roundingMode); - resultObj = Integer.valueOf(resultValue.intValue()); + resultObj = resultValue.intValue(); break; case TYPE_STRING: // run the decimal-formatting @@ -260,11 +260,11 @@ public final class Calculate extends MethodOperation { Object fieldObj = fieldFma.get(methodContext.getEnvMap()); if (fieldObj != null) { if (fieldObj instanceof Double) { - resultValue = new BigDecimal(((Double) fieldObj).doubleValue()); + resultValue = new BigDecimal((Double) fieldObj); } else if (fieldObj instanceof Long) { - resultValue = BigDecimal.valueOf(((Long) fieldObj).longValue()); + resultValue = BigDecimal.valueOf((Long) fieldObj); } else if (fieldObj instanceof Float) { - resultValue = new BigDecimal(((Float) fieldObj).floatValue()); + resultValue = new BigDecimal((Float) fieldObj); } else if (fieldObj instanceof Integer) { resultValue = BigDecimal.valueOf(((Integer) fieldObj).longValue()); } else if (fieldObj instanceof String) { diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/otherops/Log.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/otherops/Log.java index a85ebb6d57..716aa3e1ee 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/otherops/Log.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/otherops/Log.java @@ -60,7 +60,7 @@ public final class Log extends MethodOperation { MiniLangValidate.handleError("Invalid level attribute", simpleMethod, element); this.level = Debug.INFO; } else { - this.level = levelInt.intValue(); + this.level = levelInt; } } diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/otherops/Trace.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/otherops/Trace.java index 1bcd17b730..7b420fd4c7 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/otherops/Trace.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/otherops/Trace.java @@ -53,7 +53,7 @@ public final class Trace extends MethodOperation { MiniLangValidate.handleError("Invalid level attribute", simpleMethod, element); this.level = Debug.INFO; } else { - this.level = levelInt.intValue(); + this.level = levelInt; } methodOperations = Collections.unmodifiableList(SimpleMethod.readOperations(element, simpleMethod)); } diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/operation/BaseCompare.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/operation/BaseCompare.java index 032a8ddd8c..997878e97c 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/operation/BaseCompare.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/operation/BaseCompare.java @@ -47,7 +47,7 @@ public abstract class BaseCompare extends SimpleMapOperation { public void doCompare(Object value1, Object value2, List messages, Locale locale, ClassLoader loader, boolean value2InlineConstant) { Boolean success = BaseCompare.doRealCompare(value1, value2, this.operator, this.type, this.format, messages, locale, loader, value2InlineConstant); - if (success != null && success.booleanValue() == false) { + if (success != null && success == false) { addMessage(messages, loader, locale); } } diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/operation/ValidateMethod.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/operation/ValidateMethod.java index ada560cece..3c6bc08c3b 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/operation/ValidateMethod.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/operation/ValidateMethod.java @@ -88,7 +88,7 @@ public class ValidateMethod extends SimpleMapOperation { Debug.logError("[ValidateMethod.exec] " + msg, module); return; } - if (!resultBool.booleanValue()) { + if (!resultBool) { addMessage(messages, loader, locale); } } diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/ModelPermission.java b/framework/service/src/main/java/org/apache/ofbiz/service/ModelPermission.java index a29647e101..ef8ed746f5 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/ModelPermission.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/ModelPermission.java @@ -122,6 +122,6 @@ public class ModelPermission implements Serializable { Debug.logError(failMessage, module); return false; } - return ((Boolean) resp.get("hasPermission")).booleanValue(); + return (Boolean) resp.get("hasPermission"); } } diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/ModelService.java b/framework/service/src/main/java/org/apache/ofbiz/service/ModelService.java index 7b26e374df..c144347f00 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/ModelService.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/ModelService.java @@ -804,7 +804,7 @@ public class ModelService extends AbstractMap implements Seriali throw new GeneralException("Unable to run validation method [" + vali.getMethodName() + "] in class [" + vali.getClassName() + "]"); } - return resultBool.booleanValue(); + return resultBool; } /** diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/ServiceDispatcher.java b/framework/service/src/main/java/org/apache/ofbiz/service/ServiceDispatcher.java index 0f95b3e0c8..626885e811 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/ServiceDispatcher.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/ServiceDispatcher.java @@ -936,7 +936,7 @@ public class ServiceDispatcher { if (hasPermission == null) { throw new ServiceAuthException("ERROR: the permission-service [" + origService.permissionServiceName + "] did not return a result. Not running the service [" + origService.name + "]"); } - if (hasPermission.booleanValue()) { + if (hasPermission) { context.putAll(permResp); context = origService.makeValid(context, ModelService.IN_PARAM); } else { diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/ServiceUtil.java b/framework/service/src/main/java/org/apache/ofbiz/service/ServiceUtil.java index 0bc38b8983..119f6438f3 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/ServiceUtil.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/ServiceUtil.java @@ -612,7 +612,7 @@ public final class ServiceUtil { try { job = EntityQuery.use(delegator).from("JobSandbox").where("jobId", jobId).queryOne(); if (job != null) { - job.set("maxRetry", Long.valueOf(0)); + job.set("maxRetry", 0L); job.store(); } } catch (GenericEntityException e) { diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/calendar/RecurrenceInfo.java b/framework/service/src/main/java/org/apache/ofbiz/service/calendar/RecurrenceInfo.java index cac25a6105..025bea1f00 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/calendar/RecurrenceInfo.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/calendar/RecurrenceInfo.java @@ -147,7 +147,7 @@ public class RecurrenceInfo { /** Returns the current count of this recurrence. */ public long getCurrentCount() { if (info.get("recurrenceCount") != null) { - return info.getLong("recurrenceCount").longValue(); + return info.getLong("recurrenceCount"); } return 0; } diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/calendar/RecurrenceRule.java b/framework/service/src/main/java/org/apache/ofbiz/service/calendar/RecurrenceRule.java index 42b71cb106..2d91b3ca06 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/calendar/RecurrenceRule.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/calendar/RecurrenceRule.java @@ -123,7 +123,7 @@ public class RecurrenceRule { if (!checkFreq(freq)) { throw new RecurrenceRuleException("Recurrence FREQUENCY is a required parameter."); } - if (rule.getLong("intervalNumber").longValue() < 1) { + if (rule.getLong("intervalNumber") < 1) { throw new RecurrenceRuleException("Recurrence INTERVAL must be a positive integer."); } @@ -198,7 +198,7 @@ public class RecurrenceRule { */ public long getCount() { if (rule.get("countNumber") != null) { - return rule.getLong("countNumber").longValue(); + return rule.getLong("countNumber"); } return 0; } @@ -253,7 +253,7 @@ public class RecurrenceRule { if (rule.get("intervalNumber") == null) { return 1; } - return rule.getLong("intervalNumber").longValue(); + return rule.getLong("intervalNumber"); } /** @@ -823,8 +823,8 @@ public class RecurrenceRule { GenericValue value = delegator.makeValue("RecurrenceRule"); value.set("frequency", freqStr); - value.set("intervalNumber", Long.valueOf(interval)); - value.set("countNumber", Long.valueOf(count)); + value.set("intervalNumber", (long) interval); + value.set("countNumber", (long) count); if (endTime > 0) { value.set("untilDateTime", new java.sql.Timestamp(endTime)); } diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/eca/ServiceEcaCondition.java b/framework/service/src/main/java/org/apache/ofbiz/service/eca/ServiceEcaCondition.java index 3140dbf74e..ed2a379ad2 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/eca/ServiceEcaCondition.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/eca/ServiceEcaCondition.java @@ -127,7 +127,7 @@ public class ServiceEcaCondition implements java.io.Serializable { } else { conditionReply = (Boolean) conditionServiceResult.get("conditionReply"); } - return conditionReply.booleanValue(); + return conditionReply; } Object lhsValue = null; @@ -185,7 +185,7 @@ public class ServiceEcaCondition implements java.io.Serializable { } } if (cond != null) { - return cond.booleanValue(); + return cond; } else { Debug.logWarning("doRealCompare returned null, returning false", module); return false; diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/eca/ServiceEcaSetField.java b/framework/service/src/main/java/org/apache/ofbiz/service/eca/ServiceEcaSetField.java index 431cacce6d..98576a19e0 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/eca/ServiceEcaSetField.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/eca/ServiceEcaSetField.java @@ -113,7 +113,7 @@ public class ServiceEcaSetField { return s.toLowerCase(Locale.getDefault()); } if ("hash-code".equalsIgnoreCase(format)) { - return Integer.valueOf(s.hashCode()); + return s.hashCode(); } if ("long".equalsIgnoreCase(format)) { return Long.valueOf(s); diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/engine/GenericAsyncEngine.java b/framework/service/src/main/java/org/apache/ofbiz/service/engine/GenericAsyncEngine.java index 7a2bd48281..2b58408bb6 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/engine/GenericAsyncEngine.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/engine/GenericAsyncEngine.java @@ -110,7 +110,7 @@ public abstract class GenericAsyncEngine extends AbstractEngine { jFields.put("statusId", "SERVICE_PENDING"); jFields.put("serviceName", modelService.name); jFields.put("loaderName", localName); - jFields.put("maxRetry", Long.valueOf(modelService.maxRetry)); + jFields.put("maxRetry", (long) modelService.maxRetry); jFields.put("runtimeDataId", dataId); if (UtilValidate.isNotEmpty(authUserLoginId)) { jFields.put("authUserLoginId", authUserLoginId); diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/job/JobManager.java b/framework/service/src/main/java/org/apache/ofbiz/service/job/JobManager.java index b3aadbf5c0..f757a26e9d 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/job/JobManager.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/job/JobManager.java @@ -560,8 +560,8 @@ public final class JobManager { // set the loader name jFields.put("loaderName", delegator.getDelegatorName()); // set the max retry - jFields.put("maxRetry", Long.valueOf(maxRetry)); - jFields.put("currentRetryCount", Long.valueOf(0)); + jFields.put("maxRetry", (long) maxRetry); + jFields.put("currentRetryCount", 0L); // create the value and store GenericValue jobV; try { diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/job/PersistedServiceJob.java b/framework/service/src/main/java/org/apache/ofbiz/service/job/PersistedServiceJob.java index d40be5a5da..228ba8940e 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/job/PersistedServiceJob.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/job/PersistedServiceJob.java @@ -80,10 +80,10 @@ public class PersistedServiceJob extends GenericServiceJob { this.jobValue = jobValue; Timestamp storedDate = jobValue.getTimestamp("runTime"); this.startTime = storedDate.getTime(); - this.maxRetry = jobValue.get("maxRetry") != null ? jobValue.getLong("maxRetry").longValue() : -1; + this.maxRetry = jobValue.get("maxRetry") != null ? jobValue.getLong("maxRetry") : -1; Long retryCount = jobValue.getLong("currentRetryCount"); if (retryCount != null) { - this.currentRetryCount = retryCount.longValue(); + this.currentRetryCount = retryCount; } else { // backward compatibility this.currentRetryCount = getRetries(this.delegator); @@ -161,10 +161,10 @@ public class PersistedServiceJob extends GenericServiceJob { } } if (jobValue.get("maxRecurrenceCount") != null) { - maxRecurrenceCount = jobValue.getLong("maxRecurrenceCount").longValue(); + maxRecurrenceCount = jobValue.getLong("maxRecurrenceCount"); } if (jobValue.get("currentRecurrenceCount") != null) { - currentRecurrenceCount = jobValue.getLong("currentRecurrenceCount").longValue(); + currentRecurrenceCount = jobValue.getLong("currentRecurrenceCount"); } if (maxRecurrenceCount != -1) { currentRecurrenceCount++; @@ -206,9 +206,9 @@ public class PersistedServiceJob extends GenericServiceJob { newJob.set("runByInstanceId", null); newJob.set("runTime", new java.sql.Timestamp(next)); if (isRetryOnFailure) { - newJob.set("currentRetryCount", Long.valueOf(currentRetryCount + 1)); + newJob.set("currentRetryCount", currentRetryCount + 1); } else { - newJob.set("currentRetryCount", Long.valueOf(0)); + newJob.set("currentRetryCount", 0L); } nextRecurrence = next; delegator.createSetNextSeqId(newJob); diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/mail/ServiceMcaCondition.java b/framework/service/src/main/java/org/apache/ofbiz/service/mail/ServiceMcaCondition.java index b80e89f495..c154256c64 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/mail/ServiceMcaCondition.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/mail/ServiceMcaCondition.java @@ -100,7 +100,7 @@ public class ServiceMcaCondition implements java.io.Serializable { if (reply == null) { reply = Boolean.FALSE; } - return reply.booleanValue(); + return reply; } else if (headerName != null) { // compare the header field MimeMessage message = messageWrapper.getMessage(); diff --git a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/LoginWorker.java b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/LoginWorker.java index cb90d3e936..ca3515cfe7 100644 --- a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/LoginWorker.java +++ b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/LoginWorker.java @@ -595,7 +595,7 @@ public class LoginWorker { } catch (GenericServiceException e) { Debug.logError(e, "Error getting user preference", module); } - session.setAttribute("javaScriptEnabled", Boolean.valueOf("Y".equals(javaScriptEnabled))); + session.setAttribute("javaScriptEnabled", "Y".equals(javaScriptEnabled)); //init theme from user preference, clean the current visualTheme value in session and restart the resolution UtilHttp.setVisualTheme(session, null); diff --git a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ProtectViewWorker.java b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ProtectViewWorker.java index 53127e21ac..7eb6651ab6 100644 --- a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ProtectViewWorker.java +++ b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ProtectViewWorker.java @@ -45,7 +45,7 @@ public final class ProtectViewWorker { private static final String resourceWebapp = "WebappUiLabels"; private static final Map hitsByViewAccessed = new ConcurrentHashMap(); private static final Map durationByViewAccessed = new ConcurrentHashMap(); - private static final Long one = new Long(1); + private static final Long one = 1L; private ProtectViewWorker () {} @@ -89,7 +89,7 @@ public final class ProtectViewWorker { if (now < tarpitReleaseDateTime) { String tarpittedMessage = UtilProperties.getMessage(resourceWebapp, "protectedviewevents.tarpitted_message", UtilHttp.getLocale(request)); // reset since now protected by the tarpit duration - hitsByViewAccessed.put(viewNameUserLoginId, new Long(0)); + hitsByViewAccessed.put(viewNameUserLoginId, 0L); return ":_protect_:" + tarpittedMessage; } } diff --git a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/event/CoreEvents.java b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/event/CoreEvents.java index 620e8fb432..e591406dbc 100644 --- a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/event/CoreEvents.java +++ b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/event/CoreEvents.java @@ -126,13 +126,13 @@ public class CoreEvents { // the frequency map Map freqMap = new HashMap(); - freqMap.put("SECONDLY", Integer.valueOf(1)); - freqMap.put("MINUTELY", Integer.valueOf(2)); - freqMap.put("HOURLY", Integer.valueOf(3)); - freqMap.put("DAILY", Integer.valueOf(4)); - freqMap.put("WEEKLY", Integer.valueOf(5)); - freqMap.put("MONTHLY", Integer.valueOf(6)); - freqMap.put("YEARLY", Integer.valueOf(7)); + freqMap.put("SECONDLY", 1); + freqMap.put("MINUTELY", 2); + freqMap.put("HOURLY", 3); + freqMap.put("DAILY", 4); + freqMap.put("WEEKLY", 5); + freqMap.put("MONTHLY", 6); + freqMap.put("YEARLY", 7); // some defaults long startTime = (new Date()).getTime(); @@ -282,7 +282,7 @@ public class CoreEvents { String errMsg = UtilProperties.getMessage(CoreEvents.err_resource, "coreEvents.invalid_format_frequency", locale); errorBuf.append(errMsg); } else { - frequency = freqMap.get(serviceFreq.toUpperCase()).intValue(); + frequency = freqMap.get(serviceFreq.toUpperCase()); } } } @@ -479,7 +479,7 @@ public class CoreEvents { // load the file File file = new File(filePath); if (file.exists()) { - Long longLen = Long.valueOf(file.length()); + Long longLen = file.length(); int length = longLen.intValue(); try { FileInputStream fis = new FileInputStream(file); diff --git a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/event/ServiceEventHandler.java b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/event/ServiceEventHandler.java index 55c8b4a06d..2b57f57a77 100644 --- a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/event/ServiceEventHandler.java +++ b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/event/ServiceEventHandler.java @@ -222,7 +222,7 @@ public class ServiceEventHandler implements EventHandler { } } multiPartMap.put(fieldName, ByteBuffer.wrap(item.get())); - multiPartMap.put("_" + fieldName + "_size", Long.valueOf(item.getSize())); + multiPartMap.put("_" + fieldName + "_size", item.getSize()); multiPartMap.put("_" + fieldName + "_fileName", fileName); multiPartMap.put("_" + fieldName + "_contentType", item.getContentType()); } diff --git a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/ftl/OfbizAmountTransform.java b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/ftl/OfbizAmountTransform.java index 8b8d921c98..3f378d880f 100644 --- a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/ftl/OfbizAmountTransform.java +++ b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/ftl/OfbizAmountTransform.java @@ -71,16 +71,16 @@ public class OfbizAmountTransform implements TemplateTransformModel { // handle nulls better if (o == null) { - o = Double.valueOf(0.00); + o = 0.00; } if (o instanceof NumberModel) { NumberModel s = (NumberModel) o; - return Double.valueOf(s.getAsNumber().doubleValue()); + return s.getAsNumber().doubleValue(); } if (o instanceof SimpleNumber) { SimpleNumber s = (SimpleNumber) o; - return Double.valueOf(s.getAsNumber().doubleValue()); + return s.getAsNumber().doubleValue(); } if (o instanceof SimpleScalar) { SimpleScalar s = (SimpleScalar) o; @@ -88,7 +88,7 @@ public class OfbizAmountTransform implements TemplateTransformModel { } return Double.valueOf(o.toString()); } - return Double.valueOf(0.00); + return 0.00; } public Writer getWriter(final Writer out, Map args) { final StringBuilder buf = new StringBuilder(); @@ -129,7 +129,7 @@ public class OfbizAmountTransform implements TemplateTransformModel { if (format.equals(OfbizAmountTransform.SPELLED_OUT_FORMAT)) { out.write(UtilFormatOut.formatSpelledOutAmount(amount.doubleValue(), localeObj)); } else { - out.write(UtilFormatOut.formatAmount(amount.doubleValue(), localeObj)); + out.write(UtilFormatOut.formatAmount(amount, localeObj)); } } catch (TemplateModelException e) { throw new IOException(e.getMessage()); diff --git a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/stats/ServerHitBin.java b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/stats/ServerHitBin.java index 7a688abfef..d3d3386710 100644 --- a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/stats/ServerHitBin.java +++ b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/stats/ServerHitBin.java @@ -219,10 +219,10 @@ public class ServerHitBin { serverHitBin.set("hitTypeId", ServerHitBin.typeIds[bin.type]); serverHitBin.set("binStartDateTime", new java.sql.Timestamp(bin.startTime)); serverHitBin.set("binEndDateTime", new java.sql.Timestamp(bin.endTime)); - serverHitBin.set("numberHits", Long.valueOf(bin.getNumberHits())); - serverHitBin.set("totalTimeMillis", Long.valueOf(bin.getTotalRunningTime())); - serverHitBin.set("minTimeMillis", Long.valueOf(bin.getMinTime())); - serverHitBin.set("maxTimeMillis", Long.valueOf(bin.getMaxTime())); + serverHitBin.set("numberHits", bin.getNumberHits()); + serverHitBin.set("totalTimeMillis", bin.getTotalRunningTime()); + serverHitBin.set("minTimeMillis", bin.getMinTime()); + serverHitBin.set("maxTimeMillis", bin.getMaxTime()); // get localhost ip address and hostname to store if (VisitHandler.address != null) { serverHitBin.set("serverIpAddress", VisitHandler.address.getHostAddress()); @@ -512,7 +512,7 @@ public class ServerHitBin { } } serverHit.set("contentId", this.id); - serverHit.set("runningTimeMillis", Long.valueOf(runningTime)); + serverHit.set("runningTimeMillis", runningTime); String fullRequestUrl = UtilHttp.getFullRequestUrl(request); diff --git a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/stats/VisitHandler.java b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/stats/VisitHandler.java index aa56bc5429..9661edf880 100644 --- a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/stats/VisitHandler.java +++ b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/stats/VisitHandler.java @@ -81,7 +81,7 @@ public class VisitHandler { if (modelUserLogin.isField("partyId")) { visit.set("partyId", userLogin.get("partyId")); } - visit.set("userCreated", Boolean.valueOf(userCreated)); + visit.set("userCreated", userCreated); // make sure the visitorId is still in place if (visitor != null) { diff --git a/framework/webtools/src/main/java/org/apache/ofbiz/webtools/GenericWebEvent.java b/framework/webtools/src/main/java/org/apache/ofbiz/webtools/GenericWebEvent.java index 31d3b98b66..2db13835f0 100644 --- a/framework/webtools/src/main/java/org/apache/ofbiz/webtools/GenericWebEvent.java +++ b/framework/webtools/src/main/java/org/apache/ofbiz/webtools/GenericWebEvent.java @@ -266,7 +266,7 @@ public class GenericWebEvent { resultBool = Boolean.TRUE; } - if (!resultBool.booleanValue()) { + if (!resultBool) { Field msgField; String message; diff --git a/framework/webtools/src/main/java/org/apache/ofbiz/webtools/UtilCacheEvents.java b/framework/webtools/src/main/java/org/apache/ofbiz/webtools/UtilCacheEvents.java index 59160aa05f..e9a8c2d886 100644 --- a/framework/webtools/src/main/java/org/apache/ofbiz/webtools/UtilCacheEvents.java +++ b/framework/webtools/src/main/java/org/apache/ofbiz/webtools/UtilCacheEvents.java @@ -212,9 +212,9 @@ public final class UtilCacheEvents { if (utilCache != null) { if (maxInMemory != null) - utilCache.setMaxInMemory(maxInMemory.intValue()); + utilCache.setMaxInMemory(maxInMemory); if (expireTime != null) - utilCache.setExpireTime(expireTime.longValue()); + utilCache.setExpireTime(expireTime); if (useSoftReferenceStr != null) { utilCache.setUseSoftReference("true".equals(useSoftReferenceStr)); } diff --git a/framework/webtools/src/main/java/org/apache/ofbiz/webtools/WebToolsServices.java b/framework/webtools/src/main/java/org/apache/ofbiz/webtools/WebToolsServices.java index 3f25c61a80..9c845e5f8b 100644 --- a/framework/webtools/src/main/java/org/apache/ofbiz/webtools/WebToolsServices.java +++ b/framework/webtools/src/main/java/org/apache/ofbiz/webtools/WebToolsServices.java @@ -122,7 +122,7 @@ public class WebToolsServices { Integer txTimeout = (Integer)context.get("txTimeout"); if (txTimeout == null) { - txTimeout = Integer.valueOf(7200); + txTimeout = 7200; } URL url = null; @@ -227,14 +227,14 @@ public class WebToolsServices { Long filePause = (Long)context.get("filePause"); if (txTimeout == null) { - txTimeout = Integer.valueOf(7200); + txTimeout = 7200; } if (filePause == null) { - filePause = Long.valueOf(0); + filePause = 0L; } if (UtilValidate.isNotEmpty(path)) { - long pauseLong = filePause != null ? filePause.longValue() : 0; + long pauseLong = filePause != null ? filePause : 0; File baseDir = new File(path); if (baseDir.isDirectory() && baseDir.canRead()) { @@ -322,7 +322,7 @@ public class WebToolsServices { boolean checkDataOnly = "true".equals(context.get("checkDataOnly")); Locale locale = (Locale) context.get("locale"); Integer txTimeoutInt = (Integer) context.get("txTimeout"); - int txTimeout = txTimeoutInt != null ? txTimeoutInt.intValue() : -1; + int txTimeout = txTimeoutInt != null ? txTimeoutInt : -1; List messages = new LinkedList(); @@ -440,7 +440,7 @@ public class WebToolsServices { Map placeholderValues = UtilGenerics.checkMap(context.get("placeholderValues")); if (txTimeout == null) { - txTimeout = Integer.valueOf(7200); + txTimeout = 7200; } long rowProcessed = 0; @@ -448,7 +448,7 @@ public class WebToolsServices { EntitySaxReader reader = new EntitySaxReader(delegator); reader.setUseTryInsertMethod(onlyInserts); reader.setMaintainTxStamps(maintainTimeStamps); - reader.setTransactionTimeout(txTimeout.intValue()); + reader.setTransactionTimeout(txTimeout); reader.setCreateDummyFks(createDummyFks); reader.setCheckDataOnly(checkDataOnly); reader.setPlaceholderValues(placeholderValues); @@ -470,7 +470,7 @@ public class WebToolsServices { Timestamp fromDate = (Timestamp)context.get("fromDate"); Integer txTimeout = (Integer)context.get("txTimeout"); if (txTimeout == null) { - txTimeout = Integer.valueOf(7200); + txTimeout = 7200; } List results = new LinkedList(); @@ -855,7 +855,7 @@ public class WebToolsServices { ModelEntity modelEntity = reader.getModelEntity(curEntityName); UtilPlist.writePlistFile(modelEntity.createEoModelMap(entityNamePrefix, datasourceName, entityNames, reader), eomodeldFullPath, curEntityName +".plist", true); } - Integer entityNamesSize = new Integer(entityNames.size()); + Integer entityNamesSize = entityNames.size(); return ServiceUtil.returnSuccess(UtilProperties.getMessage(resource, "WebtoolsEomodelExported", UtilMisc.toMap("entityNamesSize", entityNamesSize.toString(), "eomodeldFullPath", eomodeldFullPath), locale)); } catch (UnsupportedEncodingException e) { return ServiceUtil.returnError(UtilProperties.getMessage(resource, "WebtoolsEomodelSavingFileError", UtilMisc.toMap("errorString", e.toString()), locale)); diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/WidgetWorker.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/WidgetWorker.java index ef9c3c25b1..59078eb373 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/WidgetWorker.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/WidgetWorker.java @@ -308,7 +308,7 @@ public final class WidgetWorker { formUniqueId = (String) context.get("formUniqueId"); } if (itemIndex != null) { - return formName + modelForm.getItemIndexSeparator() + itemIndex.intValue() + iterateId + formUniqueId + modelForm.getItemIndexSeparator() + modelFormField.getName(); + return formName + modelForm.getItemIndexSeparator() + itemIndex + iterateId + formUniqueId + modelForm.getItemIndexSeparator() + modelFormField.getName(); } return formName + modelForm.getItemIndexSeparator() + modelFormField.getName(); } @@ -367,14 +367,14 @@ public final class WidgetWorker { if (context != null) { Integer paginateNumberInt= (Integer)context.get("PAGINATOR_NUMBER"); if (paginateNumberInt == null) { - paginateNumberInt = Integer.valueOf(0); + paginateNumberInt = 0; context.put("PAGINATOR_NUMBER", paginateNumberInt); Map globalCtx = UtilGenerics.checkMap(context.get("globalContext")); if (globalCtx != null) { globalCtx.put("PAGINATOR_NUMBER", paginateNumberInt); } } - paginator_number = paginateNumberInt.intValue(); + paginator_number = paginateNumberInt; } return paginator_number; } @@ -388,9 +388,9 @@ public final class WidgetWorker { } else { Integer paginateNumberInt= (Integer)globalCtx.get("PAGINATOR_NUMBER"); if (paginateNumberInt == null) { - paginateNumberInt = Integer.valueOf(0); + paginateNumberInt = 0; } - paginateNumberInt = Integer.valueOf(paginateNumberInt.intValue() + 1); + paginateNumberInt = paginateNumberInt + 1; globalCtx.put("PAGINATOR_NUMBER", paginateNumberInt); context.put("PAGINATOR_NUMBER", paginateNumberInt); } diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/AbstractModelCondition.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/AbstractModelCondition.java index 80fc76e1f3..733f8395d8 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/AbstractModelCondition.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/AbstractModelCondition.java @@ -262,7 +262,7 @@ public abstract class AbstractModelCondition implements Serializable, ModelCondi Debug.logWarning(fullString.toString(), module); throw new IllegalArgumentException(fullString.toString()); } - return resultBool.booleanValue(); + return resultBool; } public FlexibleMapAccessor getFieldAcsr() { @@ -344,7 +344,7 @@ public abstract class AbstractModelCondition implements Serializable, ModelCondi Debug.logWarning(fullString.toString(), module); throw new IllegalArgumentException(fullString.toString()); } - return resultBool.booleanValue(); + return resultBool; } public FlexibleMapAccessor getFieldAcsr() { @@ -622,7 +622,7 @@ public abstract class AbstractModelCondition implements Serializable, ModelCondi } Boolean hasPermission = (Boolean) resp.get("hasPermission"); if (hasPermission != null) { - return hasPermission.booleanValue(); + return hasPermission; } } return false; @@ -712,7 +712,7 @@ public abstract class AbstractModelCondition implements Serializable, ModelCondi Debug.logError(e, "Error in IfValidationMethod " + methodName + " of class " + className + ", defaulting to false ", module); } - return resultBool.booleanValue(); + return resultBool; } public FlexibleStringExpander getClassExdr() { diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/FieldInfo.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/FieldInfo.java index 57fe4df944..805abed259 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/FieldInfo.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/FieldInfo.java @@ -74,31 +74,31 @@ public abstract class FieldInfo { private static Map createFieldTypeMap() { Map fieldTypeByName = new HashMap<>(); - fieldTypeByName.put("display", Integer.valueOf(1)); - fieldTypeByName.put("hyperlink", Integer.valueOf(2)); - fieldTypeByName.put("text", Integer.valueOf(3)); - fieldTypeByName.put("textarea", Integer.valueOf(4)); - fieldTypeByName.put("date-time", Integer.valueOf(5)); - fieldTypeByName.put("drop-down", Integer.valueOf(6)); - fieldTypeByName.put("check", Integer.valueOf(7)); - fieldTypeByName.put("radio", Integer.valueOf(8)); - fieldTypeByName.put("submit", Integer.valueOf(9)); - fieldTypeByName.put("reset", Integer.valueOf(10)); - fieldTypeByName.put("hidden", Integer.valueOf(11)); - fieldTypeByName.put("ignored", Integer.valueOf(12)); - fieldTypeByName.put("text-find", Integer.valueOf(13)); - fieldTypeByName.put("date-find", Integer.valueOf(14)); - fieldTypeByName.put("range-find", Integer.valueOf(15)); - fieldTypeByName.put("lookup", Integer.valueOf(16)); - fieldTypeByName.put("file", Integer.valueOf(17)); - fieldTypeByName.put("password", Integer.valueOf(18)); - fieldTypeByName.put("image", Integer.valueOf(19)); - fieldTypeByName.put("display-entity", Integer.valueOf(20)); - fieldTypeByName.put("container", Integer.valueOf(21)); - fieldTypeByName.put("include-menu", Integer.valueOf(22)); - fieldTypeByName.put("include-form", Integer.valueOf(23)); - fieldTypeByName.put("include-grid", Integer.valueOf(24)); - fieldTypeByName.put("include-screen", Integer.valueOf(25)); + fieldTypeByName.put("display", 1); + fieldTypeByName.put("hyperlink", 2); + fieldTypeByName.put("text", 3); + fieldTypeByName.put("textarea", 4); + fieldTypeByName.put("date-time", 5); + fieldTypeByName.put("drop-down", 6); + fieldTypeByName.put("check", 7); + fieldTypeByName.put("radio", 8); + fieldTypeByName.put("submit", 9); + fieldTypeByName.put("reset", 10); + fieldTypeByName.put("hidden", 11); + fieldTypeByName.put("ignored", 12); + fieldTypeByName.put("text-find", 13); + fieldTypeByName.put("date-find", 14); + fieldTypeByName.put("range-find", 15); + fieldTypeByName.put("lookup", 16); + fieldTypeByName.put("file", 17); + fieldTypeByName.put("password", 18); + fieldTypeByName.put("image", 19); + fieldTypeByName.put("display-entity", 20); + fieldTypeByName.put("container", 21); + fieldTypeByName.put("include-menu", 22); + fieldTypeByName.put("include-form", 23); + fieldTypeByName.put("include-grid", 24); + fieldTypeByName.put("include-screen", 25); return Collections.unmodifiableMap(fieldTypeByName); } diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/IterateSectionWidget.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/IterateSectionWidget.java index 5a819b4927..cc24d62923 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/IterateSectionWidget.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/IterateSectionWidget.java @@ -154,12 +154,12 @@ public class IterateSectionWidget extends ModelScreenWidget { locViewSize = Integer.parseInt(viewSizeString); } catch (NumberFormatException e) { try { - viewIndex = ((Integer) context.get("viewIndex")).intValue(); + viewIndex = (Integer) context.get("viewIndex"); } catch (Exception e2) { viewIndex = 0; } } - context.put("viewIndex", Integer.valueOf(viewIndex)); + context.put("viewIndex", viewIndex); lowIndex = viewIndex * locViewSize; highIndex = (viewIndex + 1) * locViewSize; } else { @@ -187,7 +187,7 @@ public class IterateSectionWidget extends ModelScreenWidget { } else { contextMs.put(entryName, item); } - contextMs.put("itemIndex", Integer.valueOf(itemIndex)); + contextMs.put("itemIndex", itemIndex); if (iterateIndex < listSize) { contextMs.put("iterateId",String.valueOf(entryName+iterateIndex)); @@ -208,7 +208,7 @@ public class IterateSectionWidget extends ModelScreenWidget { Map globalCtx = UtilGenerics.checkMap(context.get("globalContext")); if (globalCtx != null) { lastPageNumber = (Integer)globalCtx.get("PAGINATOR_NUMBER"); - globalCtx.put("PAGINATOR_NUMBER", Integer.valueOf(startPageNumber)); + globalCtx.put("PAGINATOR_NUMBER", startPageNumber); } renderNextPrev(writer, context, listSize, actualPageSize); if (globalCtx != null) { @@ -230,7 +230,7 @@ public class IterateSectionWidget extends ModelScreenWidget { public boolean getPaginate(Map context) { if (!this.paginate.isEmpty() && UtilValidate.isNotEmpty(this.paginate.expandString(context))) { - return Boolean.valueOf(this.paginate.expandString(context)).booleanValue(); + return Boolean.valueOf(this.paginate.expandString(context)); } return true; } @@ -265,14 +265,14 @@ public class IterateSectionWidget extends ModelScreenWidget { int viewIndex = -1; try { - viewIndex = ((Integer) context.get("viewIndex")).intValue(); + viewIndex = (Integer) context.get("viewIndex"); } catch (Exception e) { viewIndex = 0; } int viewSize = -1; try { - viewSize = ((Integer) context.get("viewSize")).intValue(); + viewSize = (Integer) context.get("viewSize"); } catch (Exception e) { viewSize = this.getViewSize(); } @@ -314,7 +314,7 @@ public class IterateSectionWidget extends ModelScreenWidget { } if (listSize > 0) { - Map messageMap = UtilMisc.toMap("lowCount", Integer.valueOf(lowIndex + 1), "highCount", Integer.valueOf(lowIndex + actualPageSize), "total", Integer.valueOf(listSize)); + Map messageMap = UtilMisc.toMap("lowCount", lowIndex + 1, "highCount", lowIndex + actualPageSize, "total", listSize); String commonDisplaying = UtilProperties.getMessage("CommonUiLabels", "CommonDisplaying", messageMap, (Locale) context.get("locale")); writer.append(" ").append(commonDisplaying).append(" \n"); } diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelForm.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelForm.java index 97aa861e82..2d41ead532 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelForm.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelForm.java @@ -1107,7 +1107,7 @@ public abstract class ModelForm extends ModelWidget { public boolean getPaginate(Map context) { String paginate = this.paginate.expandString(context); if (!paginate.isEmpty()) { - return Boolean.valueOf(paginate).booleanValue(); + return Boolean.valueOf(paginate); } return true; } @@ -1314,7 +1314,7 @@ public abstract class ModelForm extends ModelWidget { // retVal should be a Boolean, if not something weird is up... if (retVal instanceof Boolean) { Boolean boolVal = (Boolean) retVal; - if (boolVal.booleanValue()) { + if (boolVal) { styles += altRowStyle.style; } } else { @@ -1351,7 +1351,7 @@ public abstract class ModelForm extends ModelWidget { // retVal should be a Boolean, if not something weird is up... if (retVal instanceof Boolean) { Boolean boolVal = (Boolean) retVal; - condTrue = boolVal.booleanValue(); + condTrue = boolVal; } else { throw new IllegalArgumentException("Return value from target condition eval was not a Boolean: " + retVal.getClass().getName() + " [" + retVal + "] of form " + getName()); diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java index 8bf1b07fba..73f3aeb1b1 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java @@ -234,7 +234,7 @@ public class ModelFormField { Integer itemIndex = (Integer) context.get("itemIndex"); if ("list".equals(modelForm.getType()) || "multi".equals(modelForm.getType())) { if (itemIndex != null) { - return idName + modelForm.getItemIndexSeparator() + itemIndex.intValue(); + return idName + modelForm.getItemIndexSeparator() + itemIndex; } } } @@ -526,7 +526,7 @@ public class ModelFormField { Integer itemIndex = (Integer) context.get("itemIndex"); if (itemIndex != null && "multi".equals(this.modelForm.getType())) { - return baseName + this.modelForm.getItemIndexSeparator() + itemIndex.intValue(); + return baseName + this.modelForm.getItemIndexSeparator() + itemIndex; } return baseName; } @@ -535,7 +535,7 @@ public class ModelFormField { if (this.position == null) { return 1; } - return position.intValue(); + return position; } public String getRedWhen() { @@ -753,7 +753,7 @@ public class ModelFormField { } public boolean isSortField() { - return this.sortField != null && this.sortField.booleanValue(); + return this.sortField != null && this.sortField; } public boolean isUseWhenEmpty() { @@ -897,7 +897,7 @@ public class ModelFormField { // retVal should be a Boolean, if not something weird is up... if (retVal instanceof Boolean) { Boolean boolVal = (Boolean) retVal; - condTrue = boolVal.booleanValue(); + condTrue = boolVal; } else { throw new IllegalArgumentException("Return value from use-when condition eval was not a Boolean: " + (retVal != null ? retVal.getClass().getName() : "null") + " [" + retVal + "] on the field " + this.name @@ -1023,7 +1023,7 @@ public class ModelFormField { public Boolean isAllChecked(Map context) { String allCheckedStr = this.allChecked.expandString(context); if (!allCheckedStr.isEmpty()) { - return Boolean.valueOf("true".equals(allCheckedStr)); + return "true".equals(allCheckedStr); } return null; } @@ -1629,7 +1629,7 @@ public class ModelFormField { Double parsedRetVal = (Double) ObjectType.simpleTypeConvert(retVal, "Double", null, locale, false); String template = UtilProperties.getPropertyValue("arithmetic", "accounting-number.format", "#,##0.00;(#,##0.00)"); - retVal = UtilFormatOut.formatDecimalNumber(parsedRetVal.doubleValue(), template, locale); + retVal = UtilFormatOut.formatDecimalNumber(parsedRetVal, template, locale); } catch (GeneralException e) { String errMsg = "Error formatting number [" + retVal + "]: " + e.toString(); Debug.logError(e, errMsg, module); @@ -1845,7 +1845,7 @@ public class ModelFormField { baseName += "_OTHER"; Integer itemIndex = (Integer) context.get("itemIndex"); if (itemIndex != null && "multi".equals(getModelFormField().modelForm.getType())) { - return baseName + getModelFormField().modelForm.getItemIndexSeparator() + itemIndex.intValue(); + return baseName + getModelFormField().modelForm.getItemIndexSeparator() + itemIndex; } return baseName; } @@ -3774,7 +3774,7 @@ public class ModelFormField { // retVal should be a Boolean, if not something weird is up... if (retVal instanceof Boolean) { Boolean boolVal = (Boolean) retVal; - shouldUse = boolVal.booleanValue(); + shouldUse = boolVal; } else { throw new IllegalArgumentException("Return value from target condition eval was not a Boolean: " + retVal.getClass().getName() + " [" + retVal + "]"); diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormFieldBuilder.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormFieldBuilder.java index 61b8454045..656b99d554 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormFieldBuilder.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormFieldBuilder.java @@ -521,29 +521,29 @@ public class ModelFormFieldBuilder { if ("find".equals(defaultFieldType)) { if ("id".equals(modelField.getType())) { ModelFormField.TextFindField textField = new ModelFormField.TextFindField(FieldInfo.SOURCE_AUTO_ENTITY, 20, - Integer.valueOf(20), null); + 20, null); this.setFieldInfo(textField); } else if ("id-long".equals(modelField.getType())) { ModelFormField.TextFindField textField = new ModelFormField.TextFindField(FieldInfo.SOURCE_AUTO_ENTITY, 40, - Integer.valueOf(60), null); + 60, null); this.setFieldInfo(textField); } else if ("id-vlong".equals(modelField.getType())) { ModelFormField.TextFindField textField = new ModelFormField.TextFindField(FieldInfo.SOURCE_AUTO_ENTITY, 60, - Integer.valueOf(250), null); + 250, null); this.setFieldInfo(textField); } else if ("very-short".equals(modelField.getType())) { ModelFormField.TextField textField = new ModelFormField.TextField(FieldInfo.SOURCE_AUTO_ENTITY, 6, - Integer.valueOf(10), null); + 10, null); this.setFieldInfo(textField); } else if ("name".equals(modelField.getType()) || "short-varchar".equals(modelField.getType())) { ModelFormField.TextFindField textField = new ModelFormField.TextFindField(FieldInfo.SOURCE_AUTO_ENTITY, 40, - Integer.valueOf(60), null); + 60, null); this.setFieldInfo(textField); } else if ("value".equals(modelField.getType()) || "comment".equals(modelField.getType()) || "description".equals(modelField.getType()) || "long-varchar".equals(modelField.getType()) || "url".equals(modelField.getType()) || "email".equals(modelField.getType())) { ModelFormField.TextFindField textField = new ModelFormField.TextFindField(FieldInfo.SOURCE_AUTO_ENTITY, 60, - Integer.valueOf(250), null); + 250, null); this.setFieldInfo(textField); } else if ("floating-point".equals(modelField.getType()) || "currency-amount".equals(modelField.getType()) || "numeric".equals(modelField.getType()) || "fixed-point".equals(modelField.getType()) || "currency-precise".equals(modelField.getType())) { @@ -570,15 +570,15 @@ public class ModelFormFieldBuilder { } else { if ("id".equals(modelField.getType())) { ModelFormField.TextField textField = new ModelFormField.TextField(FieldInfo.SOURCE_AUTO_ENTITY, 20, - Integer.valueOf(20), null); + 20, null); this.setFieldInfo(textField); } else if ("id-long".equals(modelField.getType())) { ModelFormField.TextField textField = new ModelFormField.TextField(FieldInfo.SOURCE_AUTO_ENTITY, 40, - Integer.valueOf(60), null); + 60, null); this.setFieldInfo(textField); } else if ("id-vlong".equals(modelField.getType())) { ModelFormField.TextField textField = new ModelFormField.TextField(FieldInfo.SOURCE_AUTO_ENTITY, 60, - Integer.valueOf(250), null); + 250, null); this.setFieldInfo(textField); } else if ("indicator".equals(modelField.getType())) { List optionSources = new ArrayList<>(); @@ -589,20 +589,20 @@ public class ModelFormFieldBuilder { this.setFieldInfo(dropDownField); } else if ("very-short".equals(modelField.getType())) { ModelFormField.TextField textField = new ModelFormField.TextField(FieldInfo.SOURCE_AUTO_ENTITY, 6, - Integer.valueOf(10), null); + 10, null); this.setFieldInfo(textField); } else if ("very-long".equals(modelField.getType())) { ModelFormField.TextareaField textareaField = new ModelFormField.TextareaField(FieldInfo.SOURCE_AUTO_ENTITY, null); this.setFieldInfo(textareaField); } else if ("name".equals(modelField.getType()) || "short-varchar".equals(modelField.getType())) { ModelFormField.TextField textField = new ModelFormField.TextField(FieldInfo.SOURCE_AUTO_ENTITY, 40, - Integer.valueOf(60), null); + 60, null); this.setFieldInfo(textField); } else if ("value".equals(modelField.getType()) || "comment".equals(modelField.getType()) || "description".equals(modelField.getType()) || "long-varchar".equals(modelField.getType()) || "url".equals(modelField.getType()) || "email".equals(modelField.getType())) { ModelFormField.TextField textField = new ModelFormField.TextField(FieldInfo.SOURCE_AUTO_ENTITY, 60, - Integer.valueOf(250), null); + 250, null); this.setFieldInfo(textField); } else if ("floating-point".equals(modelField.getType()) || "currency-amount".equals(modelField.getType()) || "numeric".equals(modelField.getType())) { diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelMenuItem.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelMenuItem.java index 5d7eb674e6..44b29458a2 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelMenuItem.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelMenuItem.java @@ -410,7 +410,7 @@ public class ModelMenuItem extends ModelWidget { if (this.position == null) { return 1; } - return position.intValue(); + return position; } public String getSelectedStyle() { diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelScreenWidget.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelScreenWidget.java index dd9534aa5e..53debf2fde 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelScreenWidget.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelScreenWidget.java @@ -619,7 +619,7 @@ public abstract class ModelScreenWidget extends ModelWidget { String screenletId = this.getId(context) + "_collapsed"; Map userPreferences = UtilGenerics.checkMap(context.get("userPreferences")); if (userPreferences != null && userPreferences.containsKey(screenletId)) { - return Boolean.valueOf((String)userPreferences.get(screenletId)).booleanValue() ; + return Boolean.valueOf((String) userPreferences.get(screenletId)); } return "true".equals(this.initiallyCollapsed.expand(context)); diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelTree.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelTree.java index 2af7f30e2a..a0510df7ff 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelTree.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelTree.java @@ -488,7 +488,7 @@ public class ModelTree extends ModelWidget { } if (nodeCount == null && modelField != null || this.modelTree.forceChildCheck) { getChildren(context); - nodeCount = Long.valueOf(subNodeValues.size()); + nodeCount = (long) subNodeValues.size(); String pkName = this.getPkName(context); String id = null; if (!this.entryName.isEmpty()) { @@ -510,7 +510,7 @@ public class ModelTree extends ModelWidget { } } else if (nodeCount == null) { getChildren(context); - nodeCount = Long.valueOf(subNodeValues.size()); + nodeCount = (long) subNodeValues.size(); } if (nodeCount != null && nodeCount.intValue() > 0) { hasChildren = true; @@ -584,7 +584,7 @@ public class ModelTree extends ModelWidget { } treeStringRenderer.renderLastElement(writer, context, this); Boolean processChildren = (Boolean) context.get("processChildren"); - if (processChildren.booleanValue()) { + if (processChildren) { List subNodeValues = getChildren(context); int newDepth = depth + 1; for (Object[] arr : subNodeValues) { diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelWidget.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelWidget.java index f628e64d8d..1f1fd6223e 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelWidget.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelWidget.java @@ -63,8 +63,8 @@ public abstract class ModelWidget implements Serializable { protected ModelWidget(Element widgetElement) { this.name = widgetElement.getAttribute("name"); this.systemId = (String) widgetElement.getUserData("systemId"); - this.startColumn = ((Integer) widgetElement.getUserData("startColumn")).intValue(); - this.startLine = ((Integer) widgetElement.getUserData("startLine")).intValue(); + this.startColumn = (Integer) widgetElement.getUserData("startColumn"); + this.startLine = (Integer) widgetElement.getUserData("startLine"); } public abstract void accept(ModelWidgetVisitor visitor) throws Exception; diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelWidgetCondition.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelWidgetCondition.java index 4b351e86a5..81d57c8aae 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelWidgetCondition.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelWidgetCondition.java @@ -241,7 +241,7 @@ public abstract class ModelWidgetCondition implements Serializable { Debug.logWarning(fullString.toString(), module); throw new IllegalArgumentException(fullString.toString()); } - return resultBool.booleanValue(); + return resultBool; } } @@ -298,7 +298,7 @@ public abstract class ModelWidgetCondition implements Serializable { Debug.logWarning(fullString.toString(), module); throw new IllegalArgumentException(fullString.toString()); } - return resultBool.booleanValue(); + return resultBool; } } @@ -506,7 +506,7 @@ public abstract class ModelWidgetCondition implements Serializable { } Boolean hasPermission = (Boolean) resp.get("hasPermission"); if (hasPermission != null) { - return hasPermission.booleanValue(); + return hasPermission; } } return false; @@ -575,7 +575,7 @@ public abstract class ModelWidgetCondition implements Serializable { Debug.logError(e, "Error in IfValidationMethod " + methodName + " of class " + className + ", defaulting to false ", module); } - return resultBool.booleanValue(); + return resultBool; } } diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/FormRenderer.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/FormRenderer.java index c02b769d0e..01e9a4c782 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/FormRenderer.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/FormRenderer.java @@ -81,10 +81,9 @@ public class FormRenderer { Integer itemIndex = (Integer) context.get("itemIndex"); if (itemIndex != null/* && "list".equals(modelForm.getType()) */) { if (UtilValidate.isNotEmpty(context.get("parentItemIndex"))) { - return retVal + context.get("parentItemIndex") + modelForm.getItemIndexSeparator() + itemIndex - .intValue(); + return retVal + context.get("parentItemIndex") + modelForm.getItemIndexSeparator() + itemIndex; } - return retVal + modelForm.getItemIndexSeparator() + itemIndex.intValue(); + return retVal + modelForm.getItemIndexSeparator() + itemIndex; } return retVal; } @@ -96,7 +95,7 @@ public class FormRenderer { formName = modelForm.getName(); } if (itemIndex != null && "list".equals(modelForm.getType())) { - return formName + modelForm.getItemIndexSeparator() + itemIndex.intValue(); + return formName + modelForm.getItemIndexSeparator() + itemIndex; } return formName; } @@ -714,14 +713,14 @@ public class FormRenderer { // set low and high index Paginator.getListLimits(modelForm, context, obj); - int listSize = ((Integer) context.get("listSize")).intValue(); - int lowIndex = ((Integer) context.get("lowIndex")).intValue(); - int highIndex = ((Integer) context.get("highIndex")).intValue(); + int listSize = (Integer) context.get("listSize"); + int lowIndex = (Integer) context.get("lowIndex"); + int highIndex = (Integer) context.get("highIndex"); // we're passed a subset of the list, so use (0, viewSize) range if (modelForm.isOverridenListSize()) { lowIndex = 0; - highIndex = ((Integer) context.get("viewSize")).intValue(); + highIndex = (Integer) context.get("viewSize"); } if (iter != null) { @@ -770,7 +769,7 @@ public class FormRenderer { AbstractModelAction.runSubActions(modelForm.getRowActions(), localContext); - localContext.put("itemIndex", Integer.valueOf(itemIndex - lowIndex)); + localContext.put("itemIndex", itemIndex - lowIndex); if (UtilValidate.isNotEmpty(context.get("renderFormSeqNumber"))) { localContext.put("formUniqueId", "_" + context.get("renderFormSeqNumber")); } @@ -898,9 +897,9 @@ public class FormRenderer { if ((itemIndex + 1) < highIndex) { highIndex = itemIndex + 1; // if list size is overridden, use full listSize - context.put("highIndex", Integer.valueOf(modelForm.isOverridenListSize() ? listSize : highIndex)); + context.put("highIndex", modelForm.isOverridenListSize() ? listSize : highIndex); } - context.put("actualPageSize", Integer.valueOf(highIndex - lowIndex)); + context.put("actualPageSize", highIndex - lowIndex); if (iter instanceof EntityListIterator) { try { @@ -1157,7 +1156,7 @@ public class FormRenderer { if (nextFormField != null) { if (nextFormField.getPosition() > currentFormField.getPosition()) { positionSpan = nextFormField.getPosition() - currentFormField.getPosition() - 1; - nextPositionInRow = Integer.valueOf(nextFormField.getPosition()); + nextPositionInRow = nextFormField.getPosition(); } else { positionSpan = positions - currentFormField.getPosition(); } diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/Paginator.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/Paginator.java index 0a9055b3f2..e20e5684d9 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/Paginator.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/Paginator.java @@ -44,12 +44,12 @@ public final class Paginator { public static int getActualPageSize(Map context) { Integer value = (Integer) context.get("actualPageSize"); - return value != null ? value.intValue() : (getHighIndex(context) - getLowIndex(context)); + return value != null ? value : (getHighIndex(context) - getLowIndex(context)); } public static int getHighIndex(Map context) { Integer value = (Integer) context.get("highIndex"); - return value != null ? value.intValue() : 0; + return value != null ? value : 0; } // entryList might be an EntityListIterator. It will then be closed at the end of FormRenderer.renderItemRows() @@ -92,21 +92,21 @@ public final class Paginator { lowIndex = 0; highIndex = ModelForm.MAX_PAGE_SIZE; } - context.put("listSize", Integer.valueOf(listSize)); - context.put("viewIndex", Integer.valueOf(viewIndex)); - context.put("viewSize", Integer.valueOf(viewSize)); - context.put("lowIndex", Integer.valueOf(lowIndex)); - context.put("highIndex", Integer.valueOf(highIndex)); + context.put("listSize", listSize); + context.put("viewIndex", viewIndex); + context.put("viewSize", viewSize); + context.put("lowIndex", lowIndex); + context.put("highIndex", highIndex); } public static int getListSize(Map context) { Integer value = (Integer) context.get("listSize"); - return value != null ? value.intValue() : 0; + return value != null ? value : 0; } public static int getLowIndex(Map context) { Integer value = (Integer) context.get("lowIndex"); - return value != null ? value.intValue() : 0; + return value != null ? value : 0; } public static int getViewIndex(ModelForm modelForm, Map context) { @@ -131,7 +131,7 @@ public final class Paginator { value = context.get(field); } if (value instanceof Integer) { - viewIndex = ((Integer) value).intValue(); + viewIndex = (Integer) value; } else if (value instanceof String) { viewIndex = Integer.parseInt((String) value); } @@ -163,7 +163,7 @@ public final class Paginator { value = context.get(field); } if (value instanceof Integer) { - viewSize = ((Integer) value).intValue(); + viewSize = (Integer) value; } else if (value instanceof String && UtilValidate.isNotEmpty(value)) { viewSize = Integer.parseInt((String) value); } @@ -200,14 +200,14 @@ public final class Paginator { // set low and high index getListLimits(modelForm, context, obj); - int listSize = ((Integer) context.get("listSize")).intValue(); - int lowIndex = ((Integer) context.get("lowIndex")).intValue(); - int highIndex = ((Integer) context.get("highIndex")).intValue(); + int listSize = (Integer) context.get("listSize"); + int lowIndex = (Integer) context.get("lowIndex"); + int highIndex = (Integer) context.get("highIndex"); // we're passed a subset of the list, so use (0, viewSize) range if (modelForm.isOverridenListSize()) { lowIndex = 0; - highIndex = ((Integer) context.get("viewSize")).intValue(); + highIndex = (Integer) context.get("viewSize"); } if (iter == null) { @@ -226,9 +226,9 @@ public final class Paginator { if ((itemIndex + 1) < highIndex) { highIndex = itemIndex + 1; // if list size is overridden, use full listSize - context.put("highIndex", Integer.valueOf(modelForm.isOverridenListSize() ? listSize : highIndex)); + context.put("highIndex", modelForm.isOverridenListSize() ? listSize : highIndex); } - context.put("actualPageSize", Integer.valueOf(highIndex - lowIndex)); + context.put("actualPageSize", highIndex - lowIndex); if (iter instanceof EntityListIterator) { // The EntityListIterator will be closed at the end of FormRenderer.renderItemRows() diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/ScreenRenderer.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/ScreenRenderer.java index c08107f416..65a2683490 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/ScreenRenderer.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/ScreenRenderer.java @@ -247,7 +247,7 @@ public class ScreenRenderer { context.put("https", https); } } - context.put("javaScriptEnabled", Boolean.valueOf(UtilHttp.isJavaScriptEnabled(request))); + context.put("javaScriptEnabled", UtilHttp.isJavaScriptEnabled(request)); // these ones are FreeMarker specific and will only work in FTL templates, mainly here for backward compatibility context.put("sessionAttributes", new HttpSessionHashModel(session, FreeMarkerWorker.getDefaultOfbizWrapper())); diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/html/HtmlMenuRenderer.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/html/HtmlMenuRenderer.java index 17c82c26f0..08204fbb48 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/html/HtmlMenuRenderer.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/html/HtmlMenuRenderer.java @@ -303,7 +303,7 @@ public class HtmlMenuRenderer extends HtmlWidgetRenderer implements MenuStringRe String currentMenuItemName = menu.getSelectedMenuItemContextFieldName(context); String currentItemName = menuItem.getName(); Boolean hideIfSelected = menuItem.getHideIfSelected(); - return (hideIfSelected != null && hideIfSelected.booleanValue() && currentMenuItemName != null && currentMenuItemName.equals(currentItemName)); + return (hideIfSelected != null && hideIfSelected && currentMenuItemName != null && currentMenuItemName.equals(currentItemName)); } diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/html/HtmlMenuWrapper.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/html/HtmlMenuWrapper.java index 8a7794803e..b4db5c1965 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/html/HtmlMenuWrapper.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/html/HtmlMenuWrapper.java @@ -133,7 +133,7 @@ public class HtmlMenuWrapper { * parameters Map instead of the value Map. */ public void setIsError(boolean isError) { - this.context.put("isError", Boolean.valueOf(isError)); + this.context.put("isError", isError); } public boolean getIsError() { @@ -141,7 +141,7 @@ public class HtmlMenuWrapper { if (isErrorBoolean == null) { return false; } else { - return isErrorBoolean.booleanValue(); + return isErrorBoolean; } } diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/html/HtmlTreeRenderer.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/html/HtmlTreeRenderer.java index 701fff98d5..fefdad36bf 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/html/HtmlTreeRenderer.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/html/HtmlTreeRenderer.java @@ -133,7 +133,7 @@ public class HtmlTreeRenderer extends HtmlWidgetRenderer implements TreeStringRe public void renderNodeEnd(Appendable writer, Map context, ModelTree.ModelNode node) throws IOException { Boolean processChildren = (Boolean) context.get("processChildren"); - if (processChildren.booleanValue()) { + if (processChildren) { appendWhitespace(writer); writer.append(""); } @@ -149,7 +149,7 @@ public class HtmlTreeRenderer extends HtmlWidgetRenderer implements TreeStringRe public void renderLastElement(Appendable writer, Map context, ModelTree.ModelNode node) throws IOException { Boolean processChildren = (Boolean) context.get("processChildren"); - if (processChildren.booleanValue()) { + if (processChildren) { appendWhitespace(writer); writer.append("
    "); } diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroFormRenderer.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroFormRenderer.java index 80958a067c..ad49ebd42e 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroFormRenderer.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroFormRenderer.java @@ -779,7 +779,7 @@ public final class MacroFormRenderer implements FormStringRenderer { ModelFormField.AutoComplete autoComplete = dropDownField.getAutoComplete(); String event = modelFormField.getEvent(); String action = modelFormField.getAction(context); - Integer textSize = Integer.valueOf(0); + Integer textSize = 0; if (UtilValidate.isNotEmpty(dropDownField.getTextSize())) { try { textSize = Integer.parseInt(dropDownField.getTextSize()); @@ -1654,7 +1654,7 @@ public final class MacroFormRenderer implements FormStringRenderer { String oddRowStyle = ""; if (itemIndex != null) { altRowStyles = modelForm.getStyleAltRowStyle(context); - if (itemIndex.intValue() % 2 == 0) { + if (itemIndex % 2 == 0) { evenRowStyle = modelForm.getEvenRowStyle(); } else { oddRowStyle = FlexibleStringExpander.expandString(modelForm.getOddRowStyle(), context); @@ -2347,7 +2347,7 @@ public final class MacroFormRenderer implements FormStringRenderer { Debug.logWarning("Could not find uiLabelMap in context", module); } else { pageLabel = uiLabelMap.get("CommonPage"); - Map messageMap = UtilMisc.toMap("lowCount", Integer.valueOf(lowIndex + 1), "highCount", Integer.valueOf(lowIndex + actualPageSize), "total", Integer.valueOf(listSize)); + Map messageMap = UtilMisc.toMap("lowCount", lowIndex + 1, "highCount", lowIndex + actualPageSize, "total", listSize); commonDisplaying = UtilProperties.getMessage("CommonUiLabels", "CommonDisplaying", messageMap, (Locale) context.get("locale")); } // for legacy support, the viewSizeParam is VIEW_SIZE and viewIndexParam is VIEW_INDEX when the fields are "viewSize" and "viewIndex" diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroMenuRenderer.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroMenuRenderer.java index a205853a13..089f167aed 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroMenuRenderer.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroMenuRenderer.java @@ -166,7 +166,7 @@ public class MacroMenuRenderer implements MenuStringRenderer { String currentMenuItemName = menu.getSelectedMenuItemContextFieldName(context); String currentItemName = menuItem.getName(); Boolean hideIfSelected = menuItem.getHideIfSelected(); - return (hideIfSelected != null && hideIfSelected.booleanValue() && currentMenuItemName != null && currentMenuItemName.equals(currentItemName)); + return (hideIfSelected != null && hideIfSelected && currentMenuItemName != null && currentMenuItemName.equals(currentItemName)); } @Override diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroTreeRenderer.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroTreeRenderer.java index c534c4e0ae..9f512caf18 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroTreeRenderer.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroTreeRenderer.java @@ -206,7 +206,7 @@ public class MacroTreeRenderer implements TreeStringRenderer { StringWriter sr = new StringWriter(); sr.append("<@renderNodeEnd "); sr.append(" processChildren="); - sr.append(Boolean.toString(processChildren.booleanValue())); + sr.append(Boolean.toString(processChildren)); sr.append(" isRootNode="); sr.append(Boolean.toString(node.isRootNode())); sr.append(" />"); @@ -220,7 +220,7 @@ public class MacroTreeRenderer implements TreeStringRenderer { public void renderLastElement(Appendable writer, Map context, ModelTree.ModelNode node) throws IOException { Boolean processChildren = (Boolean) context.get("processChildren"); - if (processChildren.booleanValue()) { + if (processChildren) { StringWriter sr = new StringWriter(); sr.append("<@renderLastElement "); sr.append("style=\"");