diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 55ee4c787c6..6f57d6a5782 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -106,6 +106,9 @@ Other Changes * SOLR-7599: Remove cruft from SolrCloud tests. (shalin) +* SOLR-7610: Fix VelocityResponseWriter's $resource.locale to accurately report locale in use. + (ehatcher) + ================== 5.2.0 ================== Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release diff --git a/solr/contrib/velocity/src/java/org/apache/solr/response/VelocityResponseWriter.java b/solr/contrib/velocity/src/java/org/apache/solr/response/VelocityResponseWriter.java index 68283747a45..05456e4bcf6 100644 --- a/solr/contrib/velocity/src/java/org/apache/solr/response/VelocityResponseWriter.java +++ b/solr/contrib/velocity/src/java/org/apache/solr/response/VelocityResponseWriter.java @@ -326,19 +326,18 @@ public class VelocityResponseWriter implements QueryResponseWriter, SolrCoreAwar // see: http://svn.apache.org/repos/asf/velocity/tools/branches/2.0.x/src/main/java/org/apache/velocity/tools/generic/ResourceTool.java private class SolrVelocityResourceTool extends ResourceTool { - private final Locale locale; private ClassLoader solrClassLoader; public SolrVelocityResourceTool(ClassLoader cl, String localeString) { this.solrClassLoader = cl; Locale l = toLocale(localeString); - this.locale = (l == null ? Locale.ROOT : l); + this.setLocale(l == null ? Locale.ROOT : l); } @Override protected ResourceBundle getBundle(String baseName, Object loc) { // resource bundles for this tool must be in velocity "package" - return ResourceBundle.getBundle("velocity." + baseName, locale, solrClassLoader); + return ResourceBundle.getBundle("velocity." + baseName, getLocale(), solrClassLoader); } // Why did Velocity Tools make this private? Copied from ResourceTools.java