Fixed: with "replaces module by MODULE everywhere" I put in a JavaDoc bug.
This fixes it and clarifies things by using className instead of module in code
when used as a var not as the MODULE const.
@@ -84,12 +84,17 @@ public class UtilTimer {
return timerString(message, this.getClass().getName());
}
- /** Creates a string with information including the passed message, the last passed message and the time since the last call, and the time since the beginning
- * @param message A message to put into the timer String
- * @param MODULE The debug/log MODULE/thread to use, can be null for root MODULE
+ /**
+ * Creates a string with information including the passed message, the last passed message and the time since the last call, and the time since
+ * the beginning
+ *
+ * @param message
+ * A message to put into the timer String
+ * @param className
+ * The debug/log className/thread to use, can be null for root className
* @return A String with the timing information, the timer String
*/
- public String timerString(String message, String module) {
+ public String timerString(String message, String className) {
// time this call to avoid it interfering with the main timer
long tsStart = System.currentTimeMillis();
@@ -108,7 +113,7 @@ public class UtilTimer {
lastMessage = message;
String retString = retBuf.toString();
if (log) {
- Debug.log(Debug.TIMING, null, retString, module, "org.apache.ofbiz.base.util.UtilTimer");
+ Debug.log(Debug.TIMING, null, retString, className, MODULE);
}
// have lastMessageTime come as late as possible to just time what happens between calls
@@ -222,17 +227,17 @@ public class UtilTimer {
return timer;
}
- public static void timerLog(String timerName, String message, String module) {
+ public static void timerLog(String timerName, String message, String className) {
UtilTimer timer = UtilTimer.getTimer(timerName);
if (!timer.isRunning()) {
timer.startTimer();
}
if (timer.getLog()) {
- if (module == null) {
- module = timer.getClass().getName();
+ if (className == null) {
+ className = timer.getClass().getName();
}
- timer.timerString(message, module);
+ timer.timerString(message, className);
}
}
@@ -244,9 +249,9 @@ public class UtilTimer {
UtilTimer.closeTimer(timerName, message, null);
}
- public static void closeTimer(String timerName, String message, String module) {
+ public static void closeTimer(String timerName, String message, String className) {
if (message != null) {
- UtilTimer.timerLog(timerName, message, module);
+ UtilTimer.timerLog(timerName, message, className);
}
staticTimers.remove(timerName);
}
