1181 |
|
oos.writeObject(o); |
1182 |
|
oos.flush(); |
1183 |
|
oos.close(); |
1184 |
< |
ByteArrayInputStream bin = |
1185 |
< |
new ByteArrayInputStream(bos.toByteArray()); |
1186 |
< |
ObjectInputStream ois = new ObjectInputStream(bin); |
1187 |
< |
return (T) ois.readObject(); |
1184 |
> |
ObjectInputStream ois = new ObjectInputStream |
1185 |
> |
(new ByteArrayInputStream(bos.toByteArray())); |
1186 |
> |
T clone = (T) ois.readObject(); |
1187 |
> |
assertSame(o.getClass(), clone.getClass()); |
1188 |
> |
return clone; |
1189 |
|
} catch (Throwable t) { |
1190 |
|
threadUnexpectedException(t); |
1191 |
|
return null; |