Amy Roh wrote:

[EMAIL PROTECTED] wrote:

amyroh      2004/09/20 10:51:28

Modified: jasper2/src/share/org/apache/jasper/compiler SmapUtil.java
Log:
Remove verbose.
- if (verbose) {
- if (log.isDebugEnabled())
- log.debug("constant pool count: " + constantPoolCount);
- }
+ log("constant pool count: " + constantPoolCount);


You need to keep if (log.isDebugEnabled()), otherwise, zillions of Strings will be created for no reason (as the parameter of your method will have to be created).


I have added the following log helper method so I don't have to do if (log.isDebugEnabled()) everytime I use log.debug()

 +
 +    private static void log(String msg) {
 +        if (log.isDebugEnabled())
 +            log.debug(msg);
 +    }
 +
  }

Amy

>>> + log("constant pool count: " + constantPoolCount);

But even to call your log() method, a String will need to be created that combines the "constant pool count:" with a String.valueOf(constantPoolCount). Even if it's just going to be thrown away.
-Paul

Ah, I see what you mean. I'll commit the fix.



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to