tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amy Roh <amy...@apache.org>
Subject Re: cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler SmapUtil.java
Date Mon, 20 Sep 2004 18:06:25 GMT
> amyroh@apache.org 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

>
> Rémy 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message