From 16bd79ee8e95dbe69a8c903128572363231e2b01 Mon Sep 17 00:00:00 2001 From: Haohui Mai Date: Mon, 23 Feb 2015 16:37:48 -0800 Subject: [PATCH] HADOOP-10478. Fix new findbugs warnings in hadoop-maven-plugins. Contributed by Li Lu. --- hadoop-common-project/hadoop-common/CHANGES.txt | 3 +++ .../java/org/apache/hadoop/maven/plugin/util/Exec.java | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 373a485e04c..5ad5d4473a3 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -987,6 +987,9 @@ Release 2.7.0 - UNRELEASED HADOOP-11584 s3a file block size set to 0 in getFileStatus. (Brahma Reddy Battula via stevel) + HADOOP-10478. Fix new findbugs warnings in hadoop-maven-plugins. + (Li Lu via wheat9) + Release 2.6.1 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/util/Exec.java b/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/util/Exec.java index 141ab5afc3f..37dbc72f2f2 100644 --- a/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/util/Exec.java +++ b/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/util/Exec.java @@ -19,6 +19,7 @@ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; +import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.List; @@ -87,7 +88,11 @@ public class Exec { public OutputBufferThread(InputStream is) { this.setDaemon(true); output = new ArrayList(); - reader = new BufferedReader(new InputStreamReader(is)); + try { + reader = new BufferedReader(new InputStreamReader(is, "UTF-8")); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException("Unsupported encoding " + e.toString()); + } } @Override