diff --git a/contrib/dataimporthandler/CHANGES.txt b/contrib/dataimporthandler/CHANGES.txt index 2ad98c6e57e..2e695b1d5e4 100644 --- a/contrib/dataimporthandler/CHANGES.txt +++ b/contrib/dataimporthandler/CHANGES.txt @@ -158,6 +158,9 @@ Bug Fixes 20.SOLR-1040: XPathEntityProcessor fails with an xpath like /feed/entry/link[@type='text/html']/@href (Noble Paul via shalin) +21.SOLR-1042: Fix memory leak in DIH by making TemplateString non-static member in VariableResolverImpl + (Ryuuichi Kumai via shalin) + Documentation ---------------------- diff --git a/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/VariableResolverImpl.java b/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/VariableResolverImpl.java index 78bc18ca06c..6e26a5df5f1 100644 --- a/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/VariableResolverImpl.java +++ b/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/VariableResolverImpl.java @@ -39,7 +39,7 @@ public class VariableResolverImpl extends VariableResolver { */ ContextImpl context; - private static final TemplateString TEMPLATE_STRING = new TemplateString(); + private final TemplateString templateString = new TemplateString(); public VariableResolverImpl() { } @@ -84,7 +84,7 @@ public class VariableResolverImpl extends VariableResolver { } public String replaceTokens(String template) { - return TEMPLATE_STRING.replaceTokens(template, this); + return templateString.replaceTokens(template, this); } @SuppressWarnings("unchecked")