changeset 48723:d3b1fc1bda9c

8145371: ClassCastException thrown in LambdaFormEditor.getInCache Summary: Read field into local to avoid customization race Reviewed-by: vlivanov, jrose, psandoz
author martin
date Wed, 03 Jan 2018 13:17:35 -0800
parents 9a29aa153c20
children 37d2147852fc
files src/java.base/share/classes/java/lang/invoke/MethodHandle.java
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/java/lang/invoke/MethodHandle.java	Mon Jan 08 07:13:27 2018 -0800
+++ b/src/java.base/share/classes/java/lang/invoke/MethodHandle.java	Wed Jan 03 13:17:35 2018 -0800
@@ -1667,6 +1667,7 @@
     /** Craft a LambdaForm customized for this particular MethodHandle */
     /*non-public*/
     void customize() {
+        final LambdaForm form = this.form;
         if (form.customized == null) {
             LambdaForm newForm = form.customize(this);
             updateForm(newForm);