MAPREDUCE-6855. Specify charset when create String in CredentialsTestJob. Contributed by Kai Sasaki.

(cherry picked from commit 14413989ca)
(cherry picked from commit aa1f944bba)
This commit is contained in:
Akira Ajisaka 2017-03-07 13:10:59 +09:00
parent ff706261be
commit 8b5307c0e7
No known key found for this signature in database
GPG Key ID: C1EDBB9CA400FD50
1 changed files with 2 additions and 1 deletions

View File

@ -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 @@ public class CredentialsTestJob extends Configured implements Tool {
// 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)){