YARN-8975. [Submarine] Use predefined Charset object StandardCharsets.UTF_8 instead of String UTF-8. (Zhankun Tang via wangda)

Change-Id: If6c7904aa17895e543cfca245264249eb7328bdc
This commit is contained in:
Wangda Tan 2018-11-28 14:39:06 -08:00
parent 8ebeda98a9
commit 897643928c

View File

@ -49,6 +49,7 @@
import java.io.OutputStreamWriter; import java.io.OutputStreamWriter;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.io.Writer; import java.io.Writer;
import java.nio.charset.StandardCharsets;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
@ -218,7 +219,8 @@ private String getDNSDomain() {
private String generateCommandLaunchScript(RunJobParameters parameters, private String generateCommandLaunchScript(RunJobParameters parameters,
TaskType taskType, Component comp) throws IOException { TaskType taskType, Component comp) throws IOException {
File file = File.createTempFile(taskType.name() + "-launch-script", ".sh"); File file = File.createTempFile(taskType.name() + "-launch-script", ".sh");
Writer w = new OutputStreamWriter(new FileOutputStream(file), "UTF-8"); Writer w = new OutputStreamWriter(new FileOutputStream(file),
StandardCharsets.UTF_8);
PrintWriter pw = new PrintWriter(w); PrintWriter pw = new PrintWriter(w);
try { try {