james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Noel J. Bergman" <n...@devtech.com>
Subject RE: isLogEnabled() and StringBuffer
Date Fri, 17 Nov 2006 04:01:20 GMT
Stefano Bagnara wrote:

 > Input code 2:
 > String res = foo + "test" + bar + "test" + i;

 > Output code 2 from jdk 1.4
 > String s2 = s + "test" + s1 + "test" + i;

 > Output code 2 from jdk 1.5
 > String s2 = (new StringBuilder()).append(s).append("test")
 >     .append(s1).append("test").append(i).toString();

> I also tried using jdk1.5 using target 1.4 and the resulting class equal 
> to the jdk1.4 generated class.

No surprise there.  StringBuilder is new in 1.5.0.

> if we compile with jdk 1.5 it is better to use real string concatenation
> even when we have variables and not only literals.

Perhaps.

> It seems that using jdk1.4 results are comparable

How do you come to that conclusion?  I don't agree.

	--- Noel


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


Mime
View raw message