lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject svn commit: r1359188 - in /lucene/dev/branches/lucene4199/solr: core/src/java/org/apache/solr/handler/ core/src/java/org/apache/solr/handler/admin/ core/src/java/org/apache/solr/handler/component/ core/src/java/org/apache/solr/internal/csv/ core/src/ja...
Date Mon, 09 Jul 2012 14:22:21 GMT
Author: rmuir
Date: Mon Jul  9 14:22:20 2012
New Revision: 1359188

URL: http://svn.apache.org/viewvc?rev=1359188&view=rev
Log:
LUCENE-4199: fix remaining violations

Modified:
    lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/handler/SnapShooter.java
    lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/handler/admin/SystemInfoHandler.java
    lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/handler/admin/ThreadDumpHandler.java
    lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
    lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/internal/csv/CSVParser.java
    lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/internal/csv/writer/CSVConfigGuesser.java
    lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/search/function/FileFloatSource.java
    lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/servlet/cache/HttpCacheHeaderUtil.java
    lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/spelling/WordBreakSolrSpellChecker.java
    lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/update/SolrIndexWriter.java
    lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/util/NumberUtils.java
    lucene/dev/branches/lucene4199/solr/core/src/test/org/apache/solr/handler/component/QueryElevationComponentTest.java
    lucene/dev/branches/lucene4199/solr/core/src/test/org/apache/solr/internal/csv/writer/CSVConfigGuesserTest.java
    lucene/dev/branches/lucene4199/solr/solrj/src/test/org/apache/solr/client/solrj/SolrQueryTest.java
    lucene/dev/branches/lucene4199/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java

Modified: lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/handler/SnapShooter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/handler/SnapShooter.java?rev=1359188&r1=1359187&r2=1359188&view=diff
==============================================================================
--- lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/handler/SnapShooter.java
(original)
+++ lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/handler/SnapShooter.java
Mon Jul  9 14:22:20 2012
@@ -151,7 +151,7 @@ public class SnapShooter {
         if(m.find()) {
           try {
             this.dir = dir;
-            this.timestamp = new SimpleDateFormat(DATE_FMT).parse(m.group(1));
+            this.timestamp = new SimpleDateFormat(DATE_FMT, Locale.ROOT).parse(m.group(1));
           } catch(Exception e) {
             this.dir = null;
             this.timestamp = null;

Modified: lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/handler/admin/SystemInfoHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/handler/admin/SystemInfoHandler.java?rev=1359188&r1=1359187&r2=1359188&view=diff
==============================================================================
--- lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/handler/admin/SystemInfoHandler.java
(original)
+++ lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/handler/admin/SystemInfoHandler.java
Mon Jul  9 14:22:20 2012
@@ -19,12 +19,14 @@ package org.apache.solr.handler.admin;
 
 import java.io.DataInputStream;
 import java.io.File;
+import java.io.InputStreamReader;
 import java.lang.management.ManagementFactory;
 import java.lang.management.OperatingSystemMXBean;
 import java.lang.management.RuntimeMXBean;
 import java.lang.reflect.Method;
 import java.net.InetAddress;
 import java.net.UnknownHostException;
+import java.nio.charset.Charset;
 import java.text.DecimalFormat;
 import java.util.Date;
 import java.util.Locale;
@@ -180,7 +182,7 @@ public class SystemInfoHandler extends R
       process = Runtime.getRuntime().exec(cmd);
       in = new DataInputStream( process.getInputStream() );
       // use default charset from locale here, because the command invoked also uses the
default locale:
-      return IOUtils.toString(in);
+      return IOUtils.toString(new InputStreamReader(in, Charset.defaultCharset()));
     }
     catch( Exception ex ) {
       // ignore - log.warn("Error executing command", ex);

Modified: lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/handler/admin/ThreadDumpHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/handler/admin/ThreadDumpHandler.java?rev=1359188&r1=1359187&r2=1359188&view=diff
==============================================================================
--- lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/handler/admin/ThreadDumpHandler.java
(original)
+++ lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/handler/admin/ThreadDumpHandler.java
Mon Jul  9 14:22:20 2012
@@ -21,6 +21,7 @@ import java.io.IOException;
 import java.lang.management.ManagementFactory;
 import java.lang.management.ThreadInfo;
 import java.lang.management.ThreadMXBean;
+import java.util.Locale;
 
 import org.apache.solr.common.util.NamedList;
 import org.apache.solr.common.util.SimpleOrderedMap;
@@ -119,7 +120,7 @@ public class ThreadDumpHandler extends R
   }
   
   private static String formatNanos(long ns) {
-    return String.format("%.4fms", ns / (double) 1000000);
+    return String.format(Locale.ROOT, "%.4fms", ns / (double) 1000000);
   }
 
   //////////////////////// SolrInfoMBeans methods //////////////////////

Modified: lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java?rev=1359188&r1=1359187&r2=1359188&view=diff
==============================================================================
--- lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
(original)
+++ lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
Mon Jul  9 14:22:20 2012
@@ -180,7 +180,7 @@ public class QueryComponent extends Sear
     try {
        responseFormat = Grouping.Format.valueOf(formatStr);
     } catch (IllegalArgumentException e) {
-      throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, String.format("Illegal
%s parameter", GroupParams.GROUP_FORMAT));
+      throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, String.format(Locale.ROOT,
"Illegal %s parameter", GroupParams.GROUP_FORMAT));
     }
     groupingSpec.setResponseFormat(responseFormat);
 
@@ -386,7 +386,7 @@ public class QueryComponent extends Sear
         if (grouping.isSignalCacheWarning()) {
           rsp.add(
               "cacheWarning",
-              String.format("Cache limit of %d percent relative to maxdoc has exceeded. Please
increase cache size or disable caching.", maxDocsPercentageToCache)
+              String.format(Locale.ROOT, "Cache limit of %d percent relative to maxdoc has
exceeded. Please increase cache size or disable caching.", maxDocsPercentageToCache)
           );
         }
         rb.setResult(result);

Modified: lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/internal/csv/CSVParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/internal/csv/CSVParser.java?rev=1359188&r1=1359187&r2=1359188&view=diff
==============================================================================
--- lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/internal/csv/CSVParser.java
(original)
+++ lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/internal/csv/CSVParser.java
Mon Jul  9 14:22:20 2012
@@ -106,16 +106,6 @@ public class CSVParser {
   // ======================================================
   
   /**
-   * Default strategy for the parser follows the default {@link CSVStrategy}.
-   * 
-   * @param input an InputStream containing "csv-formatted" stream
-   * @deprecated use {@link #CSVParser(Reader)}.
-   */
-  public CSVParser(InputStream input) {
-    this(new InputStreamReader(input));
-  }
-  
-  /**
    * CSV parser using the default {@link CSVStrategy}.
    * 
    * @param input a Reader containing "csv-formatted" input

Modified: lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/internal/csv/writer/CSVConfigGuesser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/internal/csv/writer/CSVConfigGuesser.java?rev=1359188&r1=1359187&r2=1359188&view=diff
==============================================================================
--- lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/internal/csv/writer/CSVConfigGuesser.java
(original)
+++ lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/internal/csv/writer/CSVConfigGuesser.java
Mon Jul  9 14:22:20 2012
@@ -22,6 +22,8 @@ import java.io.BufferedReader;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 
+import org.apache.lucene.util.IOUtils;
+
 /**
  * Tries to guess a config based on an InputStream.
  *
@@ -74,7 +76,7 @@ public class CSVConfigGuesser {
     public CSVConfig guess() {
         try {
             // tralalal
-            BufferedReader bIn = new BufferedReader(new InputStreamReader((getInputStream())));
+            BufferedReader bIn = new BufferedReader(new InputStreamReader(getInputStream(),
IOUtils.CHARSET_UTF_8));
             String[] lines = new String[10];
             String line = null;
             int counter = 0;

Modified: lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/search/function/FileFloatSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/search/function/FileFloatSource.java?rev=1359188&r1=1359187&r2=1359188&view=diff
==============================================================================
--- lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/search/function/FileFloatSource.java
(original)
+++ lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/search/function/FileFloatSource.java
Mon Jul  9 14:22:20 2012
@@ -39,6 +39,7 @@ import org.apache.lucene.queries.functio
 import org.apache.lucene.queries.function.docvalues.FloatDocValues;
 import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.util.BytesRef;
+import org.apache.lucene.util.IOUtils;
 import org.apache.solr.core.SolrCore;
 import org.apache.solr.handler.RequestHandlerBase;
 import org.apache.solr.handler.RequestHandlerUtils;
@@ -224,7 +225,7 @@ public class FileFloatSource extends Val
       return vals;
     }
 
-    BufferedReader r = new BufferedReader(new InputStreamReader(is));
+    BufferedReader r = new BufferedReader(new InputStreamReader(is, IOUtils.CHARSET_UTF_8));
 
     String idName = ffs.keyField.getName();
     FieldType idType = ffs.keyField.getType();

Modified: lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/servlet/cache/HttpCacheHeaderUtil.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/servlet/cache/HttpCacheHeaderUtil.java?rev=1359188&r1=1359187&r2=1359188&view=diff
==============================================================================
--- lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/servlet/cache/HttpCacheHeaderUtil.java
(original)
+++ lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/servlet/cache/HttpCacheHeaderUtil.java
Mon Jul  9 14:22:20 2012
@@ -77,7 +77,7 @@ public final class HttpCacheHeaderUtil {
           etagCache = "\""
            + new String(Base64.encodeBase64((Long.toHexString
                                              (Long.reverse(indexVersionCache))
-                                             + etagSeed).getBytes()), "US-ASCII")
+                                             + etagSeed).getBytes("US-ASCII")), "US-ASCII")
            + "\"";
         } catch (UnsupportedEncodingException e) {
           throw new RuntimeException(e); // may not happen

Modified: lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/spelling/WordBreakSolrSpellChecker.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/spelling/WordBreakSolrSpellChecker.java?rev=1359188&r1=1359187&r2=1359188&view=diff
==============================================================================
--- lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/spelling/WordBreakSolrSpellChecker.java
(original)
+++ lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/spelling/WordBreakSolrSpellChecker.java
Mon Jul  9 14:22:20 2012
@@ -22,6 +22,7 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Locale;
 import java.util.regex.Pattern;
 
 import org.apache.lucene.analysis.Token;
@@ -126,7 +127,7 @@ public class WordBreakSolrSpellChecker e
     wbsp = new WordBreakSpellChecker();
     String bstb = strParam(config, PARAM_BREAK_SUGGESTION_TIE_BREAKER);
     if (bstb != null) {
-      bstb = bstb.toUpperCase();
+      bstb = bstb.toUpperCase(Locale.ROOT);
       if (bstb.equals(BreakSuggestionTieBreaker.SUM_FREQ.name())) {
         sortMethod = BreakSuggestionSortMethod.NUM_CHANGES_THEN_SUMMED_FREQUENCY;
       } else if (bstb.equals(BreakSuggestionTieBreaker.MAX_FREQ.name())) {

Modified: lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/update/SolrIndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/update/SolrIndexWriter.java?rev=1359188&r1=1359187&r2=1359188&view=diff
==============================================================================
--- lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/update/SolrIndexWriter.java
(original)
+++ lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/update/SolrIndexWriter.java
Mon Jul  9 14:22:20 2012
@@ -75,7 +75,7 @@ public class SolrIndexWriter extends Ind
       File parent = f.getParentFile();
       if (parent != null) parent.mkdirs();
       FileOutputStream fos = new FileOutputStream(f, true);
-      return new PrintStreamInfoStream(new PrintStream(fos, true));
+      return new PrintStreamInfoStream(new PrintStream(fos, true, "UTF-8"));
     } else {
       return InfoStream.NO_OUTPUT;
     }

Modified: lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/util/NumberUtils.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/util/NumberUtils.java?rev=1359188&r1=1359187&r2=1359188&view=diff
==============================================================================
--- lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/util/NumberUtils.java
(original)
+++ lucene/dev/branches/lucene4199/solr/core/src/java/org/apache/solr/util/NumberUtils.java
Mon Jul  9 14:22:20 2012
@@ -18,6 +18,7 @@
 package org.apache.solr.util;
 
 import java.text.NumberFormat;
+import java.util.Locale;
 
 import org.apache.lucene.util.BytesRef;
 
@@ -27,7 +28,7 @@ import org.apache.lucene.util.BytesRef;
 public class NumberUtils {
 
   public static String readableSize(long size) {
-    NumberFormat formatter = NumberFormat.getNumberInstance();
+    NumberFormat formatter = NumberFormat.getNumberInstance(Locale.ROOT);
     formatter.setMaximumFractionDigits(2);
     if (size / (1024 * 1024 * 1024) > 0) {
       return formatter.format(size * 1.0d / (1024 * 1024 * 1024)) + " GB";

Modified: lucene/dev/branches/lucene4199/solr/core/src/test/org/apache/solr/handler/component/QueryElevationComponentTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4199/solr/core/src/test/org/apache/solr/handler/component/QueryElevationComponentTest.java?rev=1359188&r1=1359187&r2=1359188&view=diff
==============================================================================
--- lucene/dev/branches/lucene4199/solr/core/src/test/org/apache/solr/handler/component/QueryElevationComponentTest.java
(original)
+++ lucene/dev/branches/lucene4199/solr/core/src/test/org/apache/solr/handler/component/QueryElevationComponentTest.java
Mon Jul  9 14:22:20 2012
@@ -19,6 +19,7 @@ package org.apache.solr.handler.componen
 
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.util.BytesRef;
+import org.apache.lucene.util.IOUtils;
 import org.apache.solr.SolrTestCaseJ4;
 import org.apache.solr.common.params.CommonParams;
 import org.apache.solr.common.params.MapSolrParams;
@@ -34,6 +35,7 @@ import org.junit.Test;
 
 import java.io.File;
 import java.io.FileOutputStream;
+import java.io.OutputStreamWriter;
 import java.io.PrintWriter;
 import java.util.HashMap;
 import java.util.Map;
@@ -412,7 +414,7 @@ public class QueryElevationComponentTest
 
   // write a test file to boost some docs
   private void writeFile(File file, String query, String... ids) throws Exception {
-    PrintWriter out = new PrintWriter(new FileOutputStream(file));
+    PrintWriter out = new PrintWriter(new OutputStreamWriter(new FileOutputStream(file),
IOUtils.CHARSET_UTF_8));
     out.println("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>");
     out.println("<elevate>");
     out.println("<query text=\"" + query + "\">");

Modified: lucene/dev/branches/lucene4199/solr/core/src/test/org/apache/solr/internal/csv/writer/CSVConfigGuesserTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4199/solr/core/src/test/org/apache/solr/internal/csv/writer/CSVConfigGuesserTest.java?rev=1359188&r1=1359187&r2=1359188&view=diff
==============================================================================
--- lucene/dev/branches/lucene4199/solr/core/src/test/org/apache/solr/internal/csv/writer/CSVConfigGuesserTest.java
(original)
+++ lucene/dev/branches/lucene4199/solr/core/src/test/org/apache/solr/internal/csv/writer/CSVConfigGuesserTest.java
Mon Jul  9 14:22:20 2012
@@ -43,7 +43,7 @@ public class CSVConfigGuesserTest extend
      *  1234 ; abcd ; 1234 ;
      *
      */
-    public void testConfigGuess1() {
+    public void testConfigGuess1() throws Exception {
         CSVConfig expected = new CSVConfig();
         expected.setDelimiter(';');
         expected.setValueDelimiter(' ');
@@ -57,7 +57,7 @@ public class CSVConfigGuesserTest extend
         StringBuffer sb = new StringBuffer();
         sb.append("1234;abcd;1234\n");
         sb.append("abcd;1234;abcd");
-        ByteArrayInputStream in = new ByteArrayInputStream(sb.toString().getBytes());
+        ByteArrayInputStream in = new ByteArrayInputStream(sb.toString().getBytes("UTF-8"));
         CSVConfigGuesser guesser = new CSVConfigGuesser(in);
         CSVConfig guessed = guesser.guess();
         assertEquals(expected.isFixedWidth(), guessed.isFixedWidth());
@@ -70,7 +70,7 @@ public class CSVConfigGuesserTest extend
      *  1,2,3,4
      *
      */
-    public void testConfigGuess2() {
+    public void testConfigGuess2() throws Exception {
         CSVConfig expected = new CSVConfig();
         expected.setDelimiter(';');
         expected.setValueDelimiter(' ');
@@ -80,7 +80,7 @@ public class CSVConfigGuesserTest extend
         StringBuffer sb = new StringBuffer();
         sb.append("1,2,3,4\n");
         sb.append("abcd,1234,abcd,1234");
-        ByteArrayInputStream in = new ByteArrayInputStream(sb.toString().getBytes());
+        ByteArrayInputStream in = new ByteArrayInputStream(sb.toString().getBytes("UTF-8"));
         CSVConfigGuesser guesser = new CSVConfigGuesser(in);
         CSVConfig guessed = guesser.guess();
         assertEquals(expected.isFixedWidth(), guessed.isFixedWidth());

Modified: lucene/dev/branches/lucene4199/solr/solrj/src/test/org/apache/solr/client/solrj/SolrQueryTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4199/solr/solrj/src/test/org/apache/solr/client/solrj/SolrQueryTest.java?rev=1359188&r1=1359187&r2=1359188&view=diff
==============================================================================
--- lucene/dev/branches/lucene4199/solr/solrj/src/test/org/apache/solr/client/solrj/SolrQueryTest.java
(original)
+++ lucene/dev/branches/lucene4199/solr/solrj/src/test/org/apache/solr/client/solrj/SolrQueryTest.java
Mon Jul  9 14:22:20 2012
@@ -26,6 +26,7 @@ import org.apache.solr.common.util.DateU
 import java.util.Calendar;
 import java.util.Date;
 import java.util.Locale;
+import java.util.TimeZone;
 
 /**
  * 
@@ -139,7 +140,7 @@ public class SolrQueryTest extends Lucen
 
   public void testFacetDateRange() {
     SolrQuery q = new SolrQuery("dog");
-    Calendar calendar = Calendar.getInstance(Locale.UK);
+    Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"), Locale.UK);
     calendar.set(2010, 1, 1);
     Date start = calendar.getTime();
     calendar.set(2011, 1, 1);

Modified: lucene/dev/branches/lucene4199/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4199/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java?rev=1359188&r1=1359187&r2=1359188&view=diff
==============================================================================
--- lucene/dev/branches/lucene4199/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java
(original)
+++ lucene/dev/branches/lucene4199/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java
Mon Jul  9 14:22:20 2012
@@ -19,6 +19,7 @@ package org.apache.solr.client.solrj.emb
 
 import java.io.File;
 import java.io.FileInputStream;
+import java.io.InputStreamReader;
 
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
@@ -169,7 +170,7 @@ public class TestSolrProperties extends 
       Document document = builder.parse(fis);
       fis.close();
       fis = new FileInputStream(new File(tempDir, SOLR_PERSIST_XML));
-      String solrPersistXml = IOUtils.toString(fis);
+      String solrPersistXml = IOUtils.toString(new InputStreamReader(fis, "UTF-8"));
       //System.out.println("xml:" + solrPersistXml);
       assertTrue("\"/solr/cores[@defaultCoreName='core0']\" doesn't match in:\n" + solrPersistXml,
                  exists("/solr/cores[@defaultCoreName='core0']", document));



Mime
View raw message