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:16:37 GMT

>
> Amy Roh wrote:
>
>>> 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
>
> >>>  +            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: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message