Improved: Always check if debug verbose is on when using Debug.logVerbose()

(OFBIZ-10052)

This completes r1818010, there were much more cases.
Also few tabs automatically replaced by spaces

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818020 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jacques Le Roux
2017-12-13 14:11:38 +00:00
parent 24b92d6921
commit 40e8be83df
44 changed files with 105 additions and 104 deletions
@@ -1227,7 +1227,7 @@ public class GenericEntity implements Map<String, Object>, LocalizedMap<Object>,
// Replace each char which is out of the ASCII range with a XML entity
String replacement = "&#" + (int) curChar + ";";
if (Debug.verboseOn()) {
if (Debug.verboseOn()) Debug.logVerbose("Entity: " + this.getEntityName() + ", PK: " + this.getPrimaryKey().toString() + " -> char [" + curChar + "] replaced with [" + replacement + "]", module);
Debug.logVerbose("Entity: " + this.getEntityName() + ", PK: " + this.getPrimaryKey().toString() + " -> char [" + curChar + "] replaced with [" + replacement + "]", module);
}
value.replace(i, i+1, replacement);
}
@@ -122,11 +122,11 @@ public final class TransactionUtil implements Status {
try {
int currentStatus = ut.getStatus();
if (Debug.verboseOn()) {
if (Debug.verboseOn()) Debug.logVerbose("Current status : " + getTransactionStateString(currentStatus), module);
Debug.logVerbose("Current status : " + getTransactionStateString(currentStatus), module);
}
if (currentStatus == Status.STATUS_ACTIVE) {
if (Debug.verboseOn()) {
if (Debug.verboseOn()) Debug.logVerbose("Active transaction in place, so no transaction begun", module);
Debug.logVerbose("Active transaction in place, so no transaction begun", module);
}
return false;
} else if (currentStatus == Status.STATUS_MARKED_ROLLBACK) {
@@ -182,14 +182,14 @@ public final class TransactionUtil implements Status {
if (timeout > 0) {
ut.setTransactionTimeout(timeout);
if (Debug.verboseOn()) {
if (Debug.verboseOn()) Debug.logVerbose("Set transaction timeout to : " + timeout + " seconds", module);
Debug.logVerbose("Set transaction timeout to : " + timeout + " seconds", module);
}
}
// begin the transaction
ut.begin();
if (Debug.verboseOn()) {
if (Debug.verboseOn()) Debug.logVerbose("Transaction begun", module);
Debug.logVerbose("Transaction begun", module);
}
// reset the timeout to the default