lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r1688317 - in /lucene/dev/trunk/lucene: CHANGES.txt test-framework/src/java/org/apache/lucene/util/fst/FSTTester.java
Date Mon, 29 Jun 2015 21:54:08 GMT
Author: uschindler
Date: Mon Jun 29 21:54:08 2015
New Revision: 1688317

URL: http://svn.apache.org/r1688317
Log:
LUCENE-6637: Fix FSTTester to not violate file permissions on -Dtests.verbose=true

Modified:
    lucene/dev/trunk/lucene/CHANGES.txt
    lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/fst/FSTTester.java

Modified: lucene/dev/trunk/lucene/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/CHANGES.txt?rev=1688317&r1=1688316&r2=1688317&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/CHANGES.txt (original)
+++ lucene/dev/trunk/lucene/CHANGES.txt Mon Jun 29 21:54:08 2015
@@ -254,6 +254,11 @@ Build
 * LUCENE-6568: Make rat invocation depend on ivy configuration being set up
   (Ramkumar Aiyengar)
 
+Test Framework
+
+* LUCENE-6637: Fix FSTTester to not violate file permissions on
+  -Dtests.verbose=true.  (Mesbah M. Alam, Uwe Schindler)
+
 Changes in Backwards Compatibility Policy
 
 * LUCENE-6553: The iterator returned by the LeafReader.postings method now

Modified: lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/fst/FSTTester.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/fst/FSTTester.java?rev=1688317&r1=1688316&r2=1688317&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/fst/FSTTester.java
(original)
+++ lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/fst/FSTTester.java
Mon Jun 29 21:54:08 2015
@@ -18,10 +18,9 @@ package org.apache.lucene.util.fst;
  */
 
 import java.io.IOException;
+import java.io.OutputStreamWriter;
 import java.io.Writer;
-import java.nio.charset.StandardCharsets;
-import java.nio.file.Files;
-import java.nio.file.Paths;
+import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -321,10 +320,11 @@ public class FSTTester<T> {
     }
 
     if (LuceneTestCase.VERBOSE && pairs.size() <= 20 && fst != null) {
-      Writer w = Files.newBufferedWriter(Paths.get("out.dot"), StandardCharsets.UTF_8);
+      System.out.println("Printing FST as dot file to stdout:");
+      final Writer w = new OutputStreamWriter(System.out, Charset.defaultCharset());
       Util.toDot(fst, w, false, false);
-      w.close();
-      System.out.println("SAVED out.dot");
+      w.flush();
+      System.out.println("END dot file");
     }
 
     if (LuceneTestCase.VERBOSE) {



Mime
View raw message