From 40e8be83dfe9df6db01c14bb4bde59b5db7095d5 Mon Sep 17 00:00:00 2001 From: Jacques Le Roux Date: Wed, 13 Dec 2017 14:11:38 +0000 Subject: [PATCH] Improved: Always check if debug verbose is on when using Debug.logVerbose() (OFBIZ-10052) This completes r1818010, there were much more cases. Also few tabs automatically replaced by spaces git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818020 13f79535-47bb-0310-9956-ffa450edef68 --- .../accounting/invoice/InvoiceServices.java | 17 ++++++------- .../clearcommerce/CCPaymentServices.java | 4 ++-- .../thirdparty/verisign/PayflowPro.java | 2 +- .../ofbiz/content/data/DataServices.java | 2 +- .../ofbiz/content/layout/LayoutEvents.java | 6 ++--- .../webapp/ftl/RenderContentAsText.java | 12 +++++----- .../product/inventory/InventoryServices.java | 2 +- .../ofbiz/product/price/PriceServices.java | 2 +- .../shipment/thirdparty/dhl/DhlServices.java | 4 ++-- .../thirdparty/fedex/FedexServices.java | 4 ++-- .../ofbiz/securityext/login/LoginEvents.java | 2 +- .../workeffort/workeffort/ICalConverter.java | 2 +- .../workeffort/workeffort/ICalWorker.java | 6 ++--- .../ofbiz/base/component/ComponentConfig.java | 2 +- .../component/ComponentResourceHandler.java | 2 +- .../ofbiz/base/conversion/Converters.java | 2 +- .../apache/ofbiz/base/util/GroovyUtil.java | 6 ++--- .../apache/ofbiz/base/util/ObjectType.java | 2 +- .../ofbiz/base/util/PatternFactory.java | 2 +- .../apache/ofbiz/base/util/ScriptUtil.java | 16 ++++++------- .../apache/ofbiz/base/util/StringUtil.java | 2 +- .../org/apache/ofbiz/base/util/UtilHttp.java | 8 +++---- .../util/collections/FlexibleMapAccessor.java | 4 ++-- .../util/string/FlexibleStringExpander.java | 8 +++---- .../ofbiz/base/util/string/JuelConnector.java | 4 ++-- .../ofbiz/base/util/string/UelUtil.java | 12 +++++----- .../base/util/template/FreeMarkerWorker.java | 2 +- .../ofbiz/datafile/ModelDataFileReader.java | 2 +- .../apache/ofbiz/entity/GenericEntity.java | 2 +- .../entity/transaction/TransactionUtil.java | 8 +++---- .../ofbiz/entityext/eca/EntityEcaRule.java | 2 +- .../method/callops/SetServiceFields.java | 2 +- .../ofbiz/minilang/method/envops/Iterate.java | 2 +- .../ofbiz/security/SecurityFactory.java | 2 +- .../service/GenericAbstractDispatcher.java | 2 +- .../service/calendar/RecurrenceInfo.java | 2 +- .../service/calendar/TemporalExpressions.java | 24 +++++++++---------- .../ofbiz/service/eca/ServiceEcaRule.java | 6 ++--- .../service/engine/XMLRPCClientEngine.java | 2 +- .../service/job/PersistedServiceJob.java | 6 ++--- .../webapp/event/ServiceEventHandler.java | 2 +- .../apache/ofbiz/widget/WidgetFactory.java | 2 +- .../ofbiz/widget/renderer/UtilHelpText.java | 4 ++-- .../renderer/macro/MacroMenuRenderer.java | 2 +- 44 files changed, 105 insertions(+), 104 deletions(-) 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 19d3955d41..fbb6a175b5 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 @@ -33,6 +33,7 @@ import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Map.Entry; + import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.csv.CSVFormat; import org.apache.commons.csv.CSVRecord; @@ -1977,7 +1978,7 @@ public class InvoiceServices { String returnId = entry.getKey(); List billItems = entry.getValue(); if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Creating invoice for return [" + returnId + "] with items: " + billItems.toString(), module); + Debug.logVerbose("Creating invoice for return [" + returnId + "] with items: " + billItems.toString(), module); } Map input = UtilMisc.toMap("returnId", returnId, "billItems", billItems, "userLogin", context.get("userLogin")); Map serviceResults = dispatcher.runSync("createInvoiceFromReturn", input); @@ -2014,7 +2015,7 @@ public class InvoiceServices { // get the return header GenericValue returnHeader = EntityQuery.use(delegator).from("ReturnHeader").where("returnId", returnId).queryOne(); if (returnHeader == null || returnHeader.get("returnHeaderTypeId") == null) { - return ServiceUtil.returnError(UtilProperties.getMessage(resource, "AccountingReturnTypeCannotBeNull", locale)); + return ServiceUtil.returnError(UtilProperties.getMessage(resource, "AccountingReturnTypeCannotBeNull", locale)); } if (returnHeader.getString("returnHeaderTypeId").startsWith("CUSTOMER_")) { @@ -2157,7 +2158,7 @@ public class InvoiceServices { return ServiceUtil.returnError(ServiceUtil.getErrorMessage(serviceResults)); } if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Creating Invoice Item with amount " + returnPrice + " and quantity " + quantity + Debug.logVerbose("Creating Invoice Item with amount " + returnPrice + " and quantity " + quantity + " for shipment [" + item.getString("shipmentId") + ":" + item.getString("shipmentItemSeqId") + "]", module); } @@ -2203,7 +2204,7 @@ public class InvoiceServices { BigDecimal amount = adjustment.getBigDecimal("amount"); amount = amount.multiply(ratio).setScale(DECIMALS, ROUNDING); if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Creating Invoice Item with amount " + adjustment.getBigDecimal("amount") + " prorated to " + amount + Debug.logVerbose("Creating Invoice Item with amount " + adjustment.getBigDecimal("amount") + " prorated to " + amount + " for return adjustment [" + adjustment.getString("returnAdjustmentId") + "]", module); } @@ -2263,7 +2264,7 @@ public class InvoiceServices { // prorate the adjustment amount by the actual to promised ratio BigDecimal amount = adjustment.getBigDecimal("amount").multiply(actualToPromisedRatio).setScale(DECIMALS, ROUNDING); if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Creating Invoice Item with amount " + adjustment.getBigDecimal("amount") + " prorated to " + amount + Debug.logVerbose("Creating Invoice Item with amount " + adjustment.getBigDecimal("amount") + " prorated to " + amount + " for return adjustment [" + adjustment.getString("returnAdjustmentId") + "]", module); } @@ -2381,7 +2382,7 @@ public class InvoiceServices { if (totalPayments.signum() == 1) { BigDecimal invoiceTotal = InvoiceWorker.getInvoiceTotal(delegator, invoiceId); if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Invoice #" + invoiceId + " total: " + invoiceTotal, module); + Debug.logVerbose("Invoice #" + invoiceId + " total: " + invoiceTotal, module); if (Debug.verboseOn()) Debug.logVerbose("Total payments : " + totalPayments, module); } if (totalPayments.compareTo(invoiceTotal) >= 0) { // this checks that totalPayments is greater than or equal to invoiceTotal @@ -2417,7 +2418,7 @@ public class InvoiceServices { // pro-rate the amount BigDecimal amount = ZERO; if("DONATION_ADJUSTMENT".equals(adj.getString("orderAdjustmentTypeId"))) { - amount=baseAmount; + amount=baseAmount; } else if (divisor.signum() != 0) { // make sure the divisor is not 0 to avoid NaN problems; just leave the amount as 0 and skip it in essense // multiply first then divide to avoid rounding errors amount = baseAmount.multiply(multiplier).divide(divisor, decimals, rounding); @@ -3538,7 +3539,7 @@ public class InvoiceServices { } public static Map importInvoice(DispatchContext dctx, Map context) { - Locale locale = (Locale) context.get("locale"); + Locale locale = (Locale) context.get("locale"); Delegator delegator = dctx.getDelegator(); LocalDispatcher dispatcher = dctx.getDispatcher(); GenericValue userLogin = (GenericValue) context.get("userLogin"); diff --git a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/clearcommerce/CCPaymentServices.java b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/clearcommerce/CCPaymentServices.java index 0a848e9ac8..ae5f90062d 100644 --- a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/clearcommerce/CCPaymentServices.java +++ b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/clearcommerce/CCPaymentServices.java @@ -889,7 +889,7 @@ public class CCPaymentServices { throw new ClearCommerceException("Missing server URL; check your ClearCommerce configuration"); } if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("ClearCommerce server URL: " + serverURL, module); + Debug.logVerbose("ClearCommerce server URL: " + serverURL, module); } OutputStream os = new ByteArrayOutputStream(); @@ -903,7 +903,7 @@ public class CCPaymentServices { String xmlString = os.toString(); if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("ClearCommerce XML request string: " + xmlString, module); + Debug.logVerbose("ClearCommerce XML request string: " + xmlString, module); } HttpClient http = new HttpClient(serverURL); 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 4b61613ac0..82de57648b 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 @@ -173,7 +173,7 @@ public class PayflowPro { } if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Response from Verisign: " + resp, module); + Debug.logVerbose("Response from Verisign: " + resp, module); } if (isPayPal) { // Attach the avs info returned in doExpressCheckout and stored in PayPalPaymentMethod diff --git a/applications/content/src/main/java/org/apache/ofbiz/content/data/DataServices.java b/applications/content/src/main/java/org/apache/ofbiz/content/data/DataServices.java index 4b220fbe89..990571cb26 100644 --- a/applications/content/src/main/java/org/apache/ofbiz/content/data/DataServices.java +++ b/applications/content/src/main/java/org/apache/ofbiz/content/data/DataServices.java @@ -364,7 +364,7 @@ public class DataServices { } String textData = (String) context.get("textData"); if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("in updateElectronicText, textData:" + textData, module); + Debug.logVerbose("in updateElectronicText, textData:" + textData, module); } try { electronicText = EntityQuery.use(delegator).from("ElectronicText").where("dataResourceId", dataResourceId).queryOne(); diff --git a/applications/content/src/main/java/org/apache/ofbiz/content/layout/LayoutEvents.java b/applications/content/src/main/java/org/apache/ofbiz/content/layout/LayoutEvents.java index bcfe228762..141825af6c 100644 --- a/applications/content/src/main/java/org/apache/ofbiz/content/layout/LayoutEvents.java +++ b/applications/content/src/main/java/org/apache/ofbiz/content/layout/LayoutEvents.java @@ -416,7 +416,7 @@ public class LayoutEvents { String contentIdTo = (String) paramMap.get("contentIdTo"); String mapKey = (String) paramMap.get("mapKey"); if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("in createSubContent, contentIdTo:" + contentIdTo, module); + Debug.logVerbose("in createSubContent, contentIdTo:" + contentIdTo, module); if (Debug.verboseOn()) Debug.logVerbose("in createSubContent, mapKey:" + mapKey, module); } Map context = new HashMap(); @@ -449,7 +449,7 @@ public class LayoutEvents { context.put("textData", paramMap.get("textData")); context.put("contentAssocTypeId", "SUB_CONTENT"); if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("in createSubContent, context:" + context, module); + Debug.logVerbose("in createSubContent, context:" + context, module); } Map result = dispatcher.runSync("persistContentAndAssoc", context); boolean isError = ModelService.RESPOND_ERROR.equals(result.get(ModelService.RESPONSE_MESSAGE)); @@ -459,7 +459,7 @@ public class LayoutEvents { } if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("in createLayoutFile, result:" + result, module); + Debug.logVerbose("in createLayoutFile, result:" + result, module); } String contentId = (String) result.get("contentId"); String dataResourceId = (String) result.get("dataResourceId"); diff --git a/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/RenderContentAsText.java b/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/RenderContentAsText.java index c83cc9c9a3..2591d2107c 100644 --- a/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/RenderContentAsText.java +++ b/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/RenderContentAsText.java @@ -63,20 +63,20 @@ public class RenderContentAsText implements TemplateTransformModel { final HttpServletResponse response = FreeMarkerWorker.getWrappedObject("response", env); final Map templateRoot = FreeMarkerWorker.createEnvironmentMap(env); if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("in RenderSubContent, contentId(0):" + templateRoot.get("contentId"), module); + Debug.logVerbose("in RenderSubContent, contentId(0):" + templateRoot.get("contentId"), module); } FreeMarkerWorker.getSiteParameters(request, templateRoot); final Map savedValuesUp = new HashMap(); FreeMarkerWorker.saveContextValues(templateRoot, upSaveKeyNames, savedValuesUp); FreeMarkerWorker.overrideWithArgs(templateRoot, args); if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("in RenderSubContent, contentId(2):" + templateRoot.get("contentId"), module); + Debug.logVerbose("in RenderSubContent, contentId(2):" + templateRoot.get("contentId"), module); } final String thisContentId = (String)templateRoot.get("contentId"); final String xmlEscape = (String)templateRoot.get("xmlEscape"); final boolean directAssocMode = UtilValidate.isNotEmpty(thisContentId) ? true : false; if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("in Render(0), directAssocMode ." + directAssocMode , module); + Debug.logVerbose("in Render(0), directAssocMode ." + directAssocMode , module); } final Map savedValues = new HashMap(); @@ -96,7 +96,7 @@ public class RenderContentAsText implements TemplateTransformModel { public void close() throws IOException { List> globalNodeTrail = UtilGenerics.checkList(templateRoot.get("globalNodeTrail")); if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Render close, globalNodeTrail(2a):" + ContentWorker.nodeTrailToCsv(globalNodeTrail), ""); + Debug.logVerbose("Render close, globalNodeTrail(2a):" + ContentWorker.nodeTrailToCsv(globalNodeTrail), ""); } renderSubContent(); } @@ -113,7 +113,7 @@ public class RenderContentAsText implements TemplateTransformModel { String editRequestName = (String)templateRoot.get("editRequestName"); if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("in Render(3), editRequestName ." + editRequestName , module); + Debug.logVerbose("in Render(3), editRequestName ." + editRequestName , module); } if (UtilValidate.isNotEmpty(editRequestName)) { @@ -122,7 +122,7 @@ public class RenderContentAsText implements TemplateTransformModel { } if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("in RenderSubContent, contentId(2):" + templateRoot.get("contentId"), module); + Debug.logVerbose("in RenderSubContent, contentId(2):" + templateRoot.get("contentId"), module); if (Debug.verboseOn()) Debug.logVerbose("in RenderSubContent, subContentId(2):" + templateRoot.get("subContentId"), module); } FreeMarkerWorker.saveContextValues(templateRoot, saveKeyNames, savedValues); 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 a251ade57a..e118def115 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 @@ -730,7 +730,7 @@ public class InventoryServices { } if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("productIdTo = " + productIdTo + " assocQuantity = " + assocQuantity + "current QOH " + currentQuantityOnHandTotal + + Debug.logVerbose("productIdTo = " + productIdTo + " assocQuantity = " + assocQuantity + "current QOH " + currentQuantityOnHandTotal + "currentATP = " + currentAvailableToPromiseTotal + " minQOH = " + minQuantityOnHandTotal + " minATP = " + minAvailableToPromiseTotal, module); } } 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 9ab92a6676..39bc37a444 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 @@ -982,7 +982,7 @@ public class PriceServices { } if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Unchecked Calculated price: " + price, module); + Debug.logVerbose("Unchecked Calculated price: " + price, module); if (Debug.verboseOn()) Debug.logVerbose("PriceInfo:", module); for (GenericValue orderItemPriceInfo: orderItemPriceInfos) { if (Debug.verboseOn()) Debug.logVerbose(" --- " + orderItemPriceInfo.toString(), module); diff --git a/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/dhl/DhlServices.java b/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/dhl/DhlServices.java index 57e647339d..1bd926b585 100644 --- a/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/dhl/DhlServices.java +++ b/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/dhl/DhlServices.java @@ -121,7 +121,7 @@ public class DhlServices { } if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("DHL Connect URL : " + conStr, module); + Debug.logVerbose("DHL Connect URL : " + conStr, module); if (Debug.verboseOn()) Debug.logVerbose("DHL XML String : " + xmlString, module); } @@ -141,7 +141,7 @@ public class DhlServices { "FacilityShipmentDhlReceivedNullResponse", locale)); } if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("DHL Response : " + response, module); + Debug.logVerbose("DHL Response : " + response, module); } return response; 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 87fb8ebd70..d6803c646f 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 @@ -118,7 +118,7 @@ public class FedexServices { } if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Fedex Connect URL : " + url, module); + Debug.logVerbose("Fedex Connect URL : " + url, module); if (Debug.verboseOn()) Debug.logVerbose("Fedex XML String : " + xmlString, module); } @@ -138,7 +138,7 @@ public class FedexServices { "FacilityShipmentFedexReceivedNullResponse", locale)); } if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Fedex Response : " + response, module); + Debug.logVerbose("Fedex Response : " + response, module); } return response; 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 c052962675..35658266e1 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 @@ -421,7 +421,7 @@ public class LoginEvents { String cookieUsername = null; Cookie[] cookies = request.getCookies(); if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Cookies:" + Arrays.toString(cookies), module); + Debug.logVerbose("Cookies:" + Arrays.toString(cookies), module); } if (cookies != null) { for (Cookie cookie: cookies) { 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 545a6fcc18..d2e938a065 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 @@ -696,7 +696,7 @@ public class ICalConverter { } } if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Processing calendar:\r\n" + calendar, module); + Debug.logVerbose("Processing calendar:\r\n" + calendar, module); } String workEffortId = fromXProperty(calendar.getProperties(), workEffortIdXPropName); if (workEffortId == null) { diff --git a/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/ICalWorker.java b/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/ICalWorker.java index 8a5b79d2b8..2850f4c37e 100644 --- a/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/ICalWorker.java +++ b/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/ICalWorker.java @@ -171,7 +171,7 @@ public final class ICalWorker { try { Document requestDocument = WebDavUtil.getDocumentFromRequest(request); if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("[handlePropFindRequest] PROPFIND body:\r\n" + UtilXml.writeXmlDocument(requestDocument), module); + Debug.logVerbose("[handlePropFindRequest] PROPFIND body:\r\n" + UtilXml.writeXmlDocument(requestDocument), module); } PropFindHelper helper = new PropFindHelper(requestDocument); if (!helper.isAllProp() && !helper.isPropName()) { @@ -207,7 +207,7 @@ public final class ICalWorker { rootElement.appendChild(responseElement); responseDocument.appendChild(rootElement); if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("[handlePropFindRequest] PROPFIND response:\r\n" + UtilXml.writeXmlDocument(responseDocument), module); + Debug.logVerbose("[handlePropFindRequest] PROPFIND response:\r\n" + UtilXml.writeXmlDocument(responseDocument), module); } ResponseHelper.prepareResponse(response, 207, "Multi-Status"); try (Writer writer = response.getWriter()) { @@ -309,7 +309,7 @@ public final class ICalWorker { private static void writeResponse(ResponseProperties responseProps, HttpServletRequest request, HttpServletResponse response, ServletContext context) throws IOException { if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Returning response: code = " + responseProps.statusCode + + Debug.logVerbose("Returning response: code = " + responseProps.statusCode + ", message = " + responseProps.statusMessage, module); } response.setStatus(responseProps.statusCode); diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/component/ComponentConfig.java b/framework/base/src/main/java/org/apache/ofbiz/base/component/ComponentConfig.java index eb446f415c..02f07e5edb 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/component/ComponentConfig.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/component/ComponentConfig.java @@ -459,7 +459,7 @@ public final class ComponentConfig { throw new ComponentException("Error reading container configurations for component: " + this.globalName, ce); } if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Read component config : [" + rootLocation + "]", module); + Debug.logVerbose("Read component config : [" + rootLocation + "]", module); } } diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/component/ComponentResourceHandler.java b/framework/base/src/main/java/org/apache/ofbiz/base/component/ComponentResourceHandler.java index e6c858b23c..cdcac28713 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/component/ComponentResourceHandler.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/component/ComponentResourceHandler.java @@ -55,7 +55,7 @@ public class ComponentResourceHandler implements ResourceHandler { this.loaderName = loaderName; this.location = location; if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Created " + this.toString(), module); + Debug.logVerbose("Created " + this.toString(), module); } } diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/conversion/Converters.java b/framework/base/src/main/java/org/apache/ofbiz/base/conversion/Converters.java index 6717891eb5..d800ec20e7 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/conversion/Converters.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/conversion/Converters.java @@ -74,7 +74,7 @@ public class Converters { public static Converter getConverter(Class sourceClass, Class targetClass) throws ClassNotFoundException { String key = sourceClass.getName().concat(DELIMITER).concat(targetClass.getName()); if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Getting converter: " + key, module); + Debug.logVerbose("Getting converter: " + key, module); } OUTER: do { diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/GroovyUtil.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/GroovyUtil.java index 1ec5ae86fc..5d230ddca0 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/GroovyUtil.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/GroovyUtil.java @@ -85,14 +85,14 @@ public class GroovyUtil { return null; } if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Evaluating -- " + expression, module); + Debug.logVerbose("Evaluating -- " + expression, module); if (Debug.verboseOn()) Debug.logVerbose("Using Context -- " + context, module); } try { GroovyShell shell = new GroovyShell(getBinding(context, expression)); o = shell.evaluate(StringUtil.convertOperatorSubstitutions(expression)); if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Evaluated to -- " + o, module); + Debug.logVerbose("Evaluated to -- " + o, module); } // read back the context info Binding binding = shell.getContext(); @@ -160,7 +160,7 @@ public class GroovyUtil { Class scriptClassCached = parsedScripts.putIfAbsent(location, scriptClass); if (scriptClassCached == null) { // putIfAbsent returns null if the class is added to the cache if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Cached Groovy script at: " + location, module); + Debug.logVerbose("Cached Groovy script at: " + location, module); } } else { // the newly parsed script is discarded and the one found in the cache (that has been created by a concurrent thread in the meantime) is used 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 f63c39234d..e79812ba05 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 @@ -800,7 +800,7 @@ public class ObjectType { if (value instanceof java.util.Date) return false; if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("In ObjectType.isEmpty(Object value) returning false for " + value.getClass() + " Object.", module); + Debug.logVerbose("In ObjectType.isEmpty(Object value) returning false for " + value.getClass() + " Object.", module); } return false; } diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/PatternFactory.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/PatternFactory.java index 7373c54b36..e9aa853fcf 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/PatternFactory.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/PatternFactory.java @@ -52,7 +52,7 @@ public class PatternFactory { } pattern = compiledPerl5Patterns.putIfAbsentAndGet(stringPattern, pattern); if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Compiled and cached the pattern: '" + stringPattern, module); + Debug.logVerbose("Compiled and cached the pattern: '" + stringPattern, module); } } return pattern; diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/ScriptUtil.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/ScriptUtil.java index 77ca215b06..6f21d8aa06 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/ScriptUtil.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/ScriptUtil.java @@ -108,7 +108,7 @@ public final class ScriptUtil { if (iter.hasNext()) { helperFactory = iter.next(); if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("ScriptHelper factory set to " + helperFactory.getClass().getName(), module); + Debug.logVerbose("ScriptHelper factory set to " + helperFactory.getClass().getName(), module); } } else { Debug.logWarning("ScriptHelper factory not found", module); @@ -140,11 +140,11 @@ public final class ScriptUtil { .getUtf8())); script = compilableEngine.compile(reader); if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Compiled script " + filePath + " using engine " + engine.getClass().getName(), module); + Debug.logVerbose("Compiled script " + filePath + " using engine " + engine.getClass().getName(), module); } } catch (ClassCastException e) { if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Script engine " + engine.getClass().getName() + " does not implement Compilable", module); + Debug.logVerbose("Script engine " + engine.getClass().getName() + " does not implement Compilable", module); } } if (script != null) { @@ -177,11 +177,11 @@ public final class ScriptUtil { Compilable compilableEngine = (Compilable) engine; compiledScript = compilableEngine.compile(script); if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Compiled script [" + script + "] using engine " + engine.getClass().getName(), module); + Debug.logVerbose("Compiled script [" + script + "] using engine " + engine.getClass().getName(), module); } } catch (ClassCastException e) { if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Script engine " + engine.getClass().getName() + " does not implement Compilable", module); + Debug.logVerbose("Script engine " + engine.getClass().getName() + " does not implement Compilable", module); } } if (compiledScript != null) { @@ -273,7 +273,7 @@ public final class ScriptUtil { throw new IllegalArgumentException("The script type is not supported for language: " + language); } if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Begin processing script [" + script + "] using engine " + engine.getClass().getName(), module); + Debug.logVerbose("Begin processing script [" + script + "] using engine " + engine.getClass().getName(), module); } ScriptContext scriptContext = createScriptContext(context); return engine.eval(script, scriptContext); @@ -298,7 +298,7 @@ public final class ScriptUtil { Object result = script.eval(scriptContext); if (UtilValidate.isNotEmpty(functionName)) { if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Invoking function/method " + functionName, module); + Debug.logVerbose("Invoking function/method " + functionName, module); } ScriptEngine engine = script.getEngine(); try { @@ -380,7 +380,7 @@ public final class ScriptUtil { throw new IllegalArgumentException("The script type is not supported for location: " + filePath); } if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Begin processing script [" + filePath + "] using engine " + engine.getClass().getName(), module); + Debug.logVerbose("Begin processing script [" + filePath + "] using engine " + engine.getClass().getName(), module); } engine.setContext(scriptContext); URL scriptUrl = FlexibleLocation.resolveLocation(filePath); diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/StringUtil.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/StringUtil.java index eb0f46f407..757543290f 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/StringUtil.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/StringUtil.java @@ -533,7 +533,7 @@ public class StringUtil { result = pattern.matcher(result).replaceAll(entry.getKey()); } if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Converted " + expression + " to " + result, module); + Debug.logVerbose("Converted " + expression + " to " + result, module); } } return result; 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 15efced490..c7cc8ef275 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 @@ -159,7 +159,7 @@ public final class UtilHttp { } if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Made Request Parameter Map with [" + paramMap.size() + "] Entries", module); + Debug.logVerbose("Made Request Parameter Map with [" + paramMap.size() + "] Entries", module); //Debug.logVerbose("Request Parameter Map Entries: " + System.getProperty("line.separator") + UtilMisc.printMap(paramMap), module); see OFBIZ-9310 } @@ -319,7 +319,7 @@ public final class UtilHttp { } if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Made Request Attribute Map with [" + attributeMap.size() + "] Entries", module); + Debug.logVerbose("Made Request Attribute Map with [" + attributeMap.size() + "] Entries", module); if (Debug.verboseOn()) Debug.logVerbose("Request Attribute Map Entries: " + System.getProperty("line.separator") + UtilMisc.printMap(attributeMap), module); } @@ -354,7 +354,7 @@ public final class UtilHttp { } if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Made Session Attribute Map with [" + sessionMap.size() + "] Entries", module); + Debug.logVerbose("Made Session Attribute Map with [" + sessionMap.size() + "] Entries", module); if (Debug.verboseOn()) Debug.logVerbose("Session Attribute Map Entries: " + System.getProperty("line.separator") + UtilMisc.printMap(sessionMap), module); } @@ -389,7 +389,7 @@ public final class UtilHttp { } if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Made ServletContext Attribute Map with [" + servletCtxMap.size() + "] Entries", module); + Debug.logVerbose("Made ServletContext Attribute Map with [" + servletCtxMap.size() + "] Entries", module); if (Debug.verboseOn()) Debug.logVerbose("ServletContext Attribute Map Entries: " + System.getProperty("line.separator") + UtilMisc.printMap(servletCtxMap), module); } diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/FlexibleMapAccessor.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/FlexibleMapAccessor.java index f0ade9cf97..944ac30854 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/FlexibleMapAccessor.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/FlexibleMapAccessor.java @@ -76,7 +76,7 @@ public final class FlexibleMapAccessor implements Serializable, IsEmpty { this.isAscending = isAscending; this.fse = fse; if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("FlexibleMapAccessor created, original = " + this.original, module); + Debug.logVerbose("FlexibleMapAccessor created, original = " + this.original, module); } } @@ -149,7 +149,7 @@ public final class FlexibleMapAccessor implements Serializable, IsEmpty { } catch (PropertyNotFoundException e) { // PropertyNotFound exceptions are common, so log verbose. if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("UEL exception while getting value: " + e + ", original = " + this.original, module); + Debug.logVerbose("UEL exception while getting value: " + e + ", original = " + this.original, module); } } catch (Exception e) { Debug.logError("UEL exception while getting value: " + e + ", original = " + this.original, module); diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/string/FlexibleStringExpander.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/string/FlexibleStringExpander.java index a9bd1f6071..03f4a950e9 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/string/FlexibleStringExpander.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/string/FlexibleStringExpander.java @@ -604,7 +604,7 @@ public abstract class FlexibleStringExpander implements Serializable, IsEmpty { } } catch (PropertyNotFoundException e) { if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Error evaluating expression: " + e, module); + Debug.logVerbose("Error evaluating expression: " + e, module); } } catch (Exception e) { Debug.logError("Error evaluating expression: " + e, module); @@ -658,7 +658,7 @@ public abstract class FlexibleStringExpander implements Serializable, IsEmpty { return obj; } else { if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Scriptlet evaluated to null [" + this + "].", module); + Debug.logVerbose("Scriptlet evaluated to null [" + this + "].", module); } } } catch (Exception e) { @@ -693,7 +693,7 @@ public abstract class FlexibleStringExpander implements Serializable, IsEmpty { return UelUtil.evaluate(context, openBracket.concat(expr.toString()).concat(closeBracket)); } catch (PropertyNotFoundException e) { if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Error evaluating expression: " + e, module); + Debug.logVerbose("Error evaluating expression: " + e, module); } } catch (Exception e) { Debug.logError("Error evaluating expression: " + e, module); @@ -718,7 +718,7 @@ public abstract class FlexibleStringExpander implements Serializable, IsEmpty { obj = UelUtil.evaluate(context, new String(this.bracketedOriginal)); } catch (PropertyNotFoundException e) { if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Error evaluating expression " + this + ": " + e, module); + Debug.logVerbose("Error evaluating expression " + this + ": " + e, module); } } catch (Exception e) { Debug.logError("Error evaluating expression " + this + ": " + e, module); diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/string/JuelConnector.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/string/JuelConnector.java index 4f0b3f5571..8b2b712931 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/string/JuelConnector.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/string/JuelConnector.java @@ -88,7 +88,7 @@ public class JuelConnector { if (base == null) { base = UelUtil.autoVivifyListOrMap(property); if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("ExtendedAstBracket.setValue auto-vivify base: " + base + ", property = " + property, module); + Debug.logVerbose("ExtendedAstBracket.setValue auto-vivify base: " + base + ", property = " + property, module); } prefix.setValue(bindings, context, base); } @@ -124,7 +124,7 @@ public class JuelConnector { if (base == null) { base = UelUtil.autoVivifyListOrMap(property); if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("ExtendedAstDot.setValue auto-vivify base: " + base + ", property = " + property, module); + Debug.logVerbose("ExtendedAstDot.setValue auto-vivify base: " + base + ", property = " + property, module); } prefix.setValue(bindings, context, base); } 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 54f1f82ba6..45519c7bc1 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 @@ -97,7 +97,7 @@ public final class UelUtil { */ public static void setValue(Map context, String expression, Class expectedType, Object value) { if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("UelUtil.setValue invoked, expression = " + expression + ", value = " + value, module); + Debug.logVerbose("UelUtil.setValue invoked, expression = " + expression + ", value = " + value, module); } ELContext elContext = new BasicContext(context); ValueExpression ve = exprFactory.createValueExpression(elContext, expression, expectedType); @@ -111,7 +111,7 @@ public final class UelUtil { */ public static void removeValue(Map context, String expression) { if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("UelUtil.removeValue invoked, expression = " + expression , module); + Debug.logVerbose("UelUtil.removeValue invoked, expression = " + expression , module); } ELContext elContext = new BasicContext(context); ValueExpression ve = exprFactory.createValueExpression(elContext, expression, Object.class); @@ -340,7 +340,7 @@ public final class UelUtil { super.setValue(context, base, property, val); if (!context.isPropertyResolved() && base == null) { if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("ExtendedCompositeResolver.setValue: base = " + base + ", property = " + property + ", value = " + val, module); + Debug.logVerbose("ExtendedCompositeResolver.setValue: base = " + base + ", property = " + property + ", value = " + val, module); } try { BasicContext elContext = (BasicContext) context; @@ -375,14 +375,14 @@ public final class UelUtil { String str = property.toString(); if ("add".equals(str)) { if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("ExtendedListResolver.setValue adding List element: base = " + base + ", property = " + property + ", value = " + val, module); + Debug.logVerbose("ExtendedListResolver.setValue adding List element: base = " + base + ", property = " + property + ", value = " + val, module); } context.setPropertyResolved(true); List list = (List) base; list.add(val); } else if (str.startsWith("insert@")) { if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("ExtendedListResolver.setValue inserting List element: base = " + base + ", property = " + property + ", value = " + val, module); + Debug.logVerbose("ExtendedListResolver.setValue inserting List element: base = " + base + ", property = " + property + ", value = " + val, module); } context.setPropertyResolved(true); String indexStr = str.replace("insert@", ""); @@ -436,7 +436,7 @@ public final class UelUtil { } if (locale == null) { if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("ExtendedMapResolver.getValue: unable to find Locale for LocalizedMap element, using default locale", module); + Debug.logVerbose("ExtendedMapResolver.getValue: unable to find Locale for LocalizedMap element, using default locale", module); } locale = Locale.getDefault(); } diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/template/FreeMarkerWorker.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/template/FreeMarkerWorker.java index c45ca724f9..4e4abc4bf3 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/template/FreeMarkerWorker.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/template/FreeMarkerWorker.java @@ -144,7 +144,7 @@ public final class FreeMarkerWorker { String key = (String) i.next(); String className = props.getProperty(key); if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Adding FTL Transform " + key + " with class " + className, module); + Debug.logVerbose("Adding FTL Transform " + key + " with class " + className, module); } try { config.setSharedVariable(key, loader.loadClass(className).newInstance()); diff --git a/framework/datafile/src/main/java/org/apache/ofbiz/datafile/ModelDataFileReader.java b/framework/datafile/src/main/java/org/apache/ofbiz/datafile/ModelDataFileReader.java index aa22d41d18..ca1719f53a 100644 --- a/framework/datafile/src/main/java/org/apache/ofbiz/datafile/ModelDataFileReader.java +++ b/framework/datafile/src/main/java/org/apache/ofbiz/datafile/ModelDataFileReader.java @@ -146,7 +146,7 @@ public final class ModelDataFileReader { ModelDataFile dataFile = createModelDataFile(curDataFile); result.put(dataFileName, dataFile); if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Loaded dataFile: " + dataFileName, module); + Debug.logVerbose("Loaded dataFile: " + dataFileName, module); } } return result; 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 98ec476280..eb91eb0fc9 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 @@ -1227,7 +1227,7 @@ public class GenericEntity implements Map, LocalizedMap, // Replace each char which is out of the ASCII range with a XML entity String replacement = "&#" + (int) curChar + ";"; if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Entity: " + this.getEntityName() + ", PK: " + this.getPrimaryKey().toString() + " -> char [" + curChar + "] replaced with [" + replacement + "]", module); + Debug.logVerbose("Entity: " + this.getEntityName() + ", PK: " + this.getPrimaryKey().toString() + " -> char [" + curChar + "] replaced with [" + replacement + "]", module); } value.replace(i, i+1, replacement); } diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/transaction/TransactionUtil.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/transaction/TransactionUtil.java index a6f71858c0..8c8b3f3e37 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/transaction/TransactionUtil.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/transaction/TransactionUtil.java @@ -122,11 +122,11 @@ public final class TransactionUtil implements Status { try { int currentStatus = ut.getStatus(); if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Current status : " + getTransactionStateString(currentStatus), module); + Debug.logVerbose("Current status : " + getTransactionStateString(currentStatus), module); } if (currentStatus == Status.STATUS_ACTIVE) { if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Active transaction in place, so no transaction begun", module); + Debug.logVerbose("Active transaction in place, so no transaction begun", module); } return false; } else if (currentStatus == Status.STATUS_MARKED_ROLLBACK) { @@ -182,14 +182,14 @@ public final class TransactionUtil implements Status { if (timeout > 0) { ut.setTransactionTimeout(timeout); if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Set transaction timeout to : " + timeout + " seconds", module); + Debug.logVerbose("Set transaction timeout to : " + timeout + " seconds", module); } } // begin the transaction ut.begin(); if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Transaction begun", module); + Debug.logVerbose("Transaction begun", module); } // reset the timeout to the default diff --git a/framework/entityext/src/main/java/org/apache/ofbiz/entityext/eca/EntityEcaRule.java b/framework/entityext/src/main/java/org/apache/ofbiz/entityext/eca/EntityEcaRule.java index e6cc483879..0550fc244a 100644 --- a/framework/entityext/src/main/java/org/apache/ofbiz/entityext/eca/EntityEcaRule.java +++ b/framework/entityext/src/main/java/org/apache/ofbiz/entityext/eca/EntityEcaRule.java @@ -83,7 +83,7 @@ public final class EntityEcaRule implements java.io.Serializable { actionsAndSets.trimToSize(); this.actionsAndSets = Collections.unmodifiableList(actionsAndSets); if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Conditions: " + conditions, module); + Debug.logVerbose("Conditions: " + conditions, module); if (Debug.verboseOn()) Debug.logVerbose("actions and sets (intermixed): " + actionsAndSets, module); } } diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/callops/SetServiceFields.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/callops/SetServiceFields.java index c363693d14..cb64d685fe 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/callops/SetServiceFields.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/callops/SetServiceFields.java @@ -87,7 +87,7 @@ public final class SetServiceFields extends MethodOperation { Map fromMap = mapFma.get(methodContext.getEnvMap()); if (fromMap == null) { if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("The from map in set-service-field was not found with name: " + mapFma, module); + Debug.logVerbose("The from map in set-service-field was not found with name: " + mapFma, module); } return true; } diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/envops/Iterate.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/envops/Iterate.java index 4914910a68..ebe9215294 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/envops/Iterate.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/envops/Iterate.java @@ -151,7 +151,7 @@ public final class Iterate extends MethodOperation { } } else { if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Cannot iterate over a " + objList == null ? "null object" : objList.getClass().getName() + Debug.logVerbose("Cannot iterate over a " + objList == null ? "null object" : objList.getClass().getName() + ", doing nothing: " + this, module); } return true; diff --git a/framework/security/src/main/java/org/apache/ofbiz/security/SecurityFactory.java b/framework/security/src/main/java/org/apache/ofbiz/security/SecurityFactory.java index 42f1acb089..696a9ec9a0 100644 --- a/framework/security/src/main/java/org/apache/ofbiz/security/SecurityFactory.java +++ b/framework/security/src/main/java/org/apache/ofbiz/security/SecurityFactory.java @@ -75,7 +75,7 @@ public final class SecurityFactory { security.setDelegator(delegator); security = authorizationCache.putIfAbsentAndGet(delegator.getDelegatorName(), security); if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Security implementation " + security.getClass().getName() + " created for delegator " + delegator.getDelegatorName(), module); + Debug.logVerbose("Security implementation " + security.getClass().getName() + " created for delegator " + delegator.getDelegatorName(), module); } } return security; diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/GenericAbstractDispatcher.java b/framework/service/src/main/java/org/apache/ofbiz/service/GenericAbstractDispatcher.java index 890a4976ce..e6e125d103 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/GenericAbstractDispatcher.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/GenericAbstractDispatcher.java @@ -71,7 +71,7 @@ public abstract class GenericAbstractDispatcher implements LocalDispatcher { getJobManager().schedule(jobName, poolName, serviceName, context, startTime, frequency, interval, count, endTime, maxRetry); if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("[LocalDispatcher.schedule] : Current time : " + (new Date()).getTime(), module); + Debug.logVerbose("[LocalDispatcher.schedule] : Current time : " + (new Date()).getTime(), module); if (Debug.verboseOn()) Debug.logVerbose("[LocalDispatcher.schedule] : Runtime : " + startTime, module); if (Debug.verboseOn()) Debug.logVerbose("[LocalDispatcher.schedule] : Frequency : " + frequency, module); if (Debug.verboseOn()) Debug.logVerbose("[LocalDispatcher.schedule] : Interval : " + interval, module); 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 1b42ed5259..5ca022cc81 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 @@ -205,7 +205,7 @@ public class RecurrenceInfo { } if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Date List Size: " + (rDateList == null ? 0 : rDateList.size()), module); + Debug.logVerbose("Date List Size: " + (rDateList == null ? 0 : rDateList.size()), module); if (Debug.verboseOn()) Debug.logVerbose("Rule List Size: " + (rRulesList == null ? 0 : rRulesList.size()), module); } diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/calendar/TemporalExpressions.java b/framework/service/src/main/java/org/apache/ofbiz/service/calendar/TemporalExpressions.java index 076dbeb8cb..8d2842f8b9 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/calendar/TemporalExpressions.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/calendar/TemporalExpressions.java @@ -68,7 +68,7 @@ public class TemporalExpressions implements Serializable { this.range = new org.apache.ofbiz.base.util.DateRange(start, end); this.sequence = SEQUENCE_DATE_RANGE; if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Created " + this, module); + Debug.logVerbose("Created " + this, module); } } @@ -162,7 +162,7 @@ public class TemporalExpressions implements Serializable { } this.sequence = SEQUENCE_DAY_IN_MONTH + (result * 10) + dayOfWeek; if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Created " + this, module); + Debug.logVerbose("Created " + this, module); } } @@ -313,7 +313,7 @@ public class TemporalExpressions implements Serializable { this.start = start; this.end = end; if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Created " + this, module); + Debug.logVerbose("Created " + this, module); } } @@ -433,7 +433,7 @@ public class TemporalExpressions implements Serializable { this.start = start; this.end = end; if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Created " + this, module); + Debug.logVerbose("Created " + this, module); } } @@ -565,7 +565,7 @@ public class TemporalExpressions implements Serializable { } this.sequence = included.sequence; if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Created " + this, module); + Debug.logVerbose("Created " + this, module); } } @@ -685,7 +685,7 @@ public class TemporalExpressions implements Serializable { this.freqType = freqType; this.freqCount = freqCount; if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Created " + this, module); + Debug.logVerbose("Created " + this, module); } } @@ -844,7 +844,7 @@ public class TemporalExpressions implements Serializable { this.end = end; this.sequence = SEQUENCE_HOUR_RANGE + start; if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Created " + this, module); + Debug.logVerbose("Created " + this, module); } } @@ -997,7 +997,7 @@ public class TemporalExpressions implements Serializable { this.sequence = result; } if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Created " + this, module); + Debug.logVerbose("Created " + this, module); } } @@ -1129,7 +1129,7 @@ public class TemporalExpressions implements Serializable { this.end = end; this.sequence = SEQUENCE_MINUTE_RANGE + start; if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Created " + this, module); + Debug.logVerbose("Created " + this, module); } } @@ -1280,7 +1280,7 @@ public class TemporalExpressions implements Serializable { this.start = start; this.end = end; if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Created " + this, module); + Debug.logVerbose("Created " + this, module); } } @@ -1437,7 +1437,7 @@ public class TemporalExpressions implements Serializable { } this.sequence = included.sequence; if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Created " + this, module); + Debug.logVerbose("Created " + this, module); } } @@ -1555,7 +1555,7 @@ public class TemporalExpressions implements Serializable { this.sequence = that.sequence; } if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Created " + this, module); + Debug.logVerbose("Created " + this, module); } } diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/eca/ServiceEcaRule.java b/framework/service/src/main/java/org/apache/ofbiz/service/eca/ServiceEcaRule.java index 578fd382ec..202370ad8f 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/eca/ServiceEcaRule.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/eca/ServiceEcaRule.java @@ -70,7 +70,7 @@ public final class ServiceEcaRule implements java.io.Serializable { } if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Conditions: " + conditions, module); + Debug.logVerbose("Conditions: " + conditions, module); } Set nameSet = UtilMisc.toSet("set", "action"); @@ -83,7 +83,7 @@ public final class ServiceEcaRule implements java.io.Serializable { } if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("actions and sets (intermixed): " + actionsAndSets, module); + Debug.logVerbose("actions and sets (intermixed): " + actionsAndSets, module); } } @@ -141,7 +141,7 @@ public final class ServiceEcaRule implements java.io.Serializable { break; } else { if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("For Service ECA [" + this.serviceName + "] on [" + this.eventName + "] got true for condition: " + ec, module); + Debug.logVerbose("For Service ECA [" + this.serviceName + "] on [" + this.eventName + "] got true for condition: " + ec, module); } } } diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/engine/XMLRPCClientEngine.java b/framework/service/src/main/java/org/apache/ofbiz/service/engine/XMLRPCClientEngine.java index 80faadbc0b..77a740a90f 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/engine/XMLRPCClientEngine.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/engine/XMLRPCClientEngine.java @@ -120,7 +120,7 @@ public class XMLRPCClientEngine extends GenericAsyncEngine { List inModelParamList = modelService.getInModelParamList(); if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("[XMLRPCClientEngine.invoke] : Parameter length - " + inModelParamList.size(), module); + Debug.logVerbose("[XMLRPCClientEngine.invoke] : Parameter length - " + inModelParamList.size(), module); for (ModelParam p: inModelParamList) { if (Debug.verboseOn()) Debug.logVerbose("[XMLRPCClientEngine.invoke} : Parameter: " + p.name + " (" + p.mode + ")", module); } 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 e298b4f530..f990ec17ac 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 @@ -114,7 +114,7 @@ public class PersistedServiceJob extends GenericServiceJob { throw new InvalidJobException("Unable to set the startDateTime and statusId on the current job [" + getJobId() + "]; not running!", e); } if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Placing job [" + getJobId() + "] in queue", module); + Debug.logVerbose("Placing job [" + getJobId() + "] in queue", module); } } @@ -141,7 +141,7 @@ public class PersistedServiceJob extends GenericServiceJob { throw new InvalidJobException("Unable to set the startDateTime and statusId on the current job [" + getJobId() + "]; not running!", e); } if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Job [" + getJobId() + "] running", module); + Debug.logVerbose("Job [" + getJobId() + "] running", module); } // configure any additional recurrences long maxRecurrenceCount = -1; @@ -365,7 +365,7 @@ public class PersistedServiceJob extends GenericServiceJob { throw new InvalidJobException("Unable to dequeue job [" + getJobId() + "]", e); } if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Job [" + getJobId() + "] not queued, rescheduling", module); + Debug.logVerbose("Job [" + getJobId() + "] not queued, rescheduling", module); } } 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 09521a76c2..8f4cca7f92 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 @@ -127,7 +127,7 @@ public class ServiceEventHandler implements EventHandler { } if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("[Processing]: SERVICE Event", module); + Debug.logVerbose("[Processing]: SERVICE Event", module); if (Debug.verboseOn()) Debug.logVerbose("[Using delegator]: " + dispatcher.getDelegator().getDelegatorName(), module); } diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/WidgetFactory.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/WidgetFactory.java index 88f72945cf..2c43b48d2f 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/WidgetFactory.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/WidgetFactory.java @@ -129,7 +129,7 @@ public class WidgetFactory { Assert.notNull("tagName", tagName, "widgetClass", widgetClass); screenWidgets.put(tagName, widgetClass.getConstructor(ModelScreen.class, Element.class)); if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Registered " + widgetClass.getName() + " with tag name " + tagName, module); + Debug.logVerbose("Registered " + widgetClass.getName() + " with tag name " + tagName, module); } } diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/UtilHelpText.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/UtilHelpText.java index b20986a9c5..e7ec7ceded 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/UtilHelpText.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/UtilHelpText.java @@ -74,12 +74,12 @@ public final class UtilHelpText { if (fieldDescription.equals(messageId)) { messageId = "FieldDescription." + fieldName; if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("No help text found in [" + entityResourceName + "] with key [" + messageId + "], Trying with: " + messageId, module); + Debug.logVerbose("No help text found in [" + entityResourceName + "] with key [" + messageId + "], Trying with: " + messageId, module); } fieldDescription = UtilProperties.getMessage(entityResourceName, messageId, locale); if (fieldDescription.equals(messageId)) { if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("No help text found in [" + entityResourceName + "] with key [" + messageId + "]", module); + Debug.logVerbose("No help text found in [" + entityResourceName + "] with key [" + messageId + "]", module); } return ""; } 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 57cb30e780..b94cd4bb20 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 @@ -130,7 +130,7 @@ public class MacroMenuRenderer implements MenuStringRenderer { } sb.append(" />"); if (Debug.verboseOn()) { - if (Debug.verboseOn()) Debug.logVerbose("Executing macro: " + sb, module); + Debug.logVerbose("Executing macro: " + sb, module); } executeMacro(writer, sb.toString()); }