From 14413989cac9acc1fa6f8d330fac32f772613325 Mon Sep 17 00:00:00 2001 From: Akira Ajisaka Date: Tue, 7 Mar 2017 13:10:59 +0900 Subject: [PATCH] MAPREDUCE-6855. Specify charset when create String in CredentialsTestJob. Contributed by Kai Sasaki. --- .../apache/hadoop/mapreduce/security/CredentialsTestJob.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/security/CredentialsTestJob.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/security/CredentialsTestJob.java index e66fb2fbf3..755e2dfba6 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/security/CredentialsTestJob.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/security/CredentialsTestJob.java @@ -19,6 +19,7 @@ package org.apache.hadoop.mapreduce.security; import java.io.IOException; +import java.nio.charset.StandardCharsets; import org.apache.hadoop.conf.Configuration; @@ -64,7 +65,7 @@ private static void checkSecrets(Credentials ts) { // fail the test } - String secretValueStr = new String (secretValue); + String secretValueStr = new String (secretValue, StandardCharsets.UTF_8); System.out.println(secretValueStr); if ( !("password"+i).equals(secretValueStr)){