tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 54017] new String instance is generated for constant string in Generator.convertString
Date Tue, 04 Dec 2012 11:49:48 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=54017

--- Comment #2 from Konstantin Kolinko <knst.kolinko@gmail.com> ---
Regarding this fix ( r1402122 r1402123 ),

The JSP 2.2 spec chapter JSP.1.14.2.1 "Conversions from String values"
defines conversion to an Object as

[quote]
"As if new String(string-literal). This results in new String("")
if the string is empty."
[/quote]

This should be the reason for the original code changed by this fix.

Actually I agree with OP and Mark and I see no good reason to use a
String(String) constructor here.

The only good point I see in String(String) constructor is that it trims the
backing char array to contain only the needed count of characters, but I do not
think it is important here.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


Mime
View raw message