jdk/src/share/classes/java/beans/PersistenceDelegate.java
author mcimadamore
Thu, 01 Dec 2011 18:34:23 +0000
changeset 11120 f8576c769572
parent 5506 202f599c92aa
child 19213 c360667a0da2
permissions -rw-r--r--
7116954: Misc warnings in java.beans/java.beans.context Summary: Remove generic warnings form java.beans and java.beans.context Reviewed-by: alanb, chegar
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4849
diff changeset
     2
 * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4849
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4849
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4849
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4849
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4849
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
package java.beans;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
 * The PersistenceDelegate class takes the responsibility
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 * for expressing the state of an instance of a given class
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 * in terms of the methods in the class's public API. Instead
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 * of associating the responsibility of persistence with
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * the class itself as is done, for example, by the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * <code>readObject</code> and <code>writeObject</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * methods used by the <code>ObjectOutputStream</code>, streams like
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * the <code>XMLEncoder</code> which
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * use this delegation model can have their behavior controlled
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * independently of the classes themselves. Normally, the class
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * is the best place to put such information and conventions
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * can easily be expressed in this delegation scheme to do just that.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * Sometimes however, it is the case that a minor problem
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * in a single class prevents an entire object graph from
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * being written and this can leave the application
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * developer with no recourse but to attempt to shadow
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * the problematic classes locally or use alternative
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * persistence techniques. In situations like these, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * delegation model gives a relatively clean mechanism for
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * the application developer to intervene in all parts of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * serialization process without requiring that modifications
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 * be made to the implementation of classes which are not part
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 * of the application itself.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 * In addition to using a delegation model, this persistence
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 * scheme differs from traditional serialization schemes
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 * in requiring an analog of the <code>writeObject</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 * method without a corresponding <code>readObject</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 * method. The <code>writeObject</code> analog encodes each
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 * instance in terms of its public API and there is no need to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 * define a <code>readObject</code> analog
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 * since the procedure for reading the serialized form
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
 * is defined by the semantics of method invocation as laid
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
 * out in the Java Language Specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
 * Breaking the dependency between <code>writeObject</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
 * and <code>readObject</code> implementations, which may
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
 * change from version to version, is the key factor
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
 * in making the archives produced by this technique immune
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
 * to changes in the private implementations of the classes
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
 * to which they refer.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
 * A persistence delegate, may take control of all
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
 * aspects of the persistence of an object including:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
 * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
 * <li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
 * Deciding whether or not an instance can be mutated
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
 * into another instance of the same class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
 * <li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
 * Instantiating the object, either by calling a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
 * public constructor or a public factory method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
 * <li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
 * Performing the initialization of the object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
 * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
 * @see XMLEncoder
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
 * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
 * @author Philip Milne
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
public abstract class PersistenceDelegate {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     * The <code>writeObject</code> is a single entry point to the persistence
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     * and is used by a <code>Encoder</code> in the traditional
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     * mode of delegation. Although this method is not final,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     * it should not need to be subclassed under normal circumstances.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     * This implementation first checks to see if the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
     * has already encountered this object. Next the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
     * <code>mutatesTo</code> method is called to see if
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
     * that candidate returned from the stream can
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
     * be mutated into an accurate copy of <code>oldInstance</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     * If it can, the <code>initialize</code> method is called to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     * perform the initialization. If not, the candidate is removed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
     * from the stream, and the <code>instantiate</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     * is called to create a new candidate for this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     * @param oldInstance The instance that will be created by this expression.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     * @param out The stream to which this expression will be written.
4849
c83eca4dbb8f 6412286: DOC: LTP: Unspecified NPE in java.beans.DefaultPersistenceDelegate.instantiate method
malenkov
parents: 2
diff changeset
   108
     *
c83eca4dbb8f 6412286: DOC: LTP: Unspecified NPE in java.beans.DefaultPersistenceDelegate.instantiate method
malenkov
parents: 2
diff changeset
   109
     * @throws NullPointerException if {@code out} is {@code null}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
    public void writeObject(Object oldInstance, Encoder out) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
        Object newInstance = out.get(oldInstance);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
        if (!mutatesTo(oldInstance, newInstance)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
            out.remove(oldInstance);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
            out.writeExpression(instantiate(oldInstance, out));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
        else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
            initialize(oldInstance.getClass(), oldInstance, newInstance, out);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
     * Returns true if an <em>equivalent</em> copy of <code>oldInstance</code> may be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
     * created by applying a series of statements to <code>newInstance</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
     * In the specification of this method, we mean by equivalent that the modified instance
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
     * is indistinguishable from <code>oldInstance</code> in the behavior
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
     * of the relevant methods in its public API. [Note: we use the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
     * phrase <em>relevant</em> methods rather than <em>all</em> methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
     * here only because, to be strictly correct, methods like <code>hashCode</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
     * and <code>toString</code> prevent most classes from producing truly
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
     * indistinguishable copies of their instances].
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
     * The default behavior returns <code>true</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     * if the classes of the two instances are the same.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
     * @param oldInstance The instance to be copied.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     * @param newInstance The instance that is to be modified.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
     * @return True if an equivalent copy of <code>newInstance</code> may be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     *         created by applying a series of mutations to <code>oldInstance</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
    protected boolean mutatesTo(Object oldInstance, Object newInstance) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
        return (newInstance != null && oldInstance != null &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
                oldInstance.getClass() == newInstance.getClass());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     * Returns an expression whose value is <code>oldInstance</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     * This method is used to characterize the constructor
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     * or factory method that should be used to create the given object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
     * For example, the <code>instantiate</code> method of the persistence
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
     * delegate for the <code>Field</code> class could be defined as follows:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
     * <pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     * Field f = (Field)oldInstance;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     * return new Expression(f, f.getDeclaringClass(), "getField", new Object[]{f.getName()});
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     * </pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     * Note that we declare the value of the returned expression so that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     * the value of the expression (as returned by <code>getValue</code>)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     * will be identical to <code>oldInstance</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     * @param oldInstance The instance that will be created by this expression.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     * @param out The stream to which this expression will be written.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
     * @return An expression whose value is <code>oldInstance</code>.
4849
c83eca4dbb8f 6412286: DOC: LTP: Unspecified NPE in java.beans.DefaultPersistenceDelegate.instantiate method
malenkov
parents: 2
diff changeset
   163
     *
c83eca4dbb8f 6412286: DOC: LTP: Unspecified NPE in java.beans.DefaultPersistenceDelegate.instantiate method
malenkov
parents: 2
diff changeset
   164
     * @throws NullPointerException if {@code out} is {@code null}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
    protected abstract Expression instantiate(Object oldInstance, Encoder out);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
     * Produce a series of statements with side effects on <code>newInstance</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
     * so that the new instance becomes <em>equivalent</em> to <code>oldInstance</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
     * In the specification of this method, we mean by equivalent that, after the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
     * returns, the modified instance is indistinguishable from
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
     * <code>newInstance</code> in the behavior of all methods in its
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
     * public API.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
     * The implementation typically achieves this goal by producing a series of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
     * "what happened" statements involving the <code>oldInstance</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
     * and its publicly available state. These statements are sent
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
     * to the output stream using its <code>writeExpression</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
     * method which returns an expression involving elements in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
     * a cloned environment simulating the state of an input stream during
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
     * reading. Each statement returned will have had all instances
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
     * the old environment replaced with objects which exist in the new
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
     * one. In particular, references to the target of these statements,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
     * which start out as references to <code>oldInstance</code> are returned
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
     * as references to the <code>newInstance</code> instead.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
     * Executing these statements effects an incremental
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
     * alignment of the state of the two objects as a series of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
     * modifications to the objects in the new environment.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
     * By the time the initialize method returns it should be impossible
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
     * to tell the two instances apart by using their public APIs.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
     * Most importantly, the sequence of steps that were used to make
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
     * these objects appear equivalent will have been recorded
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
     * by the output stream and will form the actual output when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
     * the stream is flushed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
     * The default implementation, calls the <code>initialize</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
     * method of the type's superclass.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
     * @param oldInstance The instance to be copied.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
     * @param newInstance The instance that is to be modified.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
     * @param out The stream to which any initialization statements should be written.
4849
c83eca4dbb8f 6412286: DOC: LTP: Unspecified NPE in java.beans.DefaultPersistenceDelegate.instantiate method
malenkov
parents: 2
diff changeset
   203
     *
c83eca4dbb8f 6412286: DOC: LTP: Unspecified NPE in java.beans.DefaultPersistenceDelegate.instantiate method
malenkov
parents: 2
diff changeset
   204
     * @throws NullPointerException if {@code out} is {@code null}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
    protected void initialize(Class<?> type,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
                              Object oldInstance, Object newInstance,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
                              Encoder out)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
    {
11120
f8576c769572 7116954: Misc warnings in java.beans/java.beans.context
mcimadamore
parents: 5506
diff changeset
   210
        Class<?> superType = type.getSuperclass();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
        PersistenceDelegate info = out.getPersistenceDelegate(superType);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
        info.initialize(superType, oldInstance, newInstance, out);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
}