HADOOP-11367. Fix warnings from findbugs 3.0 in hadoop-streaming. Contributed by Li Lu.

This commit is contained in:
Haohui Mai 2014-12-09 10:41:35 -08:00
parent b55769369b
commit 7bceb13ba9
2 changed files with 5 additions and 1 deletions

View File

@ -534,6 +534,8 @@ Release 2.7.0 - UNRELEASED
HADOOP-10134 [JDK8] Fix Javadoc errors caused by incorrect or illegal tags in doc HADOOP-10134 [JDK8] Fix Javadoc errors caused by incorrect or illegal tags in doc
comments. (apurtell via stevel) 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 Release 2.6.0 - 2014-11-18
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -20,6 +20,7 @@ package org.apache.hadoop.streaming;
import java.io.*; import java.io.*;
import java.net.InetAddress; import java.net.InetAddress;
import java.nio.charset.Charset;
import java.util.*; import java.util.*;
import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceAudience;
@ -62,7 +63,8 @@ public class Environment extends Properties {
// Read the environment variables // Read the environment variables
Process pid = Runtime.getRuntime().exec(command); 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 { try {
while (true) { while (true) {
String line = in.readLine(); String line = in.readLine();