HADOOP-10006. Compilation failure in trunk for o.a.h.fs.swift.util.JSONUtil
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1527187 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
eccdb9aa8b
commit
42b6cadd76
@ -339,6 +339,9 @@ Release 2.3.0 - UNRELEASED
|
|||||||
HADOOP-9998. Provide methods to clear only part of the DNSToSwitchMapping.
|
HADOOP-9998. Provide methods to clear only part of the DNSToSwitchMapping.
|
||||||
(Junping Du via Colin Patrick McCabe)
|
(Junping Du via Colin Patrick McCabe)
|
||||||
|
|
||||||
|
HADOOP-10006. Compilation failure in trunk for
|
||||||
|
o.a.h.fs.swift.util.JSONUtil (Junping Du via stevel)
|
||||||
|
|
||||||
OPTIMIZATIONS
|
OPTIMIZATIONS
|
||||||
|
|
||||||
HADOOP-9748. Reduce blocking on UGI.ensureInitialized (daryn)
|
HADOOP-9748. Reduce blocking on UGI.ensureInitialized (daryn)
|
||||||
|
@ -90,11 +90,12 @@ public static <T> T toObject(String value, Class<T> klazz) throws
|
|||||||
* @param <T> type
|
* @param <T> type
|
||||||
* @return deserialized T object
|
* @return deserialized T object
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public static <T> T toObject(String value,
|
public static <T> T toObject(String value,
|
||||||
final TypeReference<T> typeReference)
|
final TypeReference<T> typeReference)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
try {
|
try {
|
||||||
return jsonMapper.readValue(value, typeReference);
|
return (T)jsonMapper.readValue(value, typeReference);
|
||||||
} catch (JsonGenerationException e) {
|
} catch (JsonGenerationException e) {
|
||||||
throw new SwiftJsonMarshallingException("Error generating response", e);
|
throw new SwiftJsonMarshallingException("Error generating response", e);
|
||||||
} catch (JsonMappingException e) {
|
} catch (JsonMappingException e) {
|
||||||
@ -108,11 +109,12 @@ public static <T> T toObject(String value,
|
|||||||
* @param <T> type
|
* @param <T> type
|
||||||
* @return deserialized T object
|
* @return deserialized T object
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public static <T> T toObject(String value,
|
public static <T> T toObject(String value,
|
||||||
final CollectionType collectionType)
|
final CollectionType collectionType)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
try {
|
try {
|
||||||
return jsonMapper.readValue(value, collectionType);
|
return (T)jsonMapper.readValue(value, collectionType);
|
||||||
} catch (JsonGenerationException e) {
|
} catch (JsonGenerationException e) {
|
||||||
throw new SwiftJsonMarshallingException(e.toString()
|
throw new SwiftJsonMarshallingException(e.toString()
|
||||||
+ " source: " + value,
|
+ " source: " + value,
|
||||||
|
Loading…
Reference in New Issue
Block a user