Skip to content

Commit 1db92d4

Browse files
committed
Simplify Path creation
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=118594886
1 parent 459ad8a commit 1db92d4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core/src/main/java/com/google/googlejavaformat/java/FormatFileCallable.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import com.google.googlejavaformat.java.JavaFormatterOptions.SortImports;
2626

2727
import java.io.BufferedOutputStream;
28-
import java.io.File;
2928
import java.io.FileOutputStream;
3029
import java.io.IOException;
3130
import java.io.InputStream;
@@ -35,6 +34,7 @@
3534
import java.io.Writer;
3635
import java.nio.charset.StandardCharsets;
3736
import java.nio.file.Files;
37+
import java.nio.file.Paths;
3838
import java.nio.file.StandardCopyOption;
3939
import java.util.ArrayList;
4040
import java.util.List;
@@ -236,8 +236,8 @@ private boolean writeOutput(Write write) {
236236
}
237237
try {
238238
Files.move(
239-
new File(tempFileName).toPath(),
240-
new File(fileToFormat.fileName()).toPath(),
239+
Paths.get(tempFileName),
240+
Paths.get(fileToFormat.fileName()),
241241
StandardCopyOption.REPLACE_EXISTING);
242242
} catch(IOException e) {
243243
synchronized (outputLock) {

0 commit comments

Comments
 (0)