From 40e4babd35f96e0e8f4b43e4f7c2b4cc33c6df7f Mon Sep 17 00:00:00 2001 From: Sebastian Bazley Date: Wed, 9 Nov 2011 12:43:20 +0000 Subject: [PATCH] Suppress generic warning git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1199718 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/commons/lang3/SerializationUtils.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/apache/commons/lang3/SerializationUtils.java b/src/main/java/org/apache/commons/lang3/SerializationUtils.java index 9cf3891f2..b766b2145 100644 --- a/src/main/java/org/apache/commons/lang3/SerializationUtils.java +++ b/src/main/java/org/apache/commons/lang3/SerializationUtils.java @@ -89,7 +89,9 @@ public class SerializationUtils { * it is reasonable to assume the deserialized object * is of the same type as the original serialized object */ - return (T) in.readObject(); + @SuppressWarnings("unchecked") // see above + T readObject = (T) in.readObject(); + return readObject; } catch (ClassNotFoundException ex) { throw new SerializationException("ClassNotFoundException while reading cloned object data", ex);