LANG-1083: Add (T) casts to get unit tests to pass in old JDK. This fixes #42 from github. Thanks to Jonathan Baker.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1653307 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benedikt Ritter 2015-01-20 17:30:11 +00:00
parent 89c8519238
commit 6eac3468d4
3 changed files with 3 additions and 2 deletions

View File

@ -22,6 +22,7 @@
<body>
<release version="3.4" date="tba" description="tba">
<action issue="LANG-1083" type="fix" dev="britter" due-to="Jonathan Baker">Add (T) casts to get unit tests to pass in old JDK</action>
<action issue="LANG-1015" type="add" dev="britter" due-to="Thiago Andrade">Add JsonToStringStyle implementation to ToStringStyle</action>
<action issue="LANG-1080" type="add" dev="britter" due-to="Innokenty Shuvalov">Add NoClassNameToStringStyle implementation of ToStringStyle</action>
<action issue="LANG-1071" type="update" dev="britter" due-to="Arno Noordover">Fix wrong examples in JavaDoc of StringUtils.replaceEachRepeatedly(...), StringUtils.replaceEach(...)</action>

View File

@ -122,7 +122,7 @@ public class SerializationUtils {
* @since 3.3
*/
public static <T extends Serializable> T roundtrip(final T msg) {
return SerializationUtils.deserialize(SerializationUtils.serialize(msg));
return (T) SerializationUtils.deserialize(SerializationUtils.serialize(msg));
}
// Serialize

View File

@ -178,7 +178,7 @@ public abstract class AbstractExceptionContextTest<T extends ExceptionContext &
public void testJavaSerialization() {
exceptionContext.setContextValue("test Poorly written obj", "serializable replacement");
final T clone = SerializationUtils.deserialize(SerializationUtils.serialize(exceptionContext));
final T clone = (T) SerializationUtils.deserialize(SerializationUtils.serialize(exceptionContext));
assertEquals(exceptionContext.getFormattedExceptionMessage(null), clone.getFormattedExceptionMessage(null));
}
}