LUCENE-6637: Fix FSTTester to not violate file permissions on -Dtests.verbose=true

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1688317 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2015-06-29 21:54:08 +00:00
parent 7ac8dd4111
commit 4b758ee3fe
2 changed files with 11 additions and 6 deletions

View File

@ -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

View File

@ -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) {