Skip to content

Commit e93ff38

Browse files
committed
Remove RandomAccessFile
1 parent bf3e9f0 commit e93ff38

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lucene/core/src/test/org/apache/lucene/util/fst/TestFSTs.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,15 @@
2222

2323
import java.io.BufferedReader;
2424
import java.io.ByteArrayOutputStream;
25-
import java.io.File;
2625
import java.io.IOException;
27-
import java.io.RandomAccessFile;
2826
import java.io.StringWriter;
2927
import java.io.Writer;
3028
import java.nio.channels.FileChannel;
3129
import java.nio.charset.StandardCharsets;
3230
import java.nio.file.Files;
3331
import java.nio.file.Path;
3432
import java.nio.file.Paths;
33+
import java.nio.file.StandardOpenOption;
3534
import java.util.ArrayList;
3635
import java.util.Arrays;
3736
import java.util.Collections;
@@ -108,9 +107,8 @@ public void tearDown() throws Exception {
108107
}
109108

110109
public void testFSAWithFileChannel() throws IOException {
111-
File file = createTempFile().toFile();
112-
try (RandomAccessFile raf = new RandomAccessFile(file, "rw")) {
113-
FileChannel fileChannel = raf.getChannel();
110+
Path path = createTempFile();
111+
try (FileChannel fileChannel = FileChannel.open(path, StandardOpenOption.READ, StandardOpenOption.WRITE)) {
114112
String[] strings2 =
115113
new String[] {
116114
"station", "commotion", "elation", "elastic", "plastic", "stop", "ftop", "ftation"

0 commit comments

Comments
 (0)