spark
spark copied to clipboard
[SPARK-52088][CORE] Refactor the `ClosureCleaner#clean` and avoid using the `-Djdk.reflect.useDirectMethodHandle=false`
What changes were proposed in this pull request?
During the cleanup process, instead of trying to update func.arg$1, we change the state in the arg$1. This is due to Java safety constraint, it doesn't allow change private field in hidden class (the lambda).
Why are the changes needed?
since we're updating to Java22 finally. The workarounds (-Djdk.reflect.useDirectMethodHandle) won't exist any more
Does this PR introduce any user-facing change?
no
How was this patch tested?
UT
Was this patch authored or co-authored using generative AI tooling?
no