From d215f9e5681d7bd570eb3c965402a1010f023942 Mon Sep 17 00:00:00 2001 From: Joel Bernstein Date: Wed, 26 Oct 2016 20:08:28 -0400 Subject: [PATCH] SOLR-9533: Fix precommit --- .../apache/solr/core/TestCorePropertiesReload.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/solr/core/src/test/org/apache/solr/core/TestCorePropertiesReload.java b/solr/core/src/test/org/apache/solr/core/TestCorePropertiesReload.java index bb7aaa0f8e9..6e1f768aeff 100644 --- a/solr/core/src/test/org/apache/solr/core/TestCorePropertiesReload.java +++ b/solr/core/src/test/org/apache/solr/core/TestCorePropertiesReload.java @@ -17,12 +17,14 @@ package org.apache.solr.core; import java.io.File; -import java.io.FileWriter; +import java.io.FileOutputStream; +import java.io.OutputStreamWriter; +import java.io.BufferedWriter; +import java.io.Writer; import java.util.Properties; import org.apache.commons.io.FileUtils; import org.apache.solr.SolrTestCaseJ4; -import org.junit.BeforeClass; import org.junit.Test; public class TestCorePropertiesReload extends SolrTestCaseJ4 { @@ -59,11 +61,12 @@ public class TestCorePropertiesReload extends SolrTestCaseJ4 { } private void writeProperties(Properties props) throws Exception { - FileWriter out = null; + Writer out = null; try { File confDir = new File(new File(solrHomeDirectory, "collection1"), "conf"); - out = new FileWriter(new File(confDir, "solrcore.properties")); + out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(confDir, "solrcore.properties")), "UTF8")); props.store(out, "Reload Test"); + } finally { out.close(); }