On 11/09/2013 14:13, Mark Thomas wrote: > On 11/09/2013 01:24, Konstantin Kolinko wrote: >> 2013/8/16 <ma...@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.
Because the method is synchronized we can simply use a LinkedHashMap here. I have a fix I'll be applying shortly (I have a couple of other fixes sat in my local git repo that I need to commit as well). Mark --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org