diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 39460c8f9bb..ec2b47efd1f 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -90,6 +90,9 @@ Release 2.3.0 - UNRELEASED HADOOP-9981. globStatus should minimize its listStatus and getFileStatus calls. (Contributed by Colin Patrick McCabe) + HADOOP-10006. Compilation failure in trunk for + o.a.h.fs.swift.util.JSONUtil (Junping Du via stevel) + Release 2.2.0 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-tools/hadoop-openstack/src/main/java/org/apache/hadoop/fs/swift/util/JSONUtil.java b/hadoop-tools/hadoop-openstack/src/main/java/org/apache/hadoop/fs/swift/util/JSONUtil.java index fd923ce28fe..b17cb6590c1 100644 --- a/hadoop-tools/hadoop-openstack/src/main/java/org/apache/hadoop/fs/swift/util/JSONUtil.java +++ b/hadoop-tools/hadoop-openstack/src/main/java/org/apache/hadoop/fs/swift/util/JSONUtil.java @@ -90,11 +90,12 @@ public class JSONUtil { * @param type * @return deserialized T object */ + @SuppressWarnings("unchecked") public static T toObject(String value, final TypeReference 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 type * @return deserialized T object */ + @SuppressWarnings("unchecked") public static 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,