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 6f0ee632eb..19d3955d41 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 @@ -164,7 +164,7 @@ public class InvoiceServices { String invoiceId = (String) context.get("invoiceId"); if (UtilValidate.isEmpty(billItems)) { - Debug.logVerbose("No order items to invoice; not creating invoice; returning success", module); + if (Debug.verboseOn()) Debug.logVerbose("No order items to invoice; not creating invoice; returning success", module); return ServiceUtil.returnSuccess(UtilProperties.getMessage(resource, "AccountingNoOrderItemsToInvoice", locale)); } @@ -1977,7 +1977,7 @@ public class InvoiceServices { String returnId = entry.getKey(); List billItems = entry.getValue(); if (Debug.verboseOn()) { - Debug.logVerbose("Creating invoice for return [" + returnId + "] with items: " + billItems.toString(), module); + if (Debug.verboseOn()) 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); @@ -2157,7 +2157,7 @@ public class InvoiceServices { return ServiceUtil.returnError(ServiceUtil.getErrorMessage(serviceResults)); } if (Debug.verboseOn()) { - Debug.logVerbose("Creating Invoice Item with amount " + returnPrice + " and quantity " + quantity + if (Debug.verboseOn()) Debug.logVerbose("Creating Invoice Item with amount " + returnPrice + " and quantity " + quantity + " for shipment [" + item.getString("shipmentId") + ":" + item.getString("shipmentItemSeqId") + "]", module); } @@ -2203,7 +2203,7 @@ public class InvoiceServices { BigDecimal amount = adjustment.getBigDecimal("amount"); amount = amount.multiply(ratio).setScale(DECIMALS, ROUNDING); if (Debug.verboseOn()) { - Debug.logVerbose("Creating Invoice Item with amount " + adjustment.getBigDecimal("amount") + " prorated to " + amount + if (Debug.verboseOn()) Debug.logVerbose("Creating Invoice Item with amount " + adjustment.getBigDecimal("amount") + " prorated to " + amount + " for return adjustment [" + adjustment.getString("returnAdjustmentId") + "]", module); } @@ -2263,7 +2263,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()) { - Debug.logVerbose("Creating Invoice Item with amount " + adjustment.getBigDecimal("amount") + " prorated to " + amount + if (Debug.verboseOn()) Debug.logVerbose("Creating Invoice Item with amount " + adjustment.getBigDecimal("amount") + " prorated to " + amount + " for return adjustment [" + adjustment.getString("returnAdjustmentId") + "]", module); } @@ -2381,8 +2381,8 @@ public class InvoiceServices { if (totalPayments.signum() == 1) { BigDecimal invoiceTotal = InvoiceWorker.getInvoiceTotal(delegator, invoiceId); if (Debug.verboseOn()) { - Debug.logVerbose("Invoice #" + invoiceId + " total: " + invoiceTotal, module); - Debug.logVerbose("Total payments : " + totalPayments, module); + if (Debug.verboseOn()) 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 // this invoice is paid diff --git a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/GiftCertificateServices.java b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/GiftCertificateServices.java index 89e467b6c6..41aab3b505 100644 --- a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/GiftCertificateServices.java +++ b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/GiftCertificateServices.java @@ -1291,7 +1291,7 @@ public class GiftCertificateServices { return ServiceUtil.returnError(UtilProperties.getMessage(resourceOrderError, "OrderErrorCreateReturnItemWithoutId", locale)); } else { - Debug.logVerbose("Created return item : " + returnId + " / " + returnItemSeqId, module); + if (Debug.verboseOn()) Debug.logVerbose("Created return item : " + returnId + " / " + returnItemSeqId, module); } // need the system userLogin to "fake" out the update service 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 06c3c1de1b..0a848e9ac8 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()) { - Debug.logVerbose("ClearCommerce server URL: " + serverURL, module); + if (Debug.verboseOn()) 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()) { - Debug.logVerbose("ClearCommerce XML request string: " + xmlString, module); + if (Debug.verboseOn()) Debug.logVerbose("ClearCommerce XML request string: " + xmlString, module); } HttpClient http = new HttpClient(serverURL); @@ -925,7 +925,7 @@ public class CCPaymentServices { } if (Debug.verboseOn()) Debug.logVerbose("Result severity from clearCommerce:" + getMessageListMaxSev(responseDocument), module); if (Debug.verboseOn() && getMessageListMaxSev(responseDocument) > 4) - Debug.logVerbose("Returned messages:" + getMessageList(responseDocument),module); + if (Debug.verboseOn()) Debug.logVerbose("Returned messages:" + getMessageList(responseDocument),module); return responseDocument; } diff --git a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/ideal/IdealEvents.java b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/ideal/IdealEvents.java index a05fb91bec..56adde28f7 100644 --- a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/ideal/IdealEvents.java +++ b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/ideal/IdealEvents.java @@ -304,7 +304,7 @@ public class IdealEvents { } private static boolean setPaymentPreferences(Delegator delegator, LocalDispatcher dispatcher, GenericValue userLogin, String orderId, HttpServletRequest request) { - Debug.logVerbose("Setting payment prefrences..", module); + if (Debug.verboseOn()) Debug.logVerbose("Setting payment prefrences..", module); List paymentPrefs = null; try { paymentPrefs = EntityQuery.use(delegator).from("OrderPaymentPreference") 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..4b61613ac0 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()) { - Debug.logVerbose("Response from Verisign: " + resp, module); + if (Debug.verboseOn()) Debug.logVerbose("Response from Verisign: " + resp, module); } if (isPayPal) { // Attach the avs info returned in doExpressCheckout and stored in PayPalPaymentMethod 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 3df6598ad7..c17ed31953 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 @@ -401,7 +401,7 @@ public class WorldPayEvents { } private static boolean setPaymentPreferences(Delegator delegator, LocalDispatcher dispatcher, GenericValue userLogin, String orderId, HttpServletRequest request) { - Debug.logVerbose("Setting payment preferences..", module); + if (Debug.verboseOn()) Debug.logVerbose("Setting payment preferences..", module); List paymentPrefs = null; try { paymentPrefs = EntityQuery.use(delegator).from("OrderPaymentPreference") diff --git a/applications/content/src/main/java/org/apache/ofbiz/content/cms/CmsEvents.java b/applications/content/src/main/java/org/apache/ofbiz/content/cms/CmsEvents.java index 8eb868e1cf..59245c6ded 100644 --- a/applications/content/src/main/java/org/apache/ofbiz/content/cms/CmsEvents.java +++ b/applications/content/src/main/java/org/apache/ofbiz/content/cms/CmsEvents.java @@ -248,11 +248,11 @@ public class CmsEvents { } if (errorPage != null) { if (Debug.verboseOn()) - Debug.logVerbose("Found error pages " + statusCode + " : " + errorPage, module); + if (Debug.verboseOn()) Debug.logVerbose("Found error pages " + statusCode + " : " + errorPage, module); contentId = errorPage.getString("contentId"); } else { if (Debug.verboseOn()) - Debug.logVerbose("No specific error page, falling back to the Error Container for " + statusCode, module); + if (Debug.verboseOn()) Debug.logVerbose("No specific error page, falling back to the Error Container for " + statusCode, module); contentId = errorContainer.getString("contentId"); } mapKey = null; @@ -263,7 +263,7 @@ public class CmsEvents { try { GenericValue errorPage = EntityQuery.use(delegator).from("Content").where("contentId", "CONTENT_ERROR_" + statusCode).cache().queryOne(); if (errorPage != null) { - Debug.logVerbose("Found generic page " + statusCode, module); + if (Debug.verboseOn()) Debug.logVerbose("Found generic page " + statusCode, module); contentId = errorPage.getString("contentId"); mapKey = null; hasErrorPage = true; diff --git a/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentServicesComplex.java b/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentServicesComplex.java index 5d7d862e26..73e677a7f2 100644 --- a/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentServicesComplex.java +++ b/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentServicesComplex.java @@ -140,7 +140,7 @@ public class ContentServicesComplex { } for (int i=0; i < relatedAssocs.size(); i++) { GenericValue a = relatedAssocs.get(i); - Debug.logVerbose(" contentId:" + a.get("contentId") + " To:" + a.get("caContentIdTo") + " fromDate:" + a.get("caFromDate") + " thruDate:" + a.get("caThruDate") + " AssocTypeId:" + a.get("caContentAssocTypeId"), null); + if (Debug.verboseOn()) Debug.logVerbose(" contentId:" + a.get("contentId") + " To:" + a.get("caContentIdTo") + " fromDate:" + a.get("caFromDate") + " thruDate:" + a.get("caThruDate") + " AssocTypeId:" + a.get("caContentAssocTypeId"), null); } Map results = new HashMap(); results.put("entityList", relatedAssocs); 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 990571cb26..4b220fbe89 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()) { - Debug.logVerbose("in updateElectronicText, textData:" + textData, module); + if (Debug.verboseOn()) 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 b45511745a..bcfe228762 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 @@ -173,7 +173,7 @@ public class LayoutEvents { return "error"; } String imageFileName = (String) uploadResults.get("imageFileName"); - Debug.logVerbose("in createLayoutImage(java), context:" + context, ""); + if (Debug.verboseOn()) Debug.logVerbose("in createLayoutImage(java), context:" + context, ""); context.put("userLogin", session.getAttribute("userLogin")); context.put("dataResourceTypeId", "IMAGE_OBJECT"); context.put("contentAssocTypeId", "SUB_CONTENT"); @@ -185,13 +185,13 @@ public class LayoutEvents { context.put("drDataResourceTypeId", null); String dataResourceId = (String) context.get("drDataResourceId"); - Debug.logVerbose("in createLayoutImage(java), dataResourceId:" + dataResourceId, ""); + if (Debug.verboseOn()) Debug.logVerbose("in createLayoutImage(java), dataResourceId:" + dataResourceId, ""); GenericValue dataResource = EntityQuery.use(delegator).from("DataResource").where("dataResourceId", dataResourceId).queryOne(); - Debug.logVerbose("in createLayoutImage(java), dataResource:" + dataResource, ""); + if (Debug.verboseOn()) Debug.logVerbose("in createLayoutImage(java), dataResource:" + dataResource, ""); // Use objectInfo field to store the name of the file, since there is no // place in ImageDataResource for it. - Debug.logVerbose("in createLayoutImage(java), imageFileName:" + imageFileName, ""); + if (Debug.verboseOn()) Debug.logVerbose("in createLayoutImage(java), imageFileName:" + imageFileName, ""); if (dataResource != null) { dataResource.setNonPKFields(context); dataResource.store(); @@ -220,7 +220,7 @@ public class LayoutEvents { Locale locale = UtilHttp.getLocale(request); Map context = new HashMap(); Map paramMap = UtilHttp.getParameterMap(request); - Debug.logVerbose("in replaceSubContent, paramMap:" + paramMap, module); + if (Debug.verboseOn()) Debug.logVerbose("in replaceSubContent, paramMap:" + paramMap, module); String dataResourceId = (String) paramMap.get("dataResourceId"); if (UtilValidate.isEmpty(dataResourceId)) { String errMsg = UtilProperties.getMessage(LayoutEvents.err_resource, "layoutEvents.data_ressource_id_null", locale); @@ -276,14 +276,14 @@ public class LayoutEvents { Locale locale = UtilHttp.getLocale(request); Map paramMap = UtilHttp.getParameterMap(request); String contentId = (String) paramMap.get("contentId"); - Debug.logVerbose("in cloneLayout, contentId:" + contentId, ""); + if (Debug.verboseOn()) Debug.logVerbose("in cloneLayout, contentId:" + contentId, ""); if (UtilValidate.isEmpty(contentId)) { String errMsg = UtilProperties.getMessage(LayoutEvents.err_resource, "layoutEvents.content_id_empty", locale); request.setAttribute("_ERROR_MESSAGE_", errMsg); return "error"; } String contentIdTo = (String) paramMap.get("contentIdTo"); - Debug.logVerbose("in cloneLayout, contentIdTo:" + contentIdTo, ""); + if (Debug.verboseOn()) Debug.logVerbose("in cloneLayout, contentIdTo:" + contentIdTo, ""); GenericValue content = null; GenericValue newContent = null; GenericValue userLogin = (GenericValue) request.getSession().getAttribute("userLogin"); @@ -293,14 +293,14 @@ public class LayoutEvents { String newDataResourceId = null; try { content = EntityQuery.use(delegator).from("Content").where("contentId", contentId).queryOne(); - Debug.logVerbose("in cloneLayout, content:" + content, ""); + if (Debug.verboseOn()) Debug.logVerbose("in cloneLayout, content:" + content, ""); if (content == null) { String errMsg = UtilProperties.getMessage(LayoutEvents.err_resource, "layoutEvents.content_empty", locale); request.setAttribute("_ERROR_MESSAGE_", errMsg); return "error"; } newContent = delegator.makeValue("Content", content); - Debug.logVerbose("in cloneLayout, newContent:" + newContent, ""); + if (Debug.verboseOn()) Debug.logVerbose("in cloneLayout, newContent:" + newContent, ""); String oldName = (String) content.get("contentName"); newId = delegator.getNextSeqId("Content"); newContent.set("contentId", newId); @@ -308,7 +308,7 @@ public class LayoutEvents { GenericValue dataResource = EntityQuery.use(delegator).from("DataResource").where("dataResourceId", dataResourceId).queryOne(); if (dataResource != null) { GenericValue newDataResource = delegator.makeValue("DataResource", dataResource); - Debug.logVerbose("in cloneLayout, newDataResource:" + newDataResource, ""); + if (Debug.verboseOn()) Debug.logVerbose("in cloneLayout, newDataResource:" + newDataResource, ""); String dataResourceName = "Copy:" + (String) dataResource.get("dataResourceName"); newDataResource.set("dataResourceName", dataResourceName); newDataResourceId = delegator.getNextSeqId("DataResource"); @@ -325,7 +325,7 @@ public class LayoutEvents { newContent.set("createdByUserLogin", userLoginId); newContent.set("lastModifiedByUserLogin", userLoginId); newContent.create(); - Debug.logVerbose("in cloneLayout, newContent:" + newContent, ""); + if (Debug.verboseOn()) Debug.logVerbose("in cloneLayout, newContent:" + newContent, ""); GenericValue newContentAssoc = delegator.makeValue("ContentAssoc"); newContentAssoc.set("contentId", newId); @@ -333,7 +333,7 @@ public class LayoutEvents { newContentAssoc.set("contentAssocTypeId", "SUB_CONTENT"); newContentAssoc.set("fromDate", UtilDateTime.nowTimestamp()); newContentAssoc.create(); - Debug.logVerbose("in cloneLayout, newContentAssoc:" + newContentAssoc, ""); + if (Debug.verboseOn()) Debug.logVerbose("in cloneLayout, newContentAssoc:" + newContentAssoc, ""); } catch (GenericEntityException e) { request.setAttribute("_ERROR_MESSAGE_", e.getMessage()); return "error"; @@ -382,7 +382,7 @@ public class LayoutEvents { String mapKey = (String) view.get("caMapKey"); Timestamp fromDate = (Timestamp) view.get("caFromDate"); Timestamp thruDate = (Timestamp) view.get("caThruDate"); - Debug.logVerbose("in cloneLayout, contentIdFrom:" + contentIdFrom + " fromDate:" + fromDate + " thruDate:" + thruDate + " mapKey:" + mapKey, ""); + if (Debug.verboseOn()) Debug.logVerbose("in cloneLayout, contentIdFrom:" + contentIdFrom + " fromDate:" + fromDate + " thruDate:" + thruDate + " mapKey:" + mapKey, ""); if (beenThere.get(contentIdFrom) == null) { serviceIn.put("contentIdFrom", contentIdFrom); serviceIn.put("contentIdTo", newId); @@ -401,7 +401,7 @@ public class LayoutEvents { GenericValue view = delegator.makeValue("ContentDataResourceView"); view.set("contentId", newId); view.set("drDataResourceId", newDataResourceId); - Debug.logVerbose("in cloneLayout, view:" + view, ""); + if (Debug.verboseOn()) Debug.logVerbose("in cloneLayout, view:" + view, ""); ContentManagementWorker.setCurrentEntityMap(request, view); request.setAttribute("contentId", view.get("contentId")); request.setAttribute("drDataResourceId", view.get("drDataResourceId")); @@ -416,8 +416,8 @@ public class LayoutEvents { String contentIdTo = (String) paramMap.get("contentIdTo"); String mapKey = (String) paramMap.get("mapKey"); if (Debug.verboseOn()) { - Debug.logVerbose("in createSubContent, contentIdTo:" + contentIdTo, module); - Debug.logVerbose("in createSubContent, mapKey:" + mapKey, module); + if (Debug.verboseOn()) Debug.logVerbose("in createSubContent, contentIdTo:" + contentIdTo, module); + if (Debug.verboseOn()) Debug.logVerbose("in createSubContent, mapKey:" + mapKey, module); } Map context = new HashMap(); List errorMessages = new LinkedList<>(); @@ -449,7 +449,7 @@ public class LayoutEvents { context.put("textData", paramMap.get("textData")); context.put("contentAssocTypeId", "SUB_CONTENT"); if (Debug.verboseOn()) { - Debug.logVerbose("in createSubContent, context:" + context, module); + if (Debug.verboseOn()) 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()) { - Debug.logVerbose("in createLayoutFile, result:" + result, module); + if (Debug.verboseOn()) Debug.logVerbose("in createLayoutFile, result:" + result, module); } String contentId = (String) result.get("contentId"); String dataResourceId = (String) result.get("dataResourceId"); @@ -553,8 +553,8 @@ public class LayoutEvents { if (attrVal == null) { attrVal = (String) paramMap.get(attrName); } - Debug.logVerbose("in copyToClip, attrName:" + attrName,""); - Debug.logVerbose("in copyToClip, attrVal:" + attrVal,""); + if (Debug.verboseOn()) Debug.logVerbose("in copyToClip, attrName:" + attrName,""); + if (Debug.verboseOn()) Debug.logVerbose("in copyToClip, attrVal:" + attrVal,""); if (UtilValidate.isNotEmpty(attrVal)) { passedPK.put(attrName,attrVal); } else { diff --git a/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/EditRenderSubContentCacheTransform.java b/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/EditRenderSubContentCacheTransform.java index 1a20c50927..3693fd769d 100644 --- a/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/EditRenderSubContentCacheTransform.java +++ b/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/EditRenderSubContentCacheTransform.java @@ -162,7 +162,7 @@ public class EditRenderSubContentCacheTransform implements TemplateTransformMode if (Debug.verboseOn()) { for (Entry ky : templateCtx.entrySet()) { Object val = ky.getValue();; - Debug.logVerbose("context key: " + ky + " val: " + val, module); + if (Debug.verboseOn()) Debug.logVerbose("context key: " + ky + " val: " + val, module); } } 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 ffe05a7cc2..c83cc9c9a3 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()) { - Debug.logVerbose("in RenderSubContent, contentId(0):" + templateRoot.get("contentId"), module); + if (Debug.verboseOn()) 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()) { - Debug.logVerbose("in RenderSubContent, contentId(2):" + templateRoot.get("contentId"), module); + if (Debug.verboseOn()) 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()) { - Debug.logVerbose("in Render(0), directAssocMode ." + directAssocMode , module); + if (Debug.verboseOn()) 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()) { - Debug.logVerbose("Render close, globalNodeTrail(2a):" + ContentWorker.nodeTrailToCsv(globalNodeTrail), ""); + if (Debug.verboseOn()) 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()) { - Debug.logVerbose("in Render(3), editRequestName ." + editRequestName , module); + if (Debug.verboseOn()) Debug.logVerbose("in Render(3), editRequestName ." + editRequestName , module); } if (UtilValidate.isNotEmpty(editRequestName)) { @@ -122,8 +122,8 @@ public class RenderContentAsText implements TemplateTransformModel { } if (Debug.verboseOn()) { - Debug.logVerbose("in RenderSubContent, contentId(2):" + templateRoot.get("contentId"), module); - Debug.logVerbose("in RenderSubContent, subContentId(2):" + templateRoot.get("subContentId"), module); + if (Debug.verboseOn()) 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); try { 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 885d54c41d..e30fba0c7a 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 @@ -4409,7 +4409,7 @@ public class OrderServices { } if (Debug.verboseOn()) - Debug.logVerbose("To Store Contains: " + toStore, module); + if (Debug.verboseOn()) Debug.logVerbose("To Store Contains: " + toStore, module); // remove any order item attributes that were set to empty try { diff --git a/applications/party/src/main/java/org/apache/ofbiz/party/communication/CommunicationEventServices.java b/applications/party/src/main/java/org/apache/ofbiz/party/communication/CommunicationEventServices.java index 7305b5c34b..b83cab1e3c 100644 --- a/applications/party/src/main/java/org/apache/ofbiz/party/communication/CommunicationEventServices.java +++ b/applications/party/src/main/java/org/apache/ofbiz/party/communication/CommunicationEventServices.java @@ -1165,7 +1165,7 @@ public class CommunicationEventServices { part2Text = ""; } if (Debug.verboseOn()) - Debug.logVerbose("Part 2 Text :\n\n" + part2Text, module); + if (Debug.verboseOn()) Debug.logVerbose("Part 2 Text :\n\n" + part2Text, module); // find the "Action" element and obtain its value (looking for "failed") Pattern p2 = Pattern.compile("^Action: (.*)$", Pattern.MULTILINE | Pattern.CASE_INSENSITIVE); @@ -1182,7 +1182,7 @@ public class CommunicationEventServices { part3Text = ""; } if (Debug.verboseOn()) - Debug.logVerbose("Part 3 Text :\n\n" + part3Text, module); + if (Debug.verboseOn()) Debug.logVerbose("Part 3 Text :\n\n" + part3Text, module); // find the "Message-Id" element and obtain its value (looking for "failed") Pattern p3 = Pattern.compile("^Message-Id: (.*)$", Pattern.MULTILINE | Pattern.CASE_INSENSITIVE); diff --git a/applications/product/src/main/java/org/apache/ofbiz/product/category/ftl/SeoTransform.java b/applications/product/src/main/java/org/apache/ofbiz/product/category/ftl/SeoTransform.java index 1938455e31..c1bc4d999b 100644 --- a/applications/product/src/main/java/org/apache/ofbiz/product/category/ftl/SeoTransform.java +++ b/applications/product/src/main/java/org/apache/ofbiz/product/category/ftl/SeoTransform.java @@ -176,7 +176,7 @@ public class SeoTransform implements TemplateTransformModel { } } if (!foundMatch) { - Debug.logVerbose("Can NOT find a seo transform pattern for this url: " + url, module); + if (Debug.verboseOn()) Debug.logVerbose("Can NOT find a seo transform pattern for this url: " + url, module); } } return url; 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 61dcb05a83..87ab40cfed 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 @@ -178,7 +178,7 @@ public class UrlRegexpTransform implements TemplateTransformModel { } } if (!foundMatch) { - Debug.logVerbose("Can NOT find a seo transform pattern for this url: " + url, module); + if (Debug.verboseOn()) Debug.logVerbose("Can NOT find a seo transform pattern for this url: " + url, module); } } return url; 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 e118def115..a251ade57a 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()) { - Debug.logVerbose("productIdTo = " + productIdTo + " assocQuantity = " + assocQuantity + "current QOH " + currentQuantityOnHandTotal + + if (Debug.verboseOn()) 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 327a8f2dd3..9ab92a6676 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,10 +982,10 @@ public class PriceServices { } if (Debug.verboseOn()) { - Debug.logVerbose("Unchecked Calculated price: " + price, module); - Debug.logVerbose("PriceInfo:", module); + if (Debug.verboseOn()) Debug.logVerbose("Unchecked Calculated price: " + price, module); + if (Debug.verboseOn()) Debug.logVerbose("PriceInfo:", module); for (GenericValue orderItemPriceInfo: orderItemPriceInfos) { - Debug.logVerbose(" --- " + orderItemPriceInfo.toString(), module); + 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 edfb2427a2..57e647339d 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,8 +121,8 @@ public class DhlServices { } if (Debug.verboseOn()) { - Debug.logVerbose("DHL Connect URL : " + conStr, module); - Debug.logVerbose("DHL XML String : " + xmlString, module); + if (Debug.verboseOn()) Debug.logVerbose("DHL Connect URL : " + conStr, module); + if (Debug.verboseOn()) Debug.logVerbose("DHL XML String : " + xmlString, module); } HttpClient http = new HttpClient(conStr); @@ -141,7 +141,7 @@ public class DhlServices { "FacilityShipmentDhlReceivedNullResponse", locale)); } if (Debug.verboseOn()) { - Debug.logVerbose("DHL Response : " + response, module); + if (Debug.verboseOn()) 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 f7d87381a6..87fb8ebd70 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,8 +118,8 @@ public class FedexServices { } if (Debug.verboseOn()) { - Debug.logVerbose("Fedex Connect URL : " + url, module); - Debug.logVerbose("Fedex XML String : " + xmlString, module); + if (Debug.verboseOn()) Debug.logVerbose("Fedex Connect URL : " + url, module); + if (Debug.verboseOn()) Debug.logVerbose("Fedex XML String : " + xmlString, module); } HttpClient http = new HttpClient(url); @@ -138,7 +138,7 @@ public class FedexServices { "FacilityShipmentFedexReceivedNullResponse", locale)); } if (Debug.verboseOn()) { - Debug.logVerbose("Fedex Response : " + response, module); + if (Debug.verboseOn()) 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 35658266e1..c052962675 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()) { - Debug.logVerbose("Cookies:" + Arrays.toString(cookies), module); + if (Debug.verboseOn()) 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 5a1fa43800..545a6fcc18 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 @@ -368,9 +368,9 @@ public class ICalConverter { if (Debug.verboseOn()) { try { alarm.validate(true); - Debug.logVerbose("iCalendar alarm passes validation", module); + if (Debug.verboseOn()) Debug.logVerbose("iCalendar alarm passes validation", module); } catch (ValidationException e) { - Debug.logVerbose("iCalendar alarm fails validation: " + e, module); + if (Debug.verboseOn()) Debug.logVerbose("iCalendar alarm fails validation: " + e, module); } } } @@ -413,9 +413,9 @@ public class ICalConverter { if (Debug.verboseOn()) { try { calendar.validate(true); - Debug.logVerbose("iCalendar passes validation", module); + if (Debug.verboseOn()) Debug.logVerbose("iCalendar passes validation", module); } catch (ValidationException e) { - Debug.logVerbose("iCalendar fails validation: " + e, module); + if (Debug.verboseOn()) Debug.logVerbose("iCalendar fails validation: " + e, module); } } return ICalWorker.createOkResponse(calendar.toString()); @@ -575,10 +575,10 @@ public class ICalConverter { boolean newCalendar = true; Calendar calendar = null; if (iCalData == null) { - Debug.logVerbose("iCalendar Data not found, creating new Calendar", module); + if (Debug.verboseOn()) Debug.logVerbose("iCalendar Data not found, creating new Calendar", module); calendar = new Calendar(); } else { - Debug.logVerbose("iCalendar Data found, using saved Calendar", module); + if (Debug.verboseOn()) Debug.logVerbose("iCalendar Data found, using saved Calendar", module); StringReader reader = new StringReader(iCalData); CalendarBuilder builder = new CalendarBuilder(); try { @@ -696,7 +696,7 @@ public class ICalConverter { } } if (Debug.verboseOn()) { - Debug.logVerbose("Processing calendar:\r\n" + calendar, module); + if (Debug.verboseOn()) Debug.logVerbose("Processing calendar:\r\n" + calendar, module); } String workEffortId = fromXProperty(calendar.getProperties(), workEffortIdXPropName); if (workEffortId == null) { @@ -921,7 +921,7 @@ public class ICalConverter { if (Debug.verboseOn()) { try { result.validate(true); - Debug.logVerbose("iCalendar component passes validation", module); + if (Debug.verboseOn()) Debug.logVerbose("iCalendar component passes validation", module); } catch (ValidationException e) { Debug.logVerbose(e, "iCalendar component fails validation: ", module); } 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 2850f4c37e..8a5b79d2b8 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()) { - Debug.logVerbose("[handlePropFindRequest] PROPFIND body:\r\n" + UtilXml.writeXmlDocument(requestDocument), module); + if (Debug.verboseOn()) 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()) { - Debug.logVerbose("[handlePropFindRequest] PROPFIND response:\r\n" + UtilXml.writeXmlDocument(responseDocument), module); + if (Debug.verboseOn()) 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()) { - Debug.logVerbose("Returning response: code = " + responseProps.statusCode + + if (Debug.verboseOn()) 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 02f07e5edb..eb446f415c 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()) { - Debug.logVerbose("Read component config : [" + rootLocation + "]", module); + if (Debug.verboseOn()) 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 cdcac28713..e6c858b23c 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()) { - Debug.logVerbose("Created " + this.toString(), module); + if (Debug.verboseOn()) 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 c911eb8f31..6717891eb5 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()) { - Debug.logVerbose("Getting converter: " + key, module); + if (Debug.verboseOn()) Debug.logVerbose("Getting converter: " + key, module); } OUTER: do { @@ -195,7 +195,7 @@ OUTER: sb.append(targetClass.getName()); String key = sb.toString(); if (converterMap.putIfAbsent(key, converter) == null) { - Debug.logVerbose("Registered converter " + converter.getClass().getName(), module); + if (Debug.verboseOn()) Debug.logVerbose("Registered converter " + converter.getClass().getName(), module); } } 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 108d00060e..1ec5ae86fc 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()) { - Debug.logVerbose("Evaluating -- " + expression, module); - Debug.logVerbose("Using Context -- " + context, module); + if (Debug.verboseOn()) 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()) { - Debug.logVerbose("Evaluated to -- " + o, module); + if (Debug.verboseOn()) 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()) { - Debug.logVerbose("Cached Groovy script at: " + location, module); + if (Debug.verboseOn()) 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/HttpClient.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/HttpClient.java index 2f06af39e4..354269b4a6 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/HttpClient.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/HttpClient.java @@ -486,16 +486,16 @@ public class HttpClient { OutputStreamWriter out = new OutputStreamWriter(con.getOutputStream(), this.streamCharset != null ? this.streamCharset : "UTF-8")) { if (Debug.verboseOn() || debug) - Debug.logVerbose("Opened output stream", module); + if (Debug.verboseOn()) Debug.logVerbose("Opened output stream", module); if (arguments != null) { out.write(arguments); if (Debug.verboseOn() || debug) - Debug.logVerbose("Wrote arguements (parameters) : " + arguments, module); + if (Debug.verboseOn()) Debug.logVerbose("Wrote arguements (parameters) : " + arguments, module); } if (Debug.verboseOn() || debug) - Debug.logVerbose("Flushed and closed buffer", module); + if (Debug.verboseOn()) Debug.logVerbose("Flushed and closed buffer", module); } } 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 e79812ba05..f63c39234d 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()) { - Debug.logVerbose("In ObjectType.isEmpty(Object value) returning false for " + value.getClass() + " Object.", module); + if (Debug.verboseOn()) 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 e9aa853fcf..7373c54b36 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()) { - Debug.logVerbose("Compiled and cached the pattern: '" + stringPattern, module); + if (Debug.verboseOn()) Debug.logVerbose("Compiled and cached the pattern: '" + stringPattern, module); } } return pattern; diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/SSLUtil.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/SSLUtil.java index 8cb278cd74..a1083215fe 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/SSLUtil.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/SSLUtil.java @@ -134,7 +134,7 @@ public final class SSLUtil { List newKeyManagers = Arrays.asList(getKeyManagers(ks, ksi.getPassword(), alias)); keyMgrs.addAll(newKeyManagers); if (Debug.verboseOn()) - Debug.logVerbose("Loaded another cert store, adding [" + newKeyManagers.size() + if (Debug.verboseOn()) Debug.logVerbose("Loaded another cert store, adding [" + newKeyManagers.size() + "] KeyManagers for alias [" + alias + "] and keystore: " + ksi.createResourceHandler() .getFullLocation(), module); } else { 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 6f21d8aa06..77ca215b06 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()) { - Debug.logVerbose("ScriptHelper factory set to " + helperFactory.getClass().getName(), module); + if (Debug.verboseOn()) 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()) { - Debug.logVerbose("Compiled script " + filePath + " using engine " + engine.getClass().getName(), module); + if (Debug.verboseOn()) Debug.logVerbose("Compiled script " + filePath + " using engine " + engine.getClass().getName(), module); } } catch (ClassCastException e) { if (Debug.verboseOn()) { - Debug.logVerbose("Script engine " + engine.getClass().getName() + " does not implement Compilable", module); + if (Debug.verboseOn()) 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()) { - Debug.logVerbose("Compiled script [" + script + "] using engine " + engine.getClass().getName(), module); + if (Debug.verboseOn()) Debug.logVerbose("Compiled script [" + script + "] using engine " + engine.getClass().getName(), module); } } catch (ClassCastException e) { if (Debug.verboseOn()) { - Debug.logVerbose("Script engine " + engine.getClass().getName() + " does not implement Compilable", module); + if (Debug.verboseOn()) 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()) { - Debug.logVerbose("Begin processing script [" + script + "] using engine " + engine.getClass().getName(), module); + if (Debug.verboseOn()) 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()) { - Debug.logVerbose("Invoking function/method " + functionName, module); + if (Debug.verboseOn()) 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()) { - Debug.logVerbose("Begin processing script [" + filePath + "] using engine " + engine.getClass().getName(), module); + if (Debug.verboseOn()) 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 757543290f..eb0f46f407 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()) { - Debug.logVerbose("Converted " + expression + " to " + result, module); + if (Debug.verboseOn()) 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 293077acb1..15efced490 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()) { - Debug.logVerbose("Made Request Parameter Map with [" + paramMap.size() + "] Entries", module); + if (Debug.verboseOn()) 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,8 +319,8 @@ public final class UtilHttp { } if (Debug.verboseOn()) { - Debug.logVerbose("Made Request Attribute Map with [" + attributeMap.size() + "] Entries", module); - Debug.logVerbose("Request Attribute Map Entries: " + System.getProperty("line.separator") + UtilMisc.printMap(attributeMap), module); + if (Debug.verboseOn()) 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); } return attributeMap; @@ -354,8 +354,8 @@ public final class UtilHttp { } if (Debug.verboseOn()) { - Debug.logVerbose("Made Session Attribute Map with [" + sessionMap.size() + "] Entries", module); - Debug.logVerbose("Session Attribute Map Entries: " + System.getProperty("line.separator") + UtilMisc.printMap(sessionMap), module); + if (Debug.verboseOn()) 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); } return sessionMap; @@ -389,8 +389,8 @@ public final class UtilHttp { } if (Debug.verboseOn()) { - Debug.logVerbose("Made ServletContext Attribute Map with [" + servletCtxMap.size() + "] Entries", module); - Debug.logVerbose("ServletContext Attribute Map Entries: " + System.getProperty("line.separator") + UtilMisc.printMap(servletCtxMap), module); + if (Debug.verboseOn()) 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); } return servletCtxMap; 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 944ac30854..f0ade9cf97 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()) { - Debug.logVerbose("FlexibleMapAccessor created, original = " + this.original, module); + if (Debug.verboseOn()) 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()) { - Debug.logVerbose("UEL exception while getting value: " + e + ", original = " + this.original, module); + if (Debug.verboseOn()) 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 22296e8661..dbac966fde 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 @@ -602,7 +602,7 @@ public abstract class FlexibleStringExpander implements Serializable, IsEmpty { } } catch (PropertyNotFoundException e) { if (Debug.verboseOn()) { - Debug.logVerbose("Error evaluating expression: " + e, module); + if (Debug.verboseOn()) Debug.logVerbose("Error evaluating expression: " + e, module); } } catch (Exception e) { Debug.logError("Error evaluating expression: " + e, module); @@ -656,7 +656,7 @@ public abstract class FlexibleStringExpander implements Serializable, IsEmpty { return obj; } else { if (Debug.verboseOn()) { - Debug.logVerbose("Scriptlet evaluated to null [" + this + "].", module); + if (Debug.verboseOn()) Debug.logVerbose("Scriptlet evaluated to null [" + this + "].", module); } } } catch (Exception e) { @@ -691,7 +691,7 @@ public abstract class FlexibleStringExpander implements Serializable, IsEmpty { return UelUtil.evaluate(context, openBracket.concat(expr.toString()).concat(closeBracket)); } catch (PropertyNotFoundException e) { if (Debug.verboseOn()) { - Debug.logVerbose("Error evaluating expression: " + e, module); + if (Debug.verboseOn()) Debug.logVerbose("Error evaluating expression: " + e, module); } } catch (Exception e) { Debug.logError("Error evaluating expression: " + e, module); @@ -716,7 +716,7 @@ public abstract class FlexibleStringExpander implements Serializable, IsEmpty { obj = UelUtil.evaluate(context, new String(this.bracketedOriginal)); } catch (PropertyNotFoundException e) { if (Debug.verboseOn()) { - Debug.logVerbose("Error evaluating expression " + this + ": " + e, module); + if (Debug.verboseOn()) 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 8dc51ff2c0..a160ce75e2 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 @@ -86,7 +86,7 @@ public class JuelConnector { if (base == null) { base = UelUtil.autoVivifyListOrMap(property); if (Debug.verboseOn()) { - Debug.logVerbose("ExtendedAstBracket.setValue auto-vivify base: " + base + ", property = " + property, module); + if (Debug.verboseOn()) Debug.logVerbose("ExtendedAstBracket.setValue auto-vivify base: " + base + ", property = " + property, module); } prefix.setValue(bindings, context, base); } @@ -120,7 +120,7 @@ public class JuelConnector { if (base == null) { base = UelUtil.autoVivifyListOrMap(property); if (Debug.verboseOn()) { - Debug.logVerbose("ExtendedAstDot.setValue auto-vivify base: " + base + ", property = " + property, module); + if (Debug.verboseOn()) 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/UelFunctions.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/string/UelFunctions.java index 3773e5f63e..6111bb5e86 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/string/UelFunctions.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/string/UelFunctions.java @@ -264,7 +264,7 @@ public class UelFunctions { } catch (Exception e) { Debug.logError(e, "Error while initializing UelFunctions.Functions instance", module); } - Debug.logVerbose("UelFunctions.Functions loaded " + this.functionMap.size() + " functions", module); + if (Debug.verboseOn()) Debug.logVerbose("UelFunctions.Functions loaded " + this.functionMap.size() + " functions", module); } @Override public Method resolveFunction(String prefix, String localName) { 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 ee2d1e49ba..611d626d8e 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()) { - Debug.logVerbose("UelUtil.setValue invoked, expression = " + expression + ", value = " + value, module); + if (Debug.verboseOn()) 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()) { - Debug.logVerbose("UelUtil.removeValue invoked, expression = " + expression , module); + if (Debug.verboseOn()) 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()) { - Debug.logVerbose("ExtendedCompositeResolver.setValue: base = " + base + ", property = " + property + ", value = " + val, module); + if (Debug.verboseOn()) 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()) { - Debug.logVerbose("ExtendedListResolver.setValue adding List element: base = " + base + ", property = " + property + ", value = " + val, module); + if (Debug.verboseOn()) 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()) { - Debug.logVerbose("ExtendedListResolver.setValue inserting List element: base = " + base + ", property = " + property + ", value = " + val, module); + if (Debug.verboseOn()) 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()) { - Debug.logVerbose("ExtendedMapResolver.getValue: unable to find Locale for LocalizedMap element, using default locale", module); + if (Debug.verboseOn()) 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 4e4abc4bf3..c45ca724f9 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()) { - Debug.logVerbose("Adding FTL Transform " + key + " with class " + className, module); + if (Debug.verboseOn()) Debug.logVerbose("Adding FTL Transform " + key + " with class " + className, module); } try { config.setSharedVariable(key, loader.loadClass(className).newInstance()); diff --git a/framework/catalina/src/main/java/org/apache/ofbiz/catalina/container/CrossSubdomainSessionValve.java b/framework/catalina/src/main/java/org/apache/ofbiz/catalina/container/CrossSubdomainSessionValve.java index d0c74ff000..21eac02d46 100644 --- a/framework/catalina/src/main/java/org/apache/ofbiz/catalina/container/CrossSubdomainSessionValve.java +++ b/framework/catalina/src/main/java/org/apache/ofbiz/catalina/container/CrossSubdomainSessionValve.java @@ -115,8 +115,8 @@ public class CrossSubdomainSessionValve extends ValveBase { MessageBytes value = mimeHeaders.getValue(i); if (value.indexOf(cookie.getName()) >= 0) { String newCookieValue = request.getContext().getCookieProcessor().generateHeader(newCookie); - Debug.logVerbose("CrossSubdomainSessionValve: old Set-Cookie value: " + value.toString(), module); - Debug.logVerbose("CrossSubdomainSessionValve: new Set-Cookie value: " + newCookieValue, module); + if (Debug.verboseOn()) Debug.logVerbose("CrossSubdomainSessionValve: old Set-Cookie value: " + value.toString(), module); + if (Debug.verboseOn()) Debug.logVerbose("CrossSubdomainSessionValve: new Set-Cookie value: " + newCookieValue, module); value.setString(newCookieValue); } } diff --git a/framework/common/src/main/java/org/apache/ofbiz/common/email/EmailServices.java b/framework/common/src/main/java/org/apache/ofbiz/common/email/EmailServices.java index 3ffe1a7600..de5155e9df 100644 --- a/framework/common/src/main/java/org/apache/ofbiz/common/email/EmailServices.java +++ b/framework/common/src/main/java/org/apache/ofbiz/common/email/EmailServices.java @@ -316,7 +316,7 @@ public class EmailServices { if (!"Y".equalsIgnoreCase(mailEnabled)) { // no error; just return as if we already processed Debug.logImportant("Mail notifications disabled in general.properties; mail with subject [" + subject + "] not sent to addressee [" + sendTo + "]", module); - Debug.logVerbose("What would have been sent, the addressee: " + sendTo + " subject: " + subject + " context: " + context, module); + if (Debug.verboseOn()) Debug.logVerbose("What would have been sent, the addressee: " + sendTo + " subject: " + subject + " context: " + context, module); results.put("messageWrapper", new MimeMessageWrapper(session, mail)); return results; } 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 987dde2841..1d38873c71 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 @@ -48,7 +48,7 @@ public class LdapAuthenticationServices { public static final String module = LdapAuthenticationServices.class.getName(); public static boolean userLogin(DispatchContext ctx, Map context) { - Debug.logVerbose("Starting LDAP authentication", module); + if (Debug.verboseOn()) Debug.logVerbose("Starting LDAP authentication", module); Properties env = UtilProperties.getProperties("jndiLdap"); String username = (String) context.get("login.username"); if (username == null) { @@ -75,9 +75,9 @@ public class LdapAuthenticationServices { if (dnTemplate != null) { dn = dnTemplate.replace("%u", username); } - Debug.logVerbose("Using DN template: " + dn, module); + if (Debug.verboseOn()) Debug.logVerbose("Using DN template: " + dn, module); } else { - Debug.logVerbose("Using UserLogin.userLdapDn: " + dn, module); + if (Debug.verboseOn()) Debug.logVerbose("Using UserLogin.userLdapDn: " + dn, module); } env.put(Context.SECURITY_PRINCIPAL, dn); env.put(Context.SECURITY_CREDENTIALS, password); @@ -86,10 +86,10 @@ public class LdapAuthenticationServices { DirContext ldapCtx = new InitialDirContext(env); ldapCtx.close(); } catch (NamingException e) { - Debug.logVerbose("LDAP authentication failed: " + e.getMessage(), module); + if (Debug.verboseOn()) Debug.logVerbose("LDAP authentication failed: " + e.getMessage(), module); return false; } - Debug.logVerbose("LDAP authentication succeeded", module); + if (Debug.verboseOn()) Debug.logVerbose("LDAP authentication succeeded", module); if (!"true".equals(env.get("ldap.synchronize.passwords"))) { return true; } @@ -104,7 +104,7 @@ public class LdapAuthenticationServices { samePassword = currentPassword.equals(password); } if (!samePassword) { - Debug.logVerbose("Starting password synchronization", module); + if (Debug.verboseOn()) Debug.logVerbose("Starting password synchronization", module); userLogin.set("currentPassword", useEncryption ? HashCrypt.cryptUTF8(LoginServices.getHashType(), null, password) : password, false); Transaction parentTx = null; boolean beganTransaction = false; @@ -127,7 +127,7 @@ public class LdapAuthenticationServices { } finally { try { TransactionUtil.commit(beganTransaction); - Debug.logVerbose("Password synchronized", module); + if (Debug.verboseOn()) Debug.logVerbose("Password synchronized", module); } catch (GenericTransactionException e) { Debug.logError(e, "Could not commit nested transaction: " + e.getMessage(), module); } @@ -136,7 +136,7 @@ public class LdapAuthenticationServices { if (parentTx != null) { try { TransactionUtil.resume(parentTx); - Debug.logVerbose("Resumed the parent transaction.", module); + if (Debug.verboseOn()) Debug.logVerbose("Resumed the parent transaction.", module); } catch (GenericTransactionException e) { Debug.logError(e, "Could not resume parent nested transaction: " + e.getMessage(), module); } 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 ca1719f53a..aa22d41d18 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()) { - Debug.logVerbose("Loaded dataFile: " + dataFileName, module); + if (Debug.verboseOn()) Debug.logVerbose("Loaded dataFile: " + dataFileName, module); } } return result; 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 41f7445105..574d7de891 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 @@ -2654,7 +2654,7 @@ public class GenericDelegator implements Delegator { Debug.logWarning(e, "DistributedCacheClear class with name " + distributedCacheClearClassName + " does not implement the DistributedCacheClear interface, distributed cache clearing will be disabled", module); } } else { - Debug.logVerbose("Distributed Cache Clear System disabled for delegator [" + delegatorFullName + "]", module); + if (Debug.verboseOn()) Debug.logVerbose("Distributed Cache Clear System disabled for delegator [" + delegatorFullName + "]", module); } return null; } 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 eb91eb0fc9..98ec476280 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()) { - Debug.logVerbose("Entity: " + this.getEntityName() + ", PK: " + this.getPrimaryKey().toString() + " -> char [" + curChar + "] replaced with [" + replacement + "]", module); + if (Debug.verboseOn()) 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/connection/DebugManagedDataSource.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/connection/DebugManagedDataSource.java index ea1edcbdf1..4e51b3865a 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/connection/DebugManagedDataSource.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/connection/DebugManagedDataSource.java @@ -43,9 +43,9 @@ public class DebugManagedDataSource extends ManagedDataSource { if (Debug.verboseOn()) { if (super.getPool() instanceof GenericObjectPool) { GenericObjectPool objectPool = (GenericObjectPool)super.getPool(); - Debug.logVerbose("Borrowing a connection from the pool; used/idle/total: " + objectPool.getNumActive() + "/" + objectPool.getNumIdle() + "/" + (objectPool.getNumActive() + objectPool.getNumIdle()) + "; min idle/max idle/max total: " + objectPool.getMinIdle() + "/" + objectPool.getMaxIdle() + "/" + objectPool.getMaxTotal(), module); + if (Debug.verboseOn()) Debug.logVerbose("Borrowing a connection from the pool; used/idle/total: " + objectPool.getNumActive() + "/" + objectPool.getNumIdle() + "/" + (objectPool.getNumActive() + objectPool.getNumIdle()) + "; min idle/max idle/max total: " + objectPool.getMinIdle() + "/" + objectPool.getMaxIdle() + "/" + objectPool.getMaxTotal(), module); } else { - Debug.logVerbose("Borrowing a connection from the pool; used/idle/total: " + super.getPool().getNumActive() + "/" + super.getPool().getNumIdle() + "/" + (super.getPool().getNumActive() + super.getPool().getNumIdle()), module); + if (Debug.verboseOn()) Debug.logVerbose("Borrowing a connection from the pool; used/idle/total: " + super.getPool().getNumActive() + "/" + super.getPool().getNumIdle() + "/" + (super.getPool().getNumActive() + super.getPool().getNumIdle()), module); } } return super.getConnection(); diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/datasource/GenericDAO.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/datasource/GenericDAO.java index 2c85baa00c..7950e4b537 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/datasource/GenericDAO.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/datasource/GenericDAO.java @@ -591,7 +591,7 @@ public class GenericDAO { if (verboseOn) { // put this inside an if statement so that we don't have to generate the string when not used... - Debug.logVerbose("Doing selectListIteratorByCondition with whereEntityCondition: " + whereEntityCondition, module); + if (Debug.verboseOn()) Debug.logVerbose("Doing selectListIteratorByCondition with whereEntityCondition: " + whereEntityCondition, module); } // make two ArrayLists of fields, one for fields to select and the other for where clause fields (to find by) @@ -714,7 +714,7 @@ public class GenericDAO { if (verboseOn) { // put this inside an if statement so that we don't have to generate the string when not used... - Debug.logVerbose("Setting the whereEntityConditionParams: " + whereEntityConditionParams, module); + if (Debug.verboseOn()) Debug.logVerbose("Setting the whereEntityConditionParams: " + whereEntityConditionParams, module); } // set all of the values from the Where EntityCondition for (EntityConditionParam whereEntityConditionParam: whereEntityConditionParams) { @@ -722,7 +722,7 @@ public class GenericDAO { } if (verboseOn) { // put this inside an if statement so that we don't have to generate the string when not used... - Debug.logVerbose("Setting the havingEntityConditionParams: " + havingEntityConditionParams, module); + if (Debug.verboseOn()) Debug.logVerbose("Setting the havingEntityConditionParams: " + havingEntityConditionParams, module); } // set all of the values from the Having EntityCondition for (EntityConditionParam havingEntityConditionParam: havingEntityConditionParams) { @@ -963,7 +963,7 @@ public class GenericDAO { if (verboseOn) { // put this inside an if statement so that we don't have to generate the string when not used... - Debug.logVerbose("Doing selectListIteratorByCondition with whereEntityCondition: " + whereEntityCondition, module); + if (Debug.verboseOn()) Debug.logVerbose("Doing selectListIteratorByCondition with whereEntityCondition: " + whereEntityCondition, module); } boolean isGroupBy = false; @@ -1050,7 +1050,7 @@ public class GenericDAO { findOptions.getResultSetConcurrency(), findOptions.getFetchSize(), findOptions.getMaxRows()); if (verboseOn) { // put this inside an if statement so that we don't have to generate the string when not used... - Debug.logVerbose("Setting the whereEntityConditionParams: " + whereEntityConditionParams, module); + if (Debug.verboseOn()) Debug.logVerbose("Setting the whereEntityConditionParams: " + whereEntityConditionParams, module); } // set all of the values from the Where EntityCondition for (EntityConditionParam whereEntityConditionParam: whereEntityConditionParams) { @@ -1058,7 +1058,7 @@ public class GenericDAO { } if (verboseOn) { // put this inside an if statement so that we don't have to generate the string when not used... - Debug.logVerbose("Setting the havingEntityConditionParams: " + havingEntityConditionParams, module); + if (Debug.verboseOn()) Debug.logVerbose("Setting the havingEntityConditionParams: " + havingEntityConditionParams, module); } // set all of the values from the Having EntityCondition for (EntityConditionParam havingEntityConditionParam: havingEntityConditionParams) { diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/DatabaseUtil.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/DatabaseUtil.java index 01591a503b..d8929fdbba 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/DatabaseUtil.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/DatabaseUtil.java @@ -1027,7 +1027,7 @@ public class DatabaseUtil { private AbstractCountingCallable createPrimaryKeyFetcher(final DatabaseMetaData dbData, final String lookupSchemaName, final boolean needsUpperCase, final Map> colInfo, final Collection messages, final String curTable) { return new AbstractCountingCallable(null, null) { public AbstractCountingCallable call() throws Exception { - Debug.logVerbose("Fetching primary keys for " + curTable, module); + if (Debug.verboseOn()) Debug.logVerbose("Fetching primary keys for " + curTable, module); ResultSet rsPks = dbData.getPrimaryKeys(null, lookupSchemaName, curTable); count = checkPrimaryKeyInfo(rsPks, lookupSchemaName, needsUpperCase, colInfo, messages); return this; 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 af911dc2de..4dd4cdcf73 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 @@ -281,15 +281,15 @@ public class SQLProcessor implements AutoCloseable { Debug.logError(e, "Problems getting the connection's isolation level", module); } if (isoLevel == Connection.TRANSACTION_NONE) { - Debug.logVerbose("Transaction isolation level set to 'None'.", module); + if (Debug.verboseOn()) Debug.logVerbose("Transaction isolation level set to 'None'.", module); } else if (isoLevel == Connection.TRANSACTION_READ_COMMITTED) { - Debug.logVerbose("Transaction isolation level set to 'ReadCommited'.", module); + if (Debug.verboseOn()) Debug.logVerbose("Transaction isolation level set to 'ReadCommited'.", module); } else if (isoLevel == Connection.TRANSACTION_READ_UNCOMMITTED) { - Debug.logVerbose("Transaction isolation level set to 'ReadUncommitted'.", module); + if (Debug.verboseOn()) Debug.logVerbose("Transaction isolation level set to 'ReadUncommitted'.", module); } else if (isoLevel == Connection.TRANSACTION_REPEATABLE_READ) { - Debug.logVerbose("Transaction isolation level set to 'RepeatableRead'.", module); + if (Debug.verboseOn()) Debug.logVerbose("Transaction isolation level set to 'RepeatableRead'.", module); } else if (isoLevel == Connection.TRANSACTION_SERIALIZABLE) { - Debug.logVerbose("Transaction isolation level set to 'Serializable'.", module); + if (Debug.verboseOn()) Debug.logVerbose("Transaction isolation level set to 'Serializable'.", module); } } */ diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelReader.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelReader.java index a4786f5d69..9a52444880 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelReader.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelReader.java @@ -180,10 +180,10 @@ public class ModelReader implements Serializable { // utilTimer.timerString(" After entityCache.put -- " + i + " --"); if (isEntity) { if (Debug.verboseOn()) - Debug.logVerbose("-- [Entity]: #" + i + ": " + entityName, module); + if (Debug.verboseOn()) Debug.logVerbose("-- [Entity]: #" + i + ": " + entityName, module); } else { if (Debug.verboseOn()) - Debug.logVerbose("-- [ViewEntity]: #" + i + ": " + entityName, module); + if (Debug.verboseOn()) Debug.logVerbose("-- [ViewEntity]: #" + i + ": " + entityName, module); } } else { Debug.logWarning("-- -- ENTITYGEN ERROR:getModelEntity: Could not create " + diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/transaction/JNDITransactionFactory.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/transaction/JNDITransactionFactory.java index f177675855..1562876642 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/transaction/JNDITransactionFactory.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/transaction/JNDITransactionFactory.java @@ -179,7 +179,7 @@ public class JNDITransactionFactory implements TransactionFactory { if (ds != null) { if (Debug.verboseOn()) - Debug.logVerbose("Got a Datasource object.", module); + if (Debug.verboseOn()) Debug.logVerbose("Got a Datasource object.", module); dsCache.putIfAbsent(jndiName, ds); ds = dsCache.get(jndiName); Connection con; 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 a48802c85e..a6f71858c0 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()) { - Debug.logVerbose("Current status : " + getTransactionStateString(currentStatus), module); + if (Debug.verboseOn()) Debug.logVerbose("Current status : " + getTransactionStateString(currentStatus), module); } if (currentStatus == Status.STATUS_ACTIVE) { if (Debug.verboseOn()) { - Debug.logVerbose("Active transaction in place, so no transaction begun", module); + if (Debug.verboseOn()) 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()) { - Debug.logVerbose("Set transaction timeout to : " + timeout + " seconds", module); + if (Debug.verboseOn()) Debug.logVerbose("Set transaction timeout to : " + timeout + " seconds", module); } } // begin the transaction ut.begin(); if (Debug.verboseOn()) { - Debug.logVerbose("Transaction begun", module); + if (Debug.verboseOn()) Debug.logVerbose("Transaction begun", module); } // reset the timeout to the default @@ -243,7 +243,7 @@ public final class TransactionUtil implements Status { if (ut != null) { try { int status = ut.getStatus(); - Debug.logVerbose("Current status : " + getTransactionStateString(status), module); + if (Debug.verboseOn()) Debug.logVerbose("Current status : " + getTransactionStateString(status), module); if (status != STATUS_NO_TRANSACTION && status != STATUS_COMMITTING && status != STATUS_COMMITTED && status != STATUS_ROLLING_BACK && status != STATUS_ROLLEDBACK) { ut.commit(); @@ -254,7 +254,7 @@ public final class TransactionUtil implements Status { clearTransactionBeginStack(); clearSetRollbackOnlyCause(); - Debug.logVerbose("Transaction committed", module); + if (Debug.verboseOn()) Debug.logVerbose("Transaction committed", module); } else { Debug.logWarning("Not committing transaction, status is " + getStatusString(), module); } @@ -315,7 +315,7 @@ public final class TransactionUtil implements Status { if (ut != null) { try { int status = ut.getStatus(); - Debug.logVerbose("Current status : " + getTransactionStateString(status), module); + if (Debug.verboseOn()) Debug.logVerbose("Current status : " + getTransactionStateString(status), module); if (status != STATUS_NO_TRANSACTION) { //if (Debug.infoOn()) Thread.dumpStack(); @@ -353,7 +353,7 @@ public final class TransactionUtil implements Status { if (ut != null) { try { int status = ut.getStatus(); - Debug.logVerbose("Current code : " + getTransactionStateString(status), module); + if (Debug.verboseOn()) Debug.logVerbose("Current code : " + getTransactionStateString(status), module); if (status != STATUS_NO_TRANSACTION) { if (status != STATUS_MARKED_ROLLBACK) { diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityDataAssert.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityDataAssert.java index 80e985108f..ba76f1d1cf 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityDataAssert.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityDataAssert.java @@ -49,7 +49,7 @@ public class EntityDataAssert { return 0; } - Debug.logVerbose("Loading XML Resource: " + dataUrl.toExternalForm(), module); + if (Debug.verboseOn()) Debug.logVerbose("Loading XML Resource: " + dataUrl.toExternalForm(), module); try { for (GenericValue checkValue: delegator.readXmlDocument(dataUrl)) { diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityDataLoader.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityDataLoader.java index 3709c5f2d6..9375164ad0 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityDataLoader.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityDataLoader.java @@ -247,7 +247,7 @@ public class EntityDataLoader { return 0; } - Debug.logVerbose("[loadData] Loading XML Resource: \"" + dataUrl.toExternalForm() + "\"", module); + if (Debug.verboseOn()) Debug.logVerbose("[loadData] Loading XML Resource: \"" + dataUrl.toExternalForm() + "\"", module); try { /* The OLD way diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntitySaxReader.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntitySaxReader.java index 363ebf095b..226ff9d0a1 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntitySaxReader.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntitySaxReader.java @@ -251,7 +251,7 @@ public class EntitySaxReader extends DefaultHandler { } Debug.logImportant("Finished " + numberRead + " values from " + docDescription, module); if (Debug.verboseOn()) { - Debug.logVerbose(" Detail created : " + numberCreated + ", skipped : " + numberSkipped + + if (Debug.verboseOn()) Debug.logVerbose(" Detail created : " + numberCreated + ", skipped : " + numberSkipped + ", updated : " + numberUpdated + ", replaced : " + numberReplaced + ", deleted : " + numberDeleted, module); } 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 4abe8dcf8d..e6cc483879 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,8 +83,8 @@ public final class EntityEcaRule implements java.io.Serializable { actionsAndSets.trimToSize(); this.actionsAndSets = Collections.unmodifiableList(actionsAndSets); if (Debug.verboseOn()) { - Debug.logVerbose("Conditions: " + conditions, module); - Debug.logVerbose("actions and sets (intermixed): " + actionsAndSets, module); + if (Debug.verboseOn()) 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/SimpleMethod.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/SimpleMethod.java index 4b317c8185..57a565c280 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/SimpleMethod.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/SimpleMethod.java @@ -543,10 +543,10 @@ public final class SimpleMethod extends MiniLangElement { if (UtilValidate.isEmpty(response)) { if (forceError) { // override response code, always use error code - Debug.logVerbose("No response code string found, but error messages found so assuming error; returning code [" + defaultErrorCode + "]", module); + if (Debug.verboseOn()) Debug.logVerbose("No response code string found, but error messages found so assuming error; returning code [" + defaultErrorCode + "]", module); response = defaultErrorCode; } else { - Debug.logVerbose("No response code string or errors found, assuming success; returning code [" + defaultSuccessCode + "]", module); + if (Debug.verboseOn()) Debug.logVerbose("No response code string or errors found, assuming success; returning code [" + defaultSuccessCode + "]", module); response = defaultSuccessCode; } } diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/callops/CallSimpleMethod.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/callops/CallSimpleMethod.java index cf2a0a1f5a..64f5ce0642 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/callops/CallSimpleMethod.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/callops/CallSimpleMethod.java @@ -111,7 +111,7 @@ public final class CallSimpleMethod extends MethodOperation { } String returnVal = simpleMethodToCall.exec(localContext); if (Debug.verboseOn()) - Debug.logVerbose("Called simple-method named [" + this.methodName + "] in resource [" + this.xmlResource + "], returnVal is [" + returnVal + "]", module); + if (Debug.verboseOn()) Debug.logVerbose("Called simple-method named [" + this.methodName + "] in resource [" + this.xmlResource + "], returnVal is [" + returnVal + "]", module); if (simpleMethodToCall.getDefaultErrorCode().equals(returnVal)) { if (methodContext.getMethodType() == MethodContext.EVENT) { methodContext.putEnv(simpleMethod.getEventResponseCodeName(), simpleMethod.getDefaultErrorCode()); 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 cb64d685fe..c363693d14 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()) { - Debug.logVerbose("The from map in set-service-field was not found with name: " + mapFma, module); + if (Debug.verboseOn()) 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 e8ff2e8b58..4914910a68 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 @@ -69,7 +69,7 @@ public final class Iterate extends MethodOperation { public boolean exec(MethodContext methodContext) throws MiniLangException { if (listFma.isEmpty()) { if (Debug.verboseOn()) - Debug.logVerbose("Collection not found, doing nothing: " + this, module); + if (Debug.verboseOn()) Debug.logVerbose("Collection not found, doing nothing: " + this, module); return true; } Object oldEntryValue = entryFma.get(methodContext.getEnvMap()); @@ -102,7 +102,7 @@ public final class Iterate extends MethodOperation { Collection theCollection = UtilGenerics.checkCollection(objList); if (theCollection.size() == 0) { if (Debug.verboseOn()) - Debug.logVerbose("Collection has zero entries, doing nothing: " + this, module); + if (Debug.verboseOn()) Debug.logVerbose("Collection has zero entries, doing nothing: " + this, module); return true; } for (Object theEntry : theCollection) { @@ -127,7 +127,7 @@ public final class Iterate extends MethodOperation { Iterator theIterator = UtilGenerics.cast(objList); if (!theIterator.hasNext()) { if (Debug.verboseOn()) - Debug.logVerbose("Iterator has zero entries, doing nothing: " + this, module); + if (Debug.verboseOn()) Debug.logVerbose("Iterator has zero entries, doing nothing: " + this, module); return true; } while (theIterator.hasNext()) { @@ -151,7 +151,7 @@ public final class Iterate extends MethodOperation { } } else { if (Debug.verboseOn()) { - Debug.logVerbose("Cannot iterate over a " + objList == null ? "null object" : objList.getClass().getName() + if (Debug.verboseOn()) Debug.logVerbose("Cannot iterate over a " + objList == null ? "null object" : objList.getClass().getName() + ", doing nothing: " + this, module); } return true; diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/envops/IterateMap.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/envops/IterateMap.java index 05b100dfad..879ebce67a 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/envops/IterateMap.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/envops/IterateMap.java @@ -71,21 +71,21 @@ public final class IterateMap extends MethodOperation { Object oldValue = valueFma.get(methodContext.getEnvMap()); if (oldKey != null) { if (Debug.verboseOn()) - Debug.logVerbose("In iterate-map the key had a non-null value before entering the loop for the operation: " + this, module); + if (Debug.verboseOn()) Debug.logVerbose("In iterate-map the key had a non-null value before entering the loop for the operation: " + this, module); } if (oldValue != null) { if (Debug.verboseOn()) - Debug.logVerbose("In iterate-map the value had a non-null value before entering the loop for the operation: " + this, module); + if (Debug.verboseOn()) Debug.logVerbose("In iterate-map the value had a non-null value before entering the loop for the operation: " + this, module); } Map theMap = mapFma.get(methodContext.getEnvMap()); if (theMap == null) { if (Debug.verboseOn()) - Debug.logVerbose("Map not found with name " + mapFma + ", doing nothing: " + this, module); + if (Debug.verboseOn()) Debug.logVerbose("Map not found with name " + mapFma + ", doing nothing: " + this, module); return true; } if (theMap.size() == 0) { if (Debug.verboseOn()) - Debug.logVerbose("Map with name " + mapFma + " has zero entries, doing nothing: " + this, module); + if (Debug.verboseOn()) Debug.logVerbose("Map with name " + mapFma + " has zero entries, doing nothing: " + this, module); return true; } for (Map.Entry theEntry : theMap.entrySet()) { diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/envops/SetOperation.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/envops/SetOperation.java index 4712bf5e16..a73f5c0c8f 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/envops/SetOperation.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/envops/SetOperation.java @@ -145,7 +145,7 @@ public final class SetOperation extends MethodOperation { } else if (!this.fromFma.isEmpty()) { newValue = this.fromFma.get(methodContext.getEnvMap()); if (Debug.verboseOn()) - Debug.logVerbose("In screen getting value for field from [" + this.fromFma.toString() + "]: " + newValue, module); + if (Debug.verboseOn()) Debug.logVerbose("In screen getting value for field from [" + this.fromFma.toString() + "]: " + newValue, module); } else if (!this.valueFse.isEmpty()) { newValue = this.valueFse.expand(methodContext.getEnvMap()); isConstant = true; @@ -157,12 +157,12 @@ public final class SetOperation extends MethodOperation { } if (!setIfNull && newValue == null && !"NewMap".equals(this.type) && !"NewList".equals(this.type)) { if (Debug.verboseOn()) - Debug.logVerbose("Field value not found (null) with name [" + fromFma + "] and value [" + valueFse + "], and there was not default value, not setting field", module); + if (Debug.verboseOn()) Debug.logVerbose("Field value not found (null) with name [" + fromFma + "] and value [" + valueFse + "], and there was not default value, not setting field", module); return true; } if (!setIfEmpty && ObjectType.isEmpty(newValue)) { if (Debug.verboseOn()) - Debug.logVerbose("Field value not found (empty) with name [" + fromFma + "] and value [" + valueFse + "], and there was not default value, not setting field", module); + if (Debug.verboseOn()) Debug.logVerbose("Field value not found (empty) with name [" + fromFma + "] and value [" + valueFse + "], and there was not default value, not setting field", module); return true; } if (this.type.length() > 0) { @@ -195,7 +195,7 @@ public final class SetOperation extends MethodOperation { } } if (Debug.verboseOn()) - Debug.logVerbose("Setting field [" + this.fieldFma.toString() + "] to value: " + newValue, module); + if (Debug.verboseOn()) Debug.logVerbose("Setting field [" + this.fieldFma.toString() + "] to value: " + newValue, module); this.fieldFma.put(methodContext.getEnvMap(), newValue); 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 696a9ec9a0..42f1acb089 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()) { - Debug.logVerbose("Security implementation " + security.getClass().getName() + " created for delegator " + delegator.getDelegatorName(), module); + if (Debug.verboseOn()) 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 e26a6845c3..890a4976ce 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,13 +71,13 @@ public abstract class GenericAbstractDispatcher implements LocalDispatcher { getJobManager().schedule(jobName, poolName, serviceName, context, startTime, frequency, interval, count, endTime, maxRetry); if (Debug.verboseOn()) { - Debug.logVerbose("[LocalDispatcher.schedule] : Current time : " + (new Date()).getTime(), module); - Debug.logVerbose("[LocalDispatcher.schedule] : Runtime : " + startTime, module); - Debug.logVerbose("[LocalDispatcher.schedule] : Frequency : " + frequency, module); - Debug.logVerbose("[LocalDispatcher.schedule] : Interval : " + interval, module); - Debug.logVerbose("[LocalDispatcher.schedule] : Count : " + count, module); - Debug.logVerbose("[LocalDispatcher.schedule] : EndTime : " + endTime, module); - Debug.logVerbose("[LocalDispatcher.schedule] : MazRetry : " + maxRetry, module); + if (Debug.verboseOn()) 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); + if (Debug.verboseOn()) Debug.logVerbose("[LocalDispatcher.schedule] : Count : " + count, module); + if (Debug.verboseOn()) Debug.logVerbose("[LocalDispatcher.schedule] : EndTime : " + endTime, module); + if (Debug.verboseOn()) Debug.logVerbose("[LocalDispatcher.schedule] : MazRetry : " + maxRetry, module); } } catch (JobManagerException jme) { diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/GenericDispatcherFactory.java b/framework/service/src/main/java/org/apache/ofbiz/service/GenericDispatcherFactory.java index 59f508a7fc..c42ab89e82 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/GenericDispatcherFactory.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/GenericDispatcherFactory.java @@ -64,7 +64,7 @@ public class GenericDispatcherFactory implements LocalDispatcherFactory { DispatchContext ctx = new DispatchContext(name, loader, this); this.dispatcher.register(ctx); this.ctx = ctx; - Debug.logVerbose("[GenericDispatcher] : Created Dispatcher for: " + name, module); + if (Debug.verboseOn()) Debug.logVerbose("[GenericDispatcher] : Created Dispatcher for: " + name, module); } @Override diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/GenericResultWaiter.java b/framework/service/src/main/java/org/apache/ofbiz/service/GenericResultWaiter.java index a4970b608a..cff66d07d3 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/GenericResultWaiter.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/GenericResultWaiter.java @@ -50,7 +50,7 @@ public class GenericResultWaiter implements GenericRequester { completed = true; status = SERVICE_FINISHED; notify(); - Debug.logVerbose("Received Result (" + completed + ") -- " + result, module); + if (Debug.verboseOn()) Debug.logVerbose("Received Result (" + completed + ") -- " + result, module); } /** @@ -115,11 +115,11 @@ public class GenericResultWaiter implements GenericRequester { * @return Map */ public synchronized Map waitForResult(long milliseconds) { - Debug.logVerbose("Waiting for results...", module); + if (Debug.verboseOn()) Debug.logVerbose("Waiting for results...", module); while (!isCompleted()) { try { this.wait(milliseconds); - Debug.logVerbose("Waiting...", module); + if (Debug.verboseOn()) Debug.logVerbose("Waiting...", module); } catch (java.lang.InterruptedException e) { Debug.logError(e, module); } diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/ModelParam.java b/framework/service/src/main/java/org/apache/ofbiz/service/ModelParam.java index 0818f892c7..45853cae60 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/ModelParam.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/ModelParam.java @@ -199,7 +199,7 @@ public class ModelParam implements Serializable { if (this.defaultValue != null) { this.optional = true; } - Debug.logVerbose("Default value for attribute [" + this.name + "] set to [" + this.defaultValue + "]", module); + if (Debug.verboseOn()) Debug.logVerbose("Default value for attribute [" + this.name + "] set to [" + this.defaultValue + "]", module); } public void copyDefaultValue(ModelParam param) { this.setDefaultValue(param.defaultValue); 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 32290918c5..7b26e374df 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 @@ -517,12 +517,12 @@ public class ModelService extends AbstractMap implements Seriali Map requiredInfo = new HashMap<>(); Map optionalInfo = new HashMap<>(); - Debug.logVerbose("[ModelService.validate] : {" + this.name + "} : Validating context - " + context, module); + if (Debug.verboseOn()) Debug.logVerbose("[ModelService.validate] : {" + this.name + "} : Validating context - " + context, module); // do not validate results with errors if (mode.equals(OUT_PARAM) && context != null && context.containsKey(RESPONSE_MESSAGE)) { if (RESPOND_ERROR.equals(context.get(RESPONSE_MESSAGE)) || RESPOND_FAIL.equals(context.get(RESPONSE_MESSAGE))) { - Debug.logVerbose("[ModelService.validate] : {" + this.name + "} : response was an error, not validating.", module); + if (Debug.verboseOn()) Debug.logVerbose("[ModelService.validate] : {" + this.name + "} : response was an error, not validating.", module); return; } } @@ -584,11 +584,11 @@ public class ModelService extends AbstractMap implements Seriali } requiredNames.append(key); } - Debug.logVerbose("[ModelService.validate] : required fields - " + requiredNames, module); + if (Debug.verboseOn()) Debug.logVerbose("[ModelService.validate] : required fields - " + requiredNames, module); - Debug.logVerbose("[ModelService.validate] : {" + name + "} : (" + mode + ") Required - " + + if (Debug.verboseOn()) Debug.logVerbose("[ModelService.validate] : {" + name + "} : (" + mode + ") Required - " + requiredTest.size() + " / " + requiredInfo.size(), module); - Debug.logVerbose("[ModelService.validate] : {" + name + "} : (" + mode + ") Optional - " + + if (Debug.verboseOn()) Debug.logVerbose("[ModelService.validate] : {" + name + "} : (" + mode + ") Optional - " + optionalTest.size() + " / " + optionalInfo.size(), module); } @@ -1138,7 +1138,7 @@ public class ModelService extends AbstractMap implements Seriali if (group != null) { for (GroupServiceModel sm: group.getServices()) { implServices.add(new ModelServiceIface(sm.getName(), sm.isOptional())); - Debug.logVerbose("Adding service [" + sm.getName() + "] as interface of: [" + this.name + "]", module); + if (Debug.verboseOn()) Debug.logVerbose("Adding service [" + sm.getName() + "] as interface of: [" + this.name + "]", module); } } } diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/ModelServiceReader.java b/framework/service/src/main/java/org/apache/ofbiz/service/ModelServiceReader.java index 25dafec0de..30ecff5dde 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/ModelServiceReader.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/ModelServiceReader.java @@ -369,7 +369,7 @@ public class ModelServiceReader implements Serializable { groupElement.setAttribute("name", "_" + service.name + ".group"); service.internalGroup = new GroupModel(groupElement); service.invoke = service.internalGroup.getGroupName(); - Debug.logVerbose("Created INTERNAL GROUP model [" + service.internalGroup + "]", module); + if (Debug.verboseOn()) Debug.logVerbose("Created INTERNAL GROUP model [" + service.internalGroup + "]", module); } } @@ -483,7 +483,7 @@ public class ModelServiceReader implements Serializable { // default value String defValue = attribute.getAttribute("default-value"); if (UtilValidate.isNotEmpty(defValue)) { - Debug.logVerbose("Got a default-value [" + defValue + "] for service attribute [" + service.name + "." + param.name + "]", module); + if (Debug.verboseOn()) Debug.logVerbose("Got a default-value [" + defValue + "] for service attribute [" + service.name + "." + param.name + "]", module); param.setDefaultValue(defValue.intern()); } 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 aa5b056c8e..0f95b3e0c8 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 @@ -162,7 +162,7 @@ public class ServiceDispatcher { String dispatcherKey = delegator != null ? delegator.getDelegatorName() : "null"; sd = dispatchers.get(dispatcherKey); if (sd == null) { - Debug.logVerbose("[ServiceDispatcher.getInstance] : No instance found (" + dispatcherKey + ").", module); + if (Debug.verboseOn()) Debug.logVerbose("[ServiceDispatcher.getInstance] : No instance found (" + dispatcherKey + ").", module); sd = new ServiceDispatcher(delegator); ServiceDispatcher cachedDispatcher = dispatchers.putIfAbsent(dispatcherKey, sd); if (cachedDispatcher == null) { @@ -273,7 +273,7 @@ public class ServiceDispatcher { } if (Debug.verboseOn() || modelService.debug) { - Debug.logVerbose("[ServiceDispatcher.runSync] : invoking service " + modelService.name + " [" + modelService.location + + if (Debug.verboseOn()) Debug.logVerbose("[ServiceDispatcher.runSync] : invoking service " + modelService.name + " [" + modelService.location + "/" + modelService.invoke + "] (" + modelService.engineName + ")", module); } @@ -611,7 +611,7 @@ public class ServiceDispatcher { if (resultStr.length() > 10240) { resultStr = resultStr.substring(0, 10226) + "...[truncated]"; } - Debug.logVerbose("Sync service [" + localName + "/" + modelService.name + "] finished with response [" + resultStr + "]", module); + if (Debug.verboseOn()) Debug.logVerbose("Sync service [" + localName + "/" + modelService.name + "] finished with response [" + resultStr + "]", module); } if (modelService.metrics != null) { modelService.metrics.recordServiceRate(1, timeToRun); @@ -635,7 +635,7 @@ public class ServiceDispatcher { UtilTimer.timerLog(localName + " / " + service.name, "ASync service started...", module); } if (Debug.verboseOn() || service.debug) { - Debug.logVerbose("[ServiceDispatcher.runAsync] : preparing service " + service.name + " [" + service.location + "/" + service.invoke + + if (Debug.verboseOn()) Debug.logVerbose("[ServiceDispatcher.runAsync] : preparing service " + service.name + " [" + service.location + "/" + service.invoke + "] (" + service.engineName + ")", module); } @@ -962,7 +962,7 @@ public class ServiceDispatcher { private GenericValue getLoginObject(String service, String localName, String username, String password, Locale locale) throws GenericServiceException { Map context = UtilMisc.toMap("login.username", username, "login.password", password, "isServiceAuth", true, "locale", locale); - Debug.logVerbose("[ServiceDispathcer.authenticate] : Invoking UserLogin Service", module); + if (Debug.verboseOn()) Debug.logVerbose("[ServiceDispathcer.authenticate] : Invoking UserLogin Service", module); // get the dispatch context and service model DispatchContext dctx = getLocalContext(localName); diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/ServiceXaWrapper.java b/framework/service/src/main/java/org/apache/ofbiz/service/ServiceXaWrapper.java index 0572d58c71..08686da079 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/ServiceXaWrapper.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/ServiceXaWrapper.java @@ -161,7 +161,7 @@ public class ServiceXaWrapper extends GenericXaResource { @Override public void enlist() throws XAException { super.enlist(); - Debug.logVerbose("Enlisted in transaction : " + this.toString(), module); + if (Debug.verboseOn()) Debug.logVerbose("Enlisted in transaction : " + this.toString(), module); } // -- XAResource Methods @@ -170,7 +170,7 @@ public class ServiceXaWrapper extends GenericXaResource { */ @Override public void commit(Xid xid, boolean onePhase) throws XAException { - Debug.logVerbose("ServiceXaWrapper#commit() : " + onePhase + " / " + xid.toString(), module); + if (Debug.verboseOn()) Debug.logVerbose("ServiceXaWrapper#commit() : " + onePhase + " / " + xid.toString(), module); // the commit listener if (this.active) { Debug.logWarning("commit() called without end()", module); @@ -205,7 +205,7 @@ public class ServiceXaWrapper extends GenericXaResource { */ @Override public void rollback(Xid xid) throws XAException { - Debug.logVerbose("ServiceXaWrapper#rollback() : " + xid.toString(), module); + if (Debug.verboseOn()) Debug.logVerbose("ServiceXaWrapper#rollback() : " + xid.toString(), module); // the rollback listener if (this.active) { Debug.logWarning("rollback() called without end()", module); @@ -238,7 +238,7 @@ public class ServiceXaWrapper extends GenericXaResource { @Override public int prepare(Xid xid) throws XAException { // overriding to log two phase commits - Debug.logVerbose("ServiceXaWrapper#prepare() : " + xid.toString(), module); + if (Debug.verboseOn()) Debug.logVerbose("ServiceXaWrapper#prepare() : " + xid.toString(), module); int rtn; try { rtn = super.prepare(xid); @@ -246,7 +246,7 @@ public class ServiceXaWrapper extends GenericXaResource { Debug.logError(e, module); throw e; } - Debug.logVerbose("ServiceXaWrapper#prepare() : " + rtn + " / " + (rtn == XA_OK) , module); + if (Debug.verboseOn()) Debug.logVerbose("ServiceXaWrapper#prepare() : " + rtn + " / " + (rtn == XA_OK) , module); return rtn; } @@ -349,7 +349,7 @@ public class ServiceXaWrapper extends GenericXaResource { } } } else { - Debug.logVerbose("No " + msgPrefix + "service defined; nothing to do", module); + if (Debug.verboseOn()) Debug.logVerbose("No " + msgPrefix + "service defined; nothing to do", module); } this.xid = null; 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 ad453ef3ec..1b42ed5259 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,8 +205,8 @@ public class RecurrenceInfo { } if (Debug.verboseOn()) { - Debug.logVerbose("Date List Size: " + (rDateList == null ? 0 : rDateList.size()), module); - Debug.logVerbose("Rule List Size: " + (rRulesList == null ? 0 : rRulesList.size()), module); + if (Debug.verboseOn()) 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); } // Check the rules and date list 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 357201c0a8..345bb7d485 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 @@ -163,21 +163,21 @@ public class RecurrenceRule { */ public long getEndTime() { if (rule == null) { - Debug.logVerbose("Rule is null.", module); + if (Debug.verboseOn()) Debug.logVerbose("Rule is null.", module); return -1; } long time = 0; java.sql.Timestamp stamp = null; stamp = rule.getTimestamp("untilDateTime"); - Debug.logVerbose("Stamp value: " + stamp, module); + if (Debug.verboseOn()) Debug.logVerbose("Stamp value: " + stamp, module); if (stamp != null) { long nanos = stamp.getNanos(); time = stamp.getTime(); time += (nanos / 1000000); } - Debug.logVerbose("Returning time: " + time, module); + if (Debug.verboseOn()) Debug.logVerbose("Returning time: " + time, module); return time; } @@ -261,12 +261,12 @@ public class RecurrenceRule { // Test the end time of the recurrence. if (getEndTime() != 0 && getEndTime() <= RecurrenceUtil.now()) return 0; - Debug.logVerbose("Rule NOT expired by end time.", module); + if (Debug.verboseOn()) Debug.logVerbose("Rule NOT expired by end time.", module); // Test the recurrence limit. if (getCount() != -1 && currentCount >= getCount()) return 0; - Debug.logVerbose("Rule NOT expired by max count.", module); + if (Debug.verboseOn()) Debug.logVerbose("Rule NOT expired by max count.", module); boolean isSeeking = true; long nextRuntime = 0; 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 8d2842f8b9..076dbeb8cb 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()) { - Debug.logVerbose("Created " + this, module); + if (Debug.verboseOn()) 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()) { - Debug.logVerbose("Created " + this, module); + if (Debug.verboseOn()) Debug.logVerbose("Created " + this, module); } } @@ -313,7 +313,7 @@ public class TemporalExpressions implements Serializable { this.start = start; this.end = end; if (Debug.verboseOn()) { - Debug.logVerbose("Created " + this, module); + if (Debug.verboseOn()) Debug.logVerbose("Created " + this, module); } } @@ -433,7 +433,7 @@ public class TemporalExpressions implements Serializable { this.start = start; this.end = end; if (Debug.verboseOn()) { - Debug.logVerbose("Created " + this, module); + if (Debug.verboseOn()) Debug.logVerbose("Created " + this, module); } } @@ -565,7 +565,7 @@ public class TemporalExpressions implements Serializable { } this.sequence = included.sequence; if (Debug.verboseOn()) { - Debug.logVerbose("Created " + this, module); + if (Debug.verboseOn()) Debug.logVerbose("Created " + this, module); } } @@ -685,7 +685,7 @@ public class TemporalExpressions implements Serializable { this.freqType = freqType; this.freqCount = freqCount; if (Debug.verboseOn()) { - Debug.logVerbose("Created " + this, module); + if (Debug.verboseOn()) 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()) { - Debug.logVerbose("Created " + this, module); + if (Debug.verboseOn()) Debug.logVerbose("Created " + this, module); } } @@ -997,7 +997,7 @@ public class TemporalExpressions implements Serializable { this.sequence = result; } if (Debug.verboseOn()) { - Debug.logVerbose("Created " + this, module); + if (Debug.verboseOn()) 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()) { - Debug.logVerbose("Created " + this, module); + if (Debug.verboseOn()) Debug.logVerbose("Created " + this, module); } } @@ -1280,7 +1280,7 @@ public class TemporalExpressions implements Serializable { this.start = start; this.end = end; if (Debug.verboseOn()) { - Debug.logVerbose("Created " + this, module); + if (Debug.verboseOn()) Debug.logVerbose("Created " + this, module); } } @@ -1437,7 +1437,7 @@ public class TemporalExpressions implements Serializable { } this.sequence = included.sequence; if (Debug.verboseOn()) { - Debug.logVerbose("Created " + this, module); + if (Debug.verboseOn()) Debug.logVerbose("Created " + this, module); } } @@ -1555,7 +1555,7 @@ public class TemporalExpressions implements Serializable { this.sequence = that.sequence; } if (Debug.verboseOn()) { - Debug.logVerbose("Created " + this, module); + if (Debug.verboseOn()) 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 202370ad8f..578fd382ec 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()) { - Debug.logVerbose("Conditions: " + conditions, module); + if (Debug.verboseOn()) 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()) { - Debug.logVerbose("actions and sets (intermixed): " + actionsAndSets, module); + if (Debug.verboseOn()) 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()) { - Debug.logVerbose("For Service ECA [" + this.serviceName + "] on [" + this.eventName + "] got true for condition: " + ec, module); + if (Debug.verboseOn()) 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 e8aa13d297..80faadbc0b 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,9 +120,9 @@ public class XMLRPCClientEngine extends GenericAsyncEngine { List inModelParamList = modelService.getInModelParamList(); if (Debug.verboseOn()) { - Debug.logVerbose("[XMLRPCClientEngine.invoke] : Parameter length - " + inModelParamList.size(), module); + if (Debug.verboseOn()) Debug.logVerbose("[XMLRPCClientEngine.invoke] : Parameter length - " + inModelParamList.size(), module); for (ModelParam p: inModelParamList) { - Debug.logVerbose("[XMLRPCClientEngine.invoke} : Parameter: " + p.name + " (" + p.mode + ")", module); + 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/group/GroupModel.java b/framework/service/src/main/java/org/apache/ofbiz/service/group/GroupModel.java index 607e89c613..c4fe65e509 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/group/GroupModel.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/group/GroupModel.java @@ -71,7 +71,7 @@ public class GroupModel { } if (Debug.verboseOn()) - Debug.logVerbose("Created Service Group Model --> " + this, module); + if (Debug.verboseOn()) Debug.logVerbose("Created Service Group Model --> " + this, module); } /** @@ -161,10 +161,10 @@ public class GroupModel { Map result = new HashMap(); for (GroupServiceModel model : services) { if (Debug.verboseOn()) - Debug.logVerbose("Using Context: " + runContext, module); + if (Debug.verboseOn()) Debug.logVerbose("Using Context: " + runContext, module); Map thisResult = model.invoke(dispatcher, localName, runContext); if (Debug.verboseOn()) - Debug.logVerbose("Result: " + thisResult, module); + if (Debug.verboseOn()) Debug.logVerbose("Result: " + thisResult, module); // make sure we didn't fail if (ServiceUtil.isError(thisResult)) { @@ -175,7 +175,7 @@ public class GroupModel { result.putAll(thisResult); if (model.resultToContext()) { runContext.putAll(thisResult); - Debug.logVerbose("Added result(s) to context.", module); + if (Debug.verboseOn()) Debug.logVerbose("Added result(s) to context.", module); } } return result; 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 f990ec17ac..e298b4f530 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()) { - Debug.logVerbose("Placing job [" + getJobId() + "] in queue", module); + if (Debug.verboseOn()) 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()) { - Debug.logVerbose("Job [" + getJobId() + "] running", module); + if (Debug.verboseOn()) 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()) { - Debug.logVerbose("Job [" + getJobId() + "] not queued, rescheduling", module); + if (Debug.verboseOn()) Debug.logVerbose("Job [" + getJobId() + "] not queued, rescheduling", module); } } diff --git a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ConfigXMLReader.java b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ConfigXMLReader.java index f499f96e28..1ba1d61461 100644 --- a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ConfigXMLReader.java +++ b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ConfigXMLReader.java @@ -165,7 +165,7 @@ public class ConfigXMLReader { rootElement = UtilXml.firstChildElement(rootElement, "site-conf"); } if (Debug.verboseOn()) - Debug.logVerbose("Loaded XML Config - " + location, module); + if (Debug.verboseOn()) Debug.logVerbose("Loaded XML Config - " + location, module); return rootElement; } catch (Exception e) { Debug.logError(e, module); diff --git a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ControlServlet.java b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ControlServlet.java index 06db4bedc8..342b317c3e 100644 --- a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ControlServlet.java +++ b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ControlServlet.java @@ -141,7 +141,7 @@ public class ControlServlet extends HttpServlet { } request.setAttribute("_CONTROL_PATH_", contextPath + request.getServletPath()); if (Debug.verboseOn()) - Debug.logVerbose("Control Path: " + request.getAttribute("_CONTROL_PATH_"), module); + if (Debug.verboseOn()) Debug.logVerbose("Control Path: " + request.getAttribute("_CONTROL_PATH_"), module); // for convenience, and necessity with event handlers, make security and delegator available in the request: // try to get it from the session first so that we can have a delegator/dispatcher/security for a certain user if desired @@ -332,49 +332,49 @@ public class ControlServlet extends HttpServlet { ServletContext servletContext = this.getServletContext(); HttpSession session = request.getSession(); - Debug.logVerbose("--- Start Request Headers: ---", module); + if (Debug.verboseOn()) Debug.logVerbose("--- Start Request Headers: ---", module); Enumeration headerNames = UtilGenerics.cast(request.getHeaderNames()); while (headerNames.hasMoreElements()) { String headerName = headerNames.nextElement(); Debug.logVerbose(headerName + ":" + request.getHeader(headerName), module); } - Debug.logVerbose("--- End Request Headers: ---", module); + if (Debug.verboseOn()) Debug.logVerbose("--- End Request Headers: ---", module); - Debug.logVerbose("--- Start Request Parameters: ---", module); + if (Debug.verboseOn()) Debug.logVerbose("--- Start Request Parameters: ---", module); Enumeration paramNames = UtilGenerics.cast(request.getParameterNames()); while (paramNames.hasMoreElements()) { String paramName = paramNames.nextElement(); Debug.logVerbose(paramName + ":" + request.getParameter(paramName), module); } - Debug.logVerbose("--- End Request Parameters: ---", module); + if (Debug.verboseOn()) Debug.logVerbose("--- End Request Parameters: ---", module); - Debug.logVerbose("--- Start Request Attributes: ---", module); + if (Debug.verboseOn()) Debug.logVerbose("--- Start Request Attributes: ---", module); Enumeration reqNames = UtilGenerics.cast(request.getAttributeNames()); while (reqNames != null && reqNames.hasMoreElements()) { String attName = reqNames.nextElement(); Debug.logVerbose(attName + ":" + request.getAttribute(attName), module); } - Debug.logVerbose("--- End Request Attributes ---", module); + if (Debug.verboseOn()) Debug.logVerbose("--- End Request Attributes ---", module); - Debug.logVerbose("--- Start Session Attributes: ---", module); + if (Debug.verboseOn()) Debug.logVerbose("--- Start Session Attributes: ---", module); Enumeration sesNames = null; try { sesNames = UtilGenerics.cast(session.getAttributeNames()); } catch (IllegalStateException e) { - Debug.logVerbose("Cannot get session attributes : " + e.getMessage(), module); + if (Debug.verboseOn()) Debug.logVerbose("Cannot get session attributes : " + e.getMessage(), module); } while (sesNames != null && sesNames.hasMoreElements()) { String attName = sesNames.nextElement(); Debug.logVerbose(attName + ":" + session.getAttribute(attName), module); } - Debug.logVerbose("--- End Session Attributes ---", module); + if (Debug.verboseOn()) Debug.logVerbose("--- End Session Attributes ---", module); Enumeration appNames = UtilGenerics.cast(servletContext.getAttributeNames()); - Debug.logVerbose("--- Start ServletContext Attributes: ---", module); + if (Debug.verboseOn()) Debug.logVerbose("--- Start ServletContext Attributes: ---", module); while (appNames != null && appNames.hasMoreElements()) { String attName = appNames.nextElement(); Debug.logVerbose(attName + ":" + servletContext.getAttribute(attName), module); } - Debug.logVerbose("--- End ServletContext Attributes ---", module); + if (Debug.verboseOn()) Debug.logVerbose("--- End ServletContext Attributes ---", module); } } diff --git a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/event/JavaEventHandler.java b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/event/JavaEventHandler.java index 33c28eae32..828126381e 100644 --- a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/event/JavaEventHandler.java +++ b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/event/JavaEventHandler.java @@ -74,7 +74,7 @@ public class JavaEventHandler implements EventHandler { Class[] paramTypes = new Class[] {HttpServletRequest.class, HttpServletResponse.class}; - Debug.logVerbose("*[[Event invocation]]*", module); + if (Debug.verboseOn()) Debug.logVerbose("*[[Event invocation]]*", module); Object[] params = new Object[] {request, response}; return invoke(event.path, event.invoke, eventClass, paramTypes, params, event.transactionTimeout); @@ -89,7 +89,7 @@ public class JavaEventHandler implements EventHandler { throw new EventHandlerException("Invalid event method or path; call initialize()"); } - Debug.logVerbose("[Processing]: JAVA Event", module); + if (Debug.verboseOn()) Debug.logVerbose("[Processing]: JAVA Event", module); try { if (transactionTimeout > 0) { beganTransaction = TransactionUtil.begin(transactionTimeout); diff --git a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/event/SOAPEventHandler.java b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/event/SOAPEventHandler.java index 0ad18282f1..d0b8f14f93 100644 --- a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/event/SOAPEventHandler.java +++ b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/event/SOAPEventHandler.java @@ -168,7 +168,7 @@ public class SOAPEventHandler implements EventHandler { throw new EventHandlerException("Cannot get the envelope", e); } - Debug.logVerbose("[Processing]: SOAP Event", module); + if (Debug.verboseOn()) Debug.logVerbose("[Processing]: SOAP Event", module); String serviceName = null; try { @@ -194,7 +194,7 @@ public class SOAPEventHandler implements EventHandler { } Map serviceResults = dispatcher.runSync(serviceName, parameters); - Debug.logVerbose("[EventHandler] : Service invoked", module); + if (Debug.verboseOn()) Debug.logVerbose("[EventHandler] : Service invoked", module); createAndSendSOAPResponse(serviceResults, serviceName, response); @@ -236,7 +236,7 @@ public class SOAPEventHandler implements EventHandler { private void createAndSendSOAPResponse(Map serviceResults, String serviceName, HttpServletResponse response) throws EventHandlerException { try { // setup the response - Debug.logVerbose("[EventHandler] : Setting up response message", module); + if (Debug.verboseOn()) Debug.logVerbose("[EventHandler] : Setting up response message", module); String xmlResults = SoapSerializer.serialize(serviceResults); //Debug.logInfo("xmlResults ==================" + xmlResults, module); XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(xmlResults)); 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..09521a76c2 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,8 +127,8 @@ public class ServiceEventHandler implements EventHandler { } if (Debug.verboseOn()) { - Debug.logVerbose("[Processing]: SERVICE Event", module); - Debug.logVerbose("[Using delegator]: " + dispatcher.getDelegator().getDelegatorName(), module); + if (Debug.verboseOn()) Debug.logVerbose("[Processing]: SERVICE Event", module); + if (Debug.verboseOn()) Debug.logVerbose("[Using delegator]: " + dispatcher.getDelegator().getDelegatorName(), module); } boolean isMultiPart = ServletFileUpload.isMultipartContent(request); diff --git a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/event/SimpleEventHandler.java b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/event/SimpleEventHandler.java index f1f475d019..5e6b67fa1d 100644 --- a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/event/SimpleEventHandler.java +++ b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/event/SimpleEventHandler.java @@ -69,7 +69,7 @@ public class SimpleEventHandler implements EventHandler { throw new EventHandlerException("Event Name (eventMethod) cannot be null"); } - Debug.logVerbose("[Processing]: SIMPLE Event", module); + if (Debug.verboseOn()) Debug.logVerbose("[Processing]: SIMPLE Event", module); try { beganTransaction = TransactionUtil.begin(); String eventReturn = SimpleMethod.runSimpleEvent(xmlResource, eventName, request, response); diff --git a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/ftl/OfbizUrlTransform.java b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/ftl/OfbizUrlTransform.java index a9bc3f882b..537d2b994b 100644 --- a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/ftl/OfbizUrlTransform.java +++ b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/ftl/OfbizUrlTransform.java @@ -75,7 +75,7 @@ public class OfbizUrlTransform implements TemplateTransformModel { String result = ""; if (o != null) { if (Debug.verboseOn()) - Debug.logVerbose("Arg Object : " + o.getClass().getName(), module); + if (Debug.verboseOn()) Debug.logVerbose("Arg Object : " + o.getClass().getName(), module); if (o instanceof TemplateScalarModel) { TemplateScalarModel s = (TemplateScalarModel) o; try { diff --git a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/webdav/WebDavUtil.java b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/webdav/WebDavUtil.java index 723411ad54..1d1766cbfe 100644 --- a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/webdav/WebDavUtil.java +++ b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/webdav/WebDavUtil.java @@ -85,7 +85,7 @@ public final class WebDavUtil { String credentials = request.getHeader("Authorization"); if (credentials != null && credentials.startsWith("Basic ")) { credentials = Base64.base64Decode(credentials.replace("Basic ", "")); - Debug.logVerbose("Found HTTP Basic credentials", module); + if (Debug.verboseOn()) Debug.logVerbose("Found HTTP Basic credentials", module); String[] parts = credentials.split(":"); if (parts.length < 2) { return null; 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 2c43b48d2f..88f72945cf 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()) { - Debug.logVerbose("Registered " + widgetClass.getName() + " with tag name " + tagName, module); + if (Debug.verboseOn()) Debug.logVerbose("Registered " + widgetClass.getName() + " with tag name " + tagName, module); } } diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/AbstractModelAction.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/AbstractModelAction.java index ddb76cf595..6fcd0a1dd4 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/AbstractModelAction.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/AbstractModelAction.java @@ -136,7 +136,7 @@ public abstract class AbstractModelAction implements Serializable, ModelAction { return; for (ModelAction action : actions) { if (Debug.verboseOn()) - Debug.logVerbose("Running action " + action.getClass().getName(), module); + if (Debug.verboseOn()) Debug.logVerbose("Running action " + action.getClass().getName(), module); try { action.runAction(context); } catch (GeneralException e) { @@ -155,7 +155,7 @@ public abstract class AbstractModelAction implements Serializable, ModelAction { protected AbstractModelAction(ModelWidget modelWidget, Element actionElement) { this.modelWidget = modelWidget; if (Debug.verboseOn()) - Debug.logVerbose("Reading widget action with name: " + actionElement.getNodeName(), module); + if (Debug.verboseOn()) Debug.logVerbose("Reading widget action with name: " + actionElement.getNodeName(), module); } /** @@ -317,7 +317,7 @@ public abstract class AbstractModelAction implements Serializable, ModelAction { public void runAction(Map context) { Object valueObject = valueNameAcsr.get(context); if (valueObject == null) { - Debug.logVerbose("Value not found with name: " + valueNameAcsr + ", not getting related...", module); + if (Debug.verboseOn()) Debug.logVerbose("Value not found with name: " + valueNameAcsr + ", not getting related...", module); return; } if (!(valueObject instanceof GenericValue)) { @@ -398,7 +398,7 @@ public abstract class AbstractModelAction implements Serializable, ModelAction { public void runAction(Map context) { Object valueObject = valueNameAcsr.get(context); if (valueObject == null) { - Debug.logVerbose("Value not found with name: " + valueNameAcsr + ", not getting related...", module); + if (Debug.verboseOn()) Debug.logVerbose("Value not found with name: " + valueNameAcsr + ", not getting related...", module); return; } if (!(valueObject instanceof GenericValue)) { @@ -804,7 +804,7 @@ public abstract class AbstractModelAction implements Serializable, ModelAction { HttpSession session = (HttpSession) context.get("session"); newValue = getInMemoryPersistedFromField(session, context); if (Debug.verboseOn()) - Debug.logVerbose("In user getting value for field from [" + this.fromField.getOriginalName() + "]: " + if (Debug.verboseOn()) Debug.logVerbose("In user getting value for field from [" + this.fromField.getOriginalName() + "]: " + newValue, module); } else if (!this.valueExdr.isEmpty()) { newValue = this.valueExdr.expand(context); @@ -814,7 +814,7 @@ public abstract class AbstractModelAction implements Serializable, ModelAction { ServletContext servletContext = (ServletContext) context.get("application"); newValue = getInMemoryPersistedFromField(servletContext, context); if (Debug.verboseOn()) - Debug.logVerbose("In application getting value for field from [" + this.fromField.getOriginalName() + if (Debug.verboseOn()) Debug.logVerbose("In application getting value for field from [" + this.fromField.getOriginalName() + "]: " + newValue, module); } else if (!this.valueExdr.isEmpty()) { newValue = this.valueExdr.expandString(context); @@ -823,7 +823,7 @@ public abstract class AbstractModelAction implements Serializable, ModelAction { if (!this.fromField.isEmpty()) { newValue = this.fromField.get(context); if (Debug.verboseOn()) - Debug.logVerbose("Getting value for field from [" + this.fromField.getOriginalName() + "]: " + newValue, + if (Debug.verboseOn()) Debug.logVerbose("Getting value for field from [" + this.fromField.getOriginalName() + "]: " + newValue, module); } else if (!this.valueExdr.isEmpty()) { newValue = this.valueExdr.expand(context); @@ -874,7 +874,7 @@ public abstract class AbstractModelAction implements Serializable, ModelAction { HttpSession session = (HttpSession) context.get("session"); session.setAttribute(newKey, newValue); if (Debug.verboseOn()) - Debug.logVerbose("In user setting value for field from [" + this.field.getOriginalName() + "]: " + newValue, + if (Debug.verboseOn()) Debug.logVerbose("In user setting value for field from [" + this.field.getOriginalName() + "]: " + newValue, module); } else if (this.toScope != null && "application".equals(this.toScope)) { String originalName = this.field.getOriginalName(); @@ -890,13 +890,13 @@ public abstract class AbstractModelAction implements Serializable, ModelAction { ServletContext servletContext = (ServletContext) context.get("application"); servletContext.setAttribute(newKey, newValue); if (Debug.verboseOn()) - Debug.logVerbose("In application setting value for field from [" + this.field.getOriginalName() + "]: " + if (Debug.verboseOn()) Debug.logVerbose("In application setting value for field from [" + this.field.getOriginalName() + "]: " + newValue, module); } else { // only do this if it is not global, if global ONLY put it in the global context if (!global) { if (Debug.verboseOn()) - Debug.logVerbose("Setting field [" + this.field.getOriginalName() + "] to value: " + newValue, module); + if (Debug.verboseOn()) Debug.logVerbose("Setting field [" + this.field.getOriginalName() + "] to value: " + newValue, module); this.field.put(context, newValue); } } 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 e69a858f80..b4a663558a 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 @@ -3180,7 +3180,7 @@ public class ModelFormField { // Output format might not support menus, so make menu rendering optional. MenuStringRenderer menuStringRenderer = (MenuStringRenderer) context.get("menuStringRenderer"); if (menuStringRenderer == null) { - Debug.logVerbose("MenuStringRenderer instance not found in rendering context, menu not rendered.", module); + if (Debug.verboseOn()) Debug.logVerbose("MenuStringRenderer instance not found in rendering context, menu not rendered.", module); return; } ModelMenu modelMenu = getModelMenu(context); 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 997865292c..560bb481db 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 @@ -1036,7 +1036,7 @@ public abstract class ModelScreenWidget extends ModelWidget { // Output format might not support forms, so make form rendering optional. FormStringRenderer formStringRenderer = (FormStringRenderer) context.get("formStringRenderer"); if (formStringRenderer == null) { - Debug.logVerbose("FormStringRenderer instance not found in rendering context, form not rendered.", module); + if (Debug.verboseOn()) Debug.logVerbose("FormStringRenderer instance not found in rendering context, form not rendered.", module); return; } boolean protectScope = !shareScope(context); @@ -1122,7 +1122,7 @@ public abstract class ModelScreenWidget extends ModelWidget { // Output format might not support forms, so make form rendering optional. FormStringRenderer formStringRenderer = (FormStringRenderer) context.get("formStringRenderer"); if (formStringRenderer == null) { - Debug.logVerbose("FormStringRenderer instance not found in rendering context, form not rendered.", module); + if (Debug.verboseOn()) Debug.logVerbose("FormStringRenderer instance not found in rendering context, form not rendered.", module); return; } boolean protectScope = !shareScope(context); @@ -1216,7 +1216,7 @@ public abstract class ModelScreenWidget extends ModelWidget { // Output format might not support trees, so make tree rendering optional. TreeStringRenderer treeStringRenderer = (TreeStringRenderer) context.get("treeStringRenderer"); if (treeStringRenderer == null) { - Debug.logVerbose("TreeStringRenderer instance not found in rendering context, tree not rendered.", module); + if (Debug.verboseOn()) Debug.logVerbose("TreeStringRenderer instance not found in rendering context, tree not rendered.", module); return; } boolean protectScope = !shareScope(context); @@ -1579,7 +1579,7 @@ public abstract class ModelScreenWidget extends ModelWidget { // Output format might not support menus, so make menu rendering optional. MenuStringRenderer menuStringRenderer = (MenuStringRenderer) context.get("menuStringRenderer"); if (menuStringRenderer == null) { - Debug.logVerbose("MenuStringRenderer instance not found in rendering context, menu not rendered.", module); + if (Debug.verboseOn()) Debug.logVerbose("MenuStringRenderer instance not found in rendering context, menu not rendered.", module); return; } ModelMenu modelMenu = getModelMenu(context); diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelTreeAction.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelTreeAction.java index 13f51db7e4..8104cdfba1 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelTreeAction.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelTreeAction.java @@ -109,14 +109,14 @@ public abstract class ModelTreeAction extends AbstractModelAction { protected ModelTreeAction(ModelNode modelNode, Element actionElement) { if (Debug.verboseOn()) - Debug.logVerbose("Reading Tree action with name: " + actionElement.getNodeName(), module); + if (Debug.verboseOn()) Debug.logVerbose("Reading Tree action with name: " + actionElement.getNodeName(), module); this.modelTree = modelNode.getModelTree(); this.modelSubNode = null; } protected ModelTreeAction(ModelNode.ModelSubNode modelSubNode, Element actionElement) { if (Debug.verboseOn()) - Debug.logVerbose("Reading Tree action with name: " + actionElement.getNodeName(), module); + if (Debug.verboseOn()) Debug.logVerbose("Reading Tree action with name: " + actionElement.getNodeName(), module); this.modelSubNode = modelSubNode; this.modelTree = modelSubNode.getNode().getModelTree(); } 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 5defaf6f3f..cf2ba6045f 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 @@ -689,7 +689,7 @@ public class FormRenderer { Object obj = context.get(lookupName); if (obj == null) { if (Debug.verboseOn()) - Debug.logVerbose("No object for list or iterator name [" + lookupName + "] found, so not rendering rows.", module); + if (Debug.verboseOn()) Debug.logVerbose("No object for list or iterator name [" + lookupName + "] found, so not rendering rows.", module); return; } // if list is empty, do not render rows @@ -765,7 +765,7 @@ public class FormRenderer { } if (Debug.verboseOn()) - Debug.logVerbose("In form got another row, context is: " + localContext, module); + if (Debug.verboseOn()) Debug.logVerbose("In form got another row, context is: " + localContext, module); // Check to see if there is a field, same name and same use-when (could come from extended form) List tempFieldList = new LinkedList(); 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 2202cc742c..2d6e6a2fd4 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 @@ -184,7 +184,7 @@ public final class Paginator { Object obj = context.get(lookupName); if (obj == null) { if (Debug.verboseOn()) - Debug.logVerbose("No object for list or iterator name [" + lookupName + "] found, so not running pagination.", + if (Debug.verboseOn()) Debug.logVerbose("No object for list or iterator name [" + lookupName + "] found, so not running pagination.", module); return; } 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 e7ec7ceded..b20986a9c5 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()) { - Debug.logVerbose("No help text found in [" + entityResourceName + "] with key [" + messageId + "], Trying with: " + messageId, module); + if (Debug.verboseOn()) 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()) { - Debug.logVerbose("No help text found in [" + entityResourceName + "] with key [" + messageId + "]", module); + if (Debug.verboseOn()) 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 b94cd4bb20..57cb30e780 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()) { - Debug.logVerbose("Executing macro: " + sb, module); + if (Debug.verboseOn()) Debug.logVerbose("Executing macro: " + sb, module); } executeMacro(writer, sb.toString()); }