8202922: Method reference identity is broken by serialization

Reviewed-by: jlaskey, mchung
This commit is contained in:
Paul Sandoz 2018-06-22 12:05:36 -07:00
parent c0191347e0
commit 54e53458c6
2 changed files with 13 additions and 1 deletions

View File

@ -61,7 +61,13 @@ import java.util.Arrays;
* parameters</em>, which must be provided as arguments to the
* {@code CallSite} target, and which may be early-bound to the behavior
* {@code MethodHandle}. The number of captured parameters and their types
* are determined during linkage.</li>
* are determined during linkage.
* The identity of a function object produced by invoking the
* {@code CallSite}'s target is unpredictable, and therefore
* identity-sensitive operations (such as reference equality, object
* locking, and {@code System.identityHashCode()} may produce different
* results in different implementations, or even upon different invocations
* in the same implementation.</li>
*
* <li><em>Invocation</em> occurs when an implemented interface method
* is invoked on a function object. This may occur many times for a single

View File

@ -53,6 +53,12 @@ import java.util.Objects;
* that the properties of the {@code SerializedLambda} are consistent with a
* lambda actually captured by that class.
*
* <p>The identity of a function object produced by deserializing the serialized
* form is unpredictable, and therefore identity-sensitive operations (such as
* reference equality, object locking, and {@code System.identityHashCode()} may
* produce different results in different implementations, or even upon
* different deserializations in the same implementation.
*
* @see LambdaMetafactory
* @since 1.8
*/