tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: svn commit: r1514485 - in /tomcat/trunk/java/org/apache: coyote/ajp/AbstractAjpProcessor.java coyote/http11/AbstractOutputBuffer.java coyote/spdy/SpdyProcessor.java tomcat/util/http/HttpMessages.java
Date Wed, 11 Sep 2013 13:13:41 GMT
On 11/09/2013 01:24, Konstantin Kolinko wrote:
> 2013/8/16  <markt@apache.org>:
>> Author: markt
>> Date: Thu Aug 15 20:51:38 2013
>> New Revision: 1514485
>>
>> URL: http://svn.apache.org/r1514485
>> Log:
>> Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55399
>> Have the message in the response line use the locale set for the response.
>>
>> Modified:
>>     tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java
>>     tomcat/trunk/java/org/apache/coyote/http11/AbstractOutputBuffer.java
>>     tomcat/trunk/java/org/apache/coyote/spdy/SpdyProcessor.java
>>     tomcat/trunk/java/org/apache/tomcat/util/http/HttpMessages.java
>>
> 
>>
>> +
>> +    public static HttpMessages getInstance(Locale locale) {
>> +        HttpMessages result = instances.get(locale);
>> +        if (result == null) {
>> +            StringManager sm = StringManager.getManager(
>> +                    "org.apache.tomcat.util.http.res", locale);
>> +            if (Locale.getDefault().equals(sm.getLocale())) {
>> +                result = DEFAULT;
>> +            } else {
>> +                result = new HttpMessages(sm);
>> +            }
>> +            instances.put(locale, result);
>> +        }
>> +        return result;
>> +    }
>> +
> 
> What a bit bothers me here (and in earlier changes to ErrorReportValve
> etc. - r1514496) is that locale is provided by client and thus the
> caches here and in StringManager can grow, instead of being limited to
> the few locales that are actually bundled with Tomcat.

That is a fair point. I'll take another look.

Mark


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


Mime
View raw message