Suppressed two unchecked warnings.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1672030 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Duncan Jones 2015-04-08 08:38:02 +00:00
parent 3051264e1b
commit db0f2304bd
2 changed files with 4 additions and 0 deletions

View File

@ -121,6 +121,7 @@ public class SerializationUtils {
* @return the serialized and deseralized object
* @since 3.3
*/
@SuppressWarnings("unchecked")
public static <T extends Serializable> T roundtrip(final T msg) {
return (T) SerializationUtils.deserialize(SerializationUtils.serialize(msg));
}

View File

@ -18,7 +18,9 @@ package org.apache.commons.lang3.exception;
import org.junit.Test;
import org.junit.Before;
import static org.junit.Assert.*;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
@ -178,6 +180,7 @@ public abstract class AbstractExceptionContextTest<T extends ExceptionContext &
public void testJavaSerialization() {
exceptionContext.setContextValue("test Poorly written obj", "serializable replacement");
@SuppressWarnings("unchecked")
final T clone = (T) SerializationUtils.deserialize(SerializationUtils.serialize(exceptionContext));
assertEquals(exceptionContext.getFormattedExceptionMessage(null), clone.getFormattedExceptionMessage(null));
}