From 9e5d11be8afb088ee09025735237623c9648a4bf Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Tue, 3 Dec 2019 06:28:19 -0500 Subject: [PATCH] fix static leaks, null stuff out in afterclass --- .../org/apache/solr/analytics/ExpressionFactoryTest.java | 6 ++++++ .../function/field/AbstractAnalyticsFieldTest.java | 3 +++ 2 files changed, 9 insertions(+) diff --git a/solr/contrib/analytics/src/test/org/apache/solr/analytics/ExpressionFactoryTest.java b/solr/contrib/analytics/src/test/org/apache/solr/analytics/ExpressionFactoryTest.java index cb5b09f7e81..3e0d0224993 100644 --- a/solr/contrib/analytics/src/test/org/apache/solr/analytics/ExpressionFactoryTest.java +++ b/solr/contrib/analytics/src/test/org/apache/solr/analytics/ExpressionFactoryTest.java @@ -24,6 +24,7 @@ import org.apache.solr.SolrTestCaseJ4; import org.apache.solr.analytics.function.ReductionCollectionManager; import org.apache.solr.analytics.value.constant.ConstantValue; import org.apache.solr.schema.IndexSchema; +import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; @@ -55,6 +56,11 @@ public class ExpressionFactoryTest extends SolrTestCaseJ4 { indexSchema = h.getCore().getLatestSchema(); } + @AfterClass + public static void cleanUp() throws Exception { + indexSchema = null; + } + private ExpressionFactory getExpressionFactory() { ExpressionFactory fact = new ExpressionFactory(indexSchema); fact.startRequest(); diff --git a/solr/contrib/analytics/src/test/org/apache/solr/analytics/function/field/AbstractAnalyticsFieldTest.java b/solr/contrib/analytics/src/test/org/apache/solr/analytics/function/field/AbstractAnalyticsFieldTest.java index 7b20e75cd5a..3c9ee6e7c57 100644 --- a/solr/contrib/analytics/src/test/org/apache/solr/analytics/function/field/AbstractAnalyticsFieldTest.java +++ b/solr/contrib/analytics/src/test/org/apache/solr/analytics/function/field/AbstractAnalyticsFieldTest.java @@ -228,6 +228,9 @@ public class AbstractAnalyticsFieldTest extends SolrTestCaseJ4 { ref.decref(); ref = null; } + indexSchema = null; + searcher = null; + ref = null; } protected void checkSingleFieldValues(Map expected, Map found, Set missing) {