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
1 changed files with 3 additions and 1 deletions

View File

@ -49,6 +49,7 @@ import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.Writer;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
@ -218,7 +219,8 @@ public class YarnServiceJobSubmitter implements JobSubmitter {
private String generateCommandLaunchScript(RunJobParameters parameters,
TaskType taskType, Component comp) throws IOException {
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);
try {