From 7bceb13ba9634123a92a091f93b3b04c14473678 Mon Sep 17 00:00:00 2001 From: Haohui Mai Date: Tue, 9 Dec 2014 10:41:35 -0800 Subject: [PATCH] HADOOP-11367. Fix warnings from findbugs 3.0 in hadoop-streaming. Contributed by Li Lu. --- hadoop-common-project/hadoop-common/CHANGES.txt | 2 ++ .../main/java/org/apache/hadoop/streaming/Environment.java | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index a0a10b819a1..425cab7e71b 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -534,6 +534,8 @@ Release 2.7.0 - UNRELEASED HADOOP-10134 [JDK8] Fix Javadoc errors caused by incorrect or illegal tags in doc comments. (apurtell via stevel) + HADOOP-11367. Fix warnings from findbugs 3.0 in hadoop-streaming. (Li Lu via wheat9) + Release 2.6.0 - 2014-11-18 INCOMPATIBLE CHANGES diff --git a/hadoop-tools/hadoop-streaming/src/main/java/org/apache/hadoop/streaming/Environment.java b/hadoop-tools/hadoop-streaming/src/main/java/org/apache/hadoop/streaming/Environment.java index bd76c319982..98d8aa03064 100644 --- a/hadoop-tools/hadoop-streaming/src/main/java/org/apache/hadoop/streaming/Environment.java +++ b/hadoop-tools/hadoop-streaming/src/main/java/org/apache/hadoop/streaming/Environment.java @@ -20,6 +20,7 @@ package org.apache.hadoop.streaming; import java.io.*; import java.net.InetAddress; +import java.nio.charset.Charset; import java.util.*; import org.apache.hadoop.classification.InterfaceAudience; @@ -62,7 +63,8 @@ public class Environment extends Properties { // Read the environment variables Process pid = Runtime.getRuntime().exec(command); - BufferedReader in = new BufferedReader(new InputStreamReader(pid.getInputStream())); + BufferedReader in = new BufferedReader( + new InputStreamReader(pid.getInputStream(), Charset.forName("UTF-8"))); try { while (true) { String line = in.readLine();