tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antonio Fiol BonnĂ­n <fiol.bon...@terra.es>
Subject Re: PrintWriter performance
Date Wed, 26 May 2004 19:15:52 GMT

>>4/ depends on the JDK; newer compilers /may/ see a repeat string concat
>>   ("+" op) and replace w/ StringBuffer under the covers...
>>    
>>
>This is a common psuedo-misconception.  Compilers can't do anything with strings
>that have a paramter of which the value can only be realized at runtime.
>
>public static String OPTIMIZED = "optimized";
>
>"This can be " + OPTIMIZED + " at compile time to a single string with no
>concatenation at runtime"
>  
>

You seem to have missed the final keyword. Without it, no optimization 
is possible.

Antonio

Mime
View raw message