hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From whe...@apache.org
Subject hadoop git commit: HADOOP-11378. Fix new findbugs warnings in hadoop-kms. Contributed by Li Lu.
Date Tue, 09 Dec 2014 21:10:12 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 b68d51e89 -> 784f48147


HADOOP-11378. Fix new findbugs warnings in hadoop-kms. Contributed by Li Lu.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/784f4814
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/784f4814
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/784f4814

Branch: refs/heads/branch-2
Commit: 784f481473276f25ca8f967230829d13e5dfff20
Parents: b68d51e
Author: Haohui Mai <wheat9@apache.org>
Authored: Tue Dec 9 13:10:03 2014 -0800
Committer: Haohui Mai <wheat9@apache.org>
Committed: Tue Dec 9 13:10:09 2014 -0800

----------------------------------------------------------------------
 hadoop-common-project/hadoop-common/CHANGES.txt                  | 2 ++
 .../org/apache/hadoop/crypto/key/kms/server/KMSJSONWriter.java   | 4 +++-
 2 files changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/784f4814/hadoop-common-project/hadoop-common/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt
index 2d4a1d3..1cf5bd7 100644
--- a/hadoop-common-project/hadoop-common/CHANGES.txt
+++ b/hadoop-common-project/hadoop-common/CHANGES.txt
@@ -184,6 +184,8 @@ Release 2.7.0 - UNRELEASED
 
     HADOOP-11379. Fix new findbugs warnings in hadoop-auth*. (Li Lu via wheat9)
 
+    HADOOP-11378. Fix new findbugs warnings in hadoop-kms. (Li Lu via wheat9)
+
 Release 2.6.0 - 2014-11-18
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/784f4814/hadoop-common-project/hadoop-kms/src/main/java/org/apache/hadoop/crypto/key/kms/server/KMSJSONWriter.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-kms/src/main/java/org/apache/hadoop/crypto/key/kms/server/KMSJSONWriter.java
b/hadoop-common-project/hadoop-kms/src/main/java/org/apache/hadoop/crypto/key/kms/server/KMSJSONWriter.java
index 3674e7a..31fac9f 100644
--- a/hadoop-common-project/hadoop-kms/src/main/java/org/apache/hadoop/crypto/key/kms/server/KMSJSONWriter.java
+++ b/hadoop-common-project/hadoop-kms/src/main/java/org/apache/hadoop/crypto/key/kms/server/KMSJSONWriter.java
@@ -32,6 +32,7 @@ import java.io.OutputStreamWriter;
 import java.io.Writer;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Type;
+import java.nio.charset.Charset;
 import java.util.List;
 import java.util.Map;
 
@@ -62,7 +63,8 @@ public class KMSJSONWriter implements MessageBodyWriter<Object> {
       Annotation[] annotations, MediaType mediaType,
       MultivaluedMap<String, Object> stringObjectMultivaluedMap,
       OutputStream outputStream) throws IOException, WebApplicationException {
-    Writer writer = new OutputStreamWriter(outputStream);
+    Writer writer = new OutputStreamWriter(outputStream, Charset
+        .forName("UTF-8"));
     ObjectMapper jsonMapper = new ObjectMapper();
     jsonMapper.writerWithDefaultPrettyPrinter().writeValue(writer, obj);
   }


Mime
View raw message