svn commit: r1818075 - in /ofbiz/ofbiz-framework/trunk: applications/accounting/src/main/java/org/apache/ofbiz/accounting/invoice/ applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/ applications/product/src/main/java/org/apache/ofb...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1818075 - in /ofbiz/ofbiz-framework/trunk: applications/accounting/src/main/java/org/apache/ofbiz/accounting/invoice/ applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/ applications/product/src/main/java/org/apache/ofb...

jleroux@apache.org
Author: jleroux
Date: Wed Dec 13 22:24:25 2017
New Revision: 1818075

URL: http://svn.apache.org/viewvc?rev=1818075&view=rev
Log:
Improved: Always check if debug verbose is on when using Debug.logVerbose()
(OFBIZ-10052)

This completes r1818020, there were still few cases, a last review is never too
much

In PriceServices, I spotted
  for (GenericValue orderItemPriceInfo: orderItemPriceInfos) {
      if (Debug.verboseOn()) Debug.logVerbose(" --- " + orderItemPriceInfo
but it's OK with me, this should be rarely used, so not a perf issue

Modified:
    ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/invoice/InvoiceServices.java
    ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/RenderContentAsText.java
    ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/price/PriceServices.java
    ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/fedex/FedexServices.java
    ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilHttp.java
    ofbiz/ofbiz-framework/trunk/framework/entityext/src/main/java/org/apache/ofbiz/entityext/eca/EntityEcaRule.java
    ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/GenericAbstractDispatcher.java

Modified: ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/invoice/InvoiceServices.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/invoice/InvoiceServices.java?rev=1818075&r1=1818074&r2=1818075&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/invoice/InvoiceServices.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/invoice/InvoiceServices.java Wed Dec 13 22:24:25 2017
@@ -2383,7 +2383,7 @@ public class InvoiceServices {
             BigDecimal invoiceTotal = InvoiceWorker.getInvoiceTotal(delegator, invoiceId);
             if (Debug.verboseOn()) {
                 Debug.logVerbose("Invoice #" + invoiceId + " total: " + invoiceTotal, module);
-                if (Debug.verboseOn()) Debug.logVerbose("Total payments : " + totalPayments, module);
+                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

Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/RenderContentAsText.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/RenderContentAsText.java?rev=1818075&r1=1818074&r2=1818075&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/RenderContentAsText.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/RenderContentAsText.java Wed Dec 13 22:24:25 2017
@@ -123,7 +123,7 @@ public class RenderContentAsText impleme
 
                 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);
+                    Debug.logVerbose("in RenderSubContent, subContentId(2):" + templateRoot.get("subContentId"), module);
                 }
                 FreeMarkerWorker.saveContextValues(templateRoot, saveKeyNames, savedValues);
                     try {

Modified: ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/price/PriceServices.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/price/PriceServices.java?rev=1818075&r1=1818074&r2=1818075&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/price/PriceServices.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/price/PriceServices.java Wed Dec 13 22:24:25 2017
@@ -983,9 +983,9 @@ public class PriceServices {
 
         if (Debug.verboseOn()) {
             Debug.logVerbose("Unchecked Calculated price: " + price, module);
-            if (Debug.verboseOn()) Debug.logVerbose("PriceInfo:", module);
+            Debug.logVerbose("PriceInfo:", module);
             for (GenericValue orderItemPriceInfo: orderItemPriceInfos) {
-                if (Debug.verboseOn()) Debug.logVerbose(" --- " + orderItemPriceInfo.toString(), module);
+                if (Debug.verboseOn()) Debug.logVerbose(" --- " + orderItemPriceInfo, module);
             }
         }
 

Modified: ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/fedex/FedexServices.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/fedex/FedexServices.java?rev=1818075&r1=1818074&r2=1818075&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/fedex/FedexServices.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/fedex/FedexServices.java Wed Dec 13 22:24:25 2017
@@ -119,7 +119,7 @@ public class FedexServices {
 
         if (Debug.verboseOn()) {
             Debug.logVerbose("Fedex Connect URL : " + url, module);
-            if (Debug.verboseOn()) Debug.logVerbose("Fedex XML String : " + xmlString, module);
+            Debug.logVerbose("Fedex XML String : " + xmlString, module);
         }
 
         HttpClient http = new HttpClient(url);

Modified: ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilHttp.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilHttp.java?rev=1818075&r1=1818074&r2=1818075&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilHttp.java (original)
+++ ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilHttp.java Wed Dec 13 22:24:25 2017
@@ -320,7 +320,7 @@ public final class UtilHttp {
 
         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);
+            Debug.logVerbose("Request Attribute Map Entries: " + System.getProperty("line.separator") + UtilMisc.printMap(attributeMap), module);
         }
 
         return attributeMap;
@@ -355,7 +355,7 @@ public final class UtilHttp {
 
         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);
+            Debug.logVerbose("Session Attribute Map Entries: " + System.getProperty("line.separator") + UtilMisc.printMap(sessionMap), module);
         }
 
         return sessionMap;
@@ -390,7 +390,7 @@ public final class UtilHttp {
 
         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);
+            Debug.logVerbose("ServletContext Attribute Map Entries: " + System.getProperty("line.separator") + UtilMisc.printMap(servletCtxMap), module);
         }
 
         return servletCtxMap;

Modified: ofbiz/ofbiz-framework/trunk/framework/entityext/src/main/java/org/apache/ofbiz/entityext/eca/EntityEcaRule.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/entityext/src/main/java/org/apache/ofbiz/entityext/eca/EntityEcaRule.java?rev=1818075&r1=1818074&r2=1818075&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/entityext/src/main/java/org/apache/ofbiz/entityext/eca/EntityEcaRule.java (original)
+++ ofbiz/ofbiz-framework/trunk/framework/entityext/src/main/java/org/apache/ofbiz/entityext/eca/EntityEcaRule.java Wed Dec 13 22:24:25 2017
@@ -32,9 +32,9 @@ import org.apache.ofbiz.entity.Delegator
 import org.apache.ofbiz.entity.GenericEntity;
 import org.apache.ofbiz.entity.GenericEntityException;
 import org.apache.ofbiz.entity.GenericValue;
+import org.apache.ofbiz.entity.util.EntityQuery;
 import org.apache.ofbiz.service.DispatchContext;
 import org.w3c.dom.Element;
-import org.apache.ofbiz.entity.util.EntityQuery;
 
 /**
  * Entity event-condition-action rule.
@@ -84,7 +84,7 @@ public final class EntityEcaRule impleme
         this.actionsAndSets = Collections.unmodifiableList(actionsAndSets);
         if (Debug.verboseOn()) {
             Debug.logVerbose("Conditions: " + conditions, module);
-            if (Debug.verboseOn()) Debug.logVerbose("actions and sets (intermixed): " + actionsAndSets, module);
+            Debug.logVerbose("actions and sets (intermixed): " + actionsAndSets, module);
         }
     }
 

Modified: ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/GenericAbstractDispatcher.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/GenericAbstractDispatcher.java?rev=1818075&r1=1818074&r2=1818075&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/GenericAbstractDispatcher.java (original)
+++ ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/GenericAbstractDispatcher.java Wed Dec 13 22:24:25 2017
@@ -72,12 +72,12 @@ public abstract class GenericAbstractDis
 
                     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);
+                        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);
                     }
 
                 } catch (JobManagerException jme) {