[
https://issues.apache.org/jira/browse/HADOOP-11821?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14511810#comment-14511810
]
Akira AJISAKA commented on HADOOP-11821:
----------------------------------------
Hi [~brahmareddy], would you please fix the findbugs warnings in {{new
FileWriter(String)}} and replace the code with try-with-resources statement?
{code}
private static void generateSLSNodeFile(String outputFile)
throws IOException {
Writer output = new FileWriter(outputFile);
try {
{code}
The following code can be replaced as well.
{code}
@@ -119,9 +121,11 @@ public static void main(String args[]) throws Exception {
private static void generateSLSLoadFile(String inputFile, String outputFile)
throws IOException {
- Reader input = new FileReader(inputFile);
+ Reader input =
+ new InputStreamReader(new FileInputStream(inputFile), "UTF-8");
try {
- Writer output = new FileWriter(outputFile);
+ Writer output =
+ new OutputStreamWriter(new FileOutputStream(outputFile), "UTF-8");
try {
{code}
> Fix findbugs warnings in hadoop-sls
> -----------------------------------
>
> Key: HADOOP-11821
> URL: https://issues.apache.org/jira/browse/HADOOP-11821
> Project: Hadoop Common
> Issue Type: Bug
> Components: tools
> Reporter: Akira AJISAKA
> Assignee: Brahma Reddy Battula
> Attachments: HADOOP-11821-001.patch, HADOOP-11821-002.patch,
> HADOOP-11821-003.patch, HADOOP-11821.patch
>
>
> Per
> https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/5388//artifact/patchprocess/newPatchFindbugsWarningshadoop-sls.html,
> there are 13 warnings to be fixed.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)