Lines Matching defs:oldInstance

121      * the class of {@code oldInstance} explicitly declares an "equals" method
122 * this method returns the value of {@code oldInstance.equals(newInstance)}.
126 * @param oldInstance The instance to be copied.
129 * created by applying a series of mutations to {@code oldInstance}.
133 protected boolean mutatesTo(Object oldInstance, Object newInstance) {
136 return (constructor.length == 0) || !definesEquals(oldInstance) ?
137 super.mutatesTo(oldInstance, newInstance) :
138 oldInstance.equals(newInstance);
147 * @param oldInstance The instance to be instantiated.
149 * @return An expression whose value is {@code oldInstance}.
156 protected Expression instantiate(Object oldInstance, Encoder out) {
158 Class<?> type = oldInstance.getClass();
163 constructorArgs[i] = MethodUtil.invoke(method, oldInstance, new Object[0]);
169 return new Expression(oldInstance, oldInstance.getClass(), "new", constructorArgs);
187 private void doProperty(Class<?> type, PropertyDescriptor pd, Object oldInstance, Object newInstance, Encoder out) throws Exception {
192 Expression oldGetExp = new Expression(oldInstance, getter.getName(), new Object[]{});
213 invokeStatement(oldInstance, setter.getName(), new Object[]{oldValue}, out);
223 private void initBean(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
233 Expression oldGetExp = new Expression(field, "get", new Object[] { oldInstance });
239 out.writeStatement(new Statement(field, "set", new Object[] { oldInstance, oldValue }));
258 doProperty(type, d, oldInstance, newInstance, out);
321 oldL = (EventListener[])MethodUtil.invoke(m, oldInstance, new Object[]{});
327 oldL = (EventListener[])MethodUtil.invoke(m, oldInstance, new Object[]{listenerType});
340 invokeStatement(oldInstance, addListenerMethodName, new Object[]{oldL[i]}, out);
345 invokeStatement(oldInstance, removeListenerMethodName, new Object[]{newL[i]}, out);
363 * to the {@code oldInstance}. The value of this
390 * @param oldInstance The instance to be copied.
400 Object oldInstance, Object newInstance,
404 super.initialize(type, oldInstance, newInstance, out);
405 if (oldInstance.getClass() == type) { // !type.isInterface()) {
406 initBean(type, oldInstance, newInstance, out);