ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/JSR166TestCase.java
(Generate patch)

Comparing jsr166/src/test/tck/JSR166TestCase.java (file contents):
Revision 1.246 by jsr166, Sun Jul 22 21:25:16 2018 UTC vs.
Revision 1.247 by jsr166, Sun Jul 22 21:37:31 2018 UTC

# Line 1781 | Line 1781 | public class JSR166TestCase extends Test
1781  
1782      @SuppressWarnings("unchecked")
1783      <T> T serialClone(T o) {
1784 +        T clone = null;
1785          try {
1786              ObjectInputStream ois = new ObjectInputStream
1787                  (new ByteArrayInputStream(serialBytes(o)));
1788 <            T clone = (T) ois.readObject();
1788 <            if (o == clone) assertImmutable(o);
1789 <            assertSame(o.getClass(), clone.getClass());
1790 <            return clone;
1788 >            clone = (T) ois.readObject();
1789          } catch (Throwable fail) {
1790              threadUnexpectedException(fail);
1793            return null;
1791          }
1792 +        if (o == clone) assertImmutable(o);
1793 +        else assertSame(o.getClass(), clone.getClass());
1794 +        return clone;
1795      }
1796  
1797      /**
# Line 1810 | Line 1810 | public class JSR166TestCase extends Test
1810              (new ByteArrayInputStream(bos.toByteArray()));
1811          T clone = (T) ois.readObject();
1812          if (o == clone) assertImmutable(o);
1813 <        assertSame(o.getClass(), clone.getClass());
1813 >        else assertSame(o.getClass(), clone.getClass());
1814          return clone;
1815      }
1816  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines