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:
parent
3051264e1b
commit
db0f2304bd
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue