8145371: ClassCastException thrown in LambdaFormEditor.getInCache
authormartin
Wed, 03 Jan 2018 13:17:35 -0800
changeset 48452 d3b1fc1bda9c
parent 48451 9a29aa153c20
child 48453 37d2147852fc
8145371: ClassCastException thrown in LambdaFormEditor.getInCache Summary: Read field into local to avoid customization race Reviewed-by: vlivanov, jrose, psandoz
src/java.base/share/classes/java/lang/invoke/MethodHandle.java
--- 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);