hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r1527186 - /hadoop/common/branches/branch-2/hadoop-tools/hadoop-openstack/src/main/java/org/apache/hadoop/fs/swift/util/JSONUtil.java
Date Sat, 28 Sep 2013 13:30:10 GMT
Author: stevel
Date: Sat Sep 28 13:30:09 2013
New Revision: 1527186

URL: http://svn.apache.org/r1527186
Log:
HADOOP-10006. Compilation failure in trunk for o.a.h.fs.swift.util.JSONUtil

Modified:
    hadoop/common/branches/branch-2/hadoop-tools/hadoop-openstack/src/main/java/org/apache/hadoop/fs/swift/util/JSONUtil.java

Modified: hadoop/common/branches/branch-2/hadoop-tools/hadoop-openstack/src/main/java/org/apache/hadoop/fs/swift/util/JSONUtil.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-tools/hadoop-openstack/src/main/java/org/apache/hadoop/fs/swift/util/JSONUtil.java?rev=1527186&r1=1527185&r2=1527186&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-tools/hadoop-openstack/src/main/java/org/apache/hadoop/fs/swift/util/JSONUtil.java
(original)
+++ hadoop/common/branches/branch-2/hadoop-tools/hadoop-openstack/src/main/java/org/apache/hadoop/fs/swift/util/JSONUtil.java
Sat Sep 28 13:30:09 2013
@@ -90,11 +90,12 @@ public class JSONUtil {
    * @param <T>           type
    * @return deserialized  T object
    */
+  @SuppressWarnings("unchecked")
   public static <T> T toObject(String value,
                                final TypeReference<T> typeReference)
             throws IOException {
     try {
-      return jsonMapper.readValue(value, typeReference);
+      return (T)jsonMapper.readValue(value, typeReference);
     } catch (JsonGenerationException e) {
       throw new SwiftJsonMarshallingException("Error generating response", e);
     } catch (JsonMappingException e) {
@@ -108,11 +109,12 @@ public class JSONUtil {
    * @param <T>            type
    * @return deserialized  T object
    */
+  @SuppressWarnings("unchecked")
   public static <T> T toObject(String value,
                                final CollectionType collectionType)
               throws IOException {
     try {
-      return jsonMapper.readValue(value, collectionType);
+      return (T)jsonMapper.readValue(value, collectionType);
     } catch (JsonGenerationException e) {
       throw new SwiftJsonMarshallingException(e.toString()
                                               + " source: " + value,



Mime
View raw message