commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brit...@apache.org
Subject svn commit: r1653307 - in /commons/proper/lang/trunk/src: changes/changes.xml main/java/org/apache/commons/lang3/SerializationUtils.java test/java/org/apache/commons/lang3/exception/AbstractExceptionContextTest.java
Date Tue, 20 Jan 2015 17:30:12 GMT
Author: britter
Date: Tue Jan 20 17:30:11 2015
New Revision: 1653307

URL: http://svn.apache.org/r1653307
Log:
LANG-1083: Add (T) casts to get unit tests to pass in old JDK. This fixes #42 from github.
Thanks to Jonathan Baker.

Modified:
    commons/proper/lang/trunk/src/changes/changes.xml
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/SerializationUtils.java
    commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/exception/AbstractExceptionContextTest.java

Modified: commons/proper/lang/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/changes/changes.xml?rev=1653307&r1=1653306&r2=1653307&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/changes/changes.xml [utf-8] (original)
+++ commons/proper/lang/trunk/src/changes/changes.xml [utf-8] Tue Jan 20 17:30:11 2015
@@ -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>

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/SerializationUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/SerializationUtils.java?rev=1653307&r1=1653306&r2=1653307&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/SerializationUtils.java
(original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/SerializationUtils.java
Tue Jan 20 17:30:11 2015
@@ -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

Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/exception/AbstractExceptionContextTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/exception/AbstractExceptionContextTest.java?rev=1653307&r1=1653306&r2=1653307&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/exception/AbstractExceptionContextTest.java
(original)
+++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/exception/AbstractExceptionContextTest.java
Tue Jan 20 17:30:11 2015
@@ -178,7 +178,7 @@ public abstract class AbstractExceptionC
     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));
     }
 }



Mime
View raw message