Lines Matching defs:oldInstance

100      * be mutated into an accurate copy of {@code oldInstance}.
106 * @param oldInstance The instance that will be created by this expression.
111 public void writeObject(Object oldInstance, Encoder out) {
112 Object newInstance = out.get(oldInstance);
113 if (!mutatesTo(oldInstance, newInstance)) {
114 out.remove(oldInstance);
115 out.writeExpression(instantiate(oldInstance, out));
118 initialize(oldInstance.getClass(), oldInstance, newInstance, out);
123 * Returns true if an <em>equivalent</em> copy of {@code oldInstance} may be
126 * is indistinguishable from {@code oldInstance} in the behavior
136 * @param oldInstance The instance to be copied.
139 * created by applying a series of mutations to {@code oldInstance}.
141 protected boolean mutatesTo(Object oldInstance, Object newInstance) {
142 return (newInstance != null && oldInstance != null &&
143 oldInstance.getClass() == newInstance.getClass());
147 * Returns an expression whose value is {@code oldInstance}.
153 * Field f = (Field)oldInstance;
158 * will be identical to {@code oldInstance}.
160 * @param oldInstance The instance that will be created by this expression.
162 * @return An expression whose value is {@code oldInstance}.
167 protected abstract Expression instantiate(Object oldInstance, Encoder out);
171 * so that the new instance becomes <em>equivalent</em> to {@code oldInstance}.
178 * "what happened" statements involving the {@code oldInstance}
186 * which start out as references to {@code oldInstance} are returned
202 * @param oldInstance The instance to be copied.
209 Object oldInstance, Object newInstance,
214 info.initialize(superType, oldInstance, newInstance, out);