# HG changeset patch
# User asaha
# Date 1496853156 -3600
# Wed Jun 07 17:32:36 2017 +0100
# Node ID a1b7baf74b49a4a0889b331980d60a7e3699f583
# Parent 59204456ee2f82d6d6b84d2e40f78a42c85fa0ec
7177216, PR3398, RH1446700: native2ascii changes file permissions of input file
Reviewed-by: sherman, alanb
diff --git a/src/share/classes/sun/tools/native2ascii/Main.java b/src/share/classes/sun/tools/native2ascii/Main.java
--- openjdk/jdk/src/share/classes/sun/tools/native2ascii/Main.java
+++ openjdk/jdk/src/share/classes/sun/tools/native2ascii/Main.java
@@ -71,7 +71,6 @@
import java.nio.charset.CharsetEncoder;
import java.nio.charset.Charset;
import java.nio.charset.IllegalCharsetNameException;
-import java.nio.file.Files;
import java.io.UnsupportedEncodingException;
import java.nio.charset.UnsupportedCharsetException;
import sun.tools.native2ascii.A2NFilter;
@@ -241,7 +240,9 @@
if (tempDir == null)
tempDir = new File(System.getProperty("user.dir"));
- tempFile = Files.createTempFile(tempDir.toPath(), "_N2A", ".TMP").toFile();
+ tempFile = File.createTempFile("_N2A",
+ ".TMP",
+ tempDir);
tempFile.deleteOnExit();
try {
@@ -291,7 +292,9 @@
File tempDir = f.getParentFile();
if (tempDir == null)
tempDir = new File(System.getProperty("user.dir"));
- tempFile = Files.createTempFile(tempDir.toPath(), "_N2A", ".TMP").toFile();
+ tempFile = File.createTempFile("_N2A",
+ ".TMP",
+ tempDir);
tempFile.deleteOnExit();
try {