Author: peter_firmstone Date: Mon Jul 1 09:19:05 2013 New Revision: 1498337
URL: http://svn.apache.org/r1498337 Log: Make MarshalledInstance an immutable object, rather than effectively immutable, so it is safely published when constructors and deserialization completes. Modified: river/jtsk/skunk/qa_refactor/trunk/src/net/jini/io/MarshalledInstance.java Modified: river/jtsk/skunk/qa_refactor/trunk/src/net/jini/io/MarshalledInstance.java URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/src/net/jini/io/MarshalledInstance.java?rev=1498337&r1=1498336&r2=1498337&view=diff ============================================================================== --- river/jtsk/skunk/qa_refactor/trunk/src/net/jini/io/MarshalledInstance.java (original) +++ river/jtsk/skunk/qa_refactor/trunk/src/net/jini/io/MarshalledInstance.java Mon Jul 1 09:19:05 2013 @@ -76,21 +76,21 @@ public class MarshalledInstance implemen * <code>null</code> then the object marshalled was a <code>null</code> * reference. */ - private byte[] objBytes = null; + private final byte[] objBytes; /** * @serial Bytes of location annotations, which are ignored by * <code>equals</code>. If <code>locBytes</code> is null, there were no * non-<code>null</code> annotations during marshalling. */ - private byte[] locBytes = null; + private final byte[] locBytes; /** * @serial Stored hash code of contained object. * * @see #hashCode */ - private int hash; + private final int hash; static final long serialVersionUID = -5187033771082433496L; @@ -134,6 +134,8 @@ public class MarshalledInstance implemen if (obj == null) { hash = 13; // null hash for java.rmi.MarshalledObject + objBytes = null; + locBytes = null; return; } ByteArrayOutputStream bout = new ByteArrayOutputStream();
