RFR: 8271820: Implementation of JEP 416: Reimplement Core Reflection with Method Handle [v16]
Alan Bateman
Alan.Bateman at oracle.com
Mon Nov 15 07:11:08 UTC 2021
On 14/11/2021 22:56, Claes Redestad wrote:
> :
> Alan: changing `Field.modifiers` still works, but dropping the final modifier is not enough for this to work in the new impl. It won't be hard to adapt to the new world. Users who relies on this today could for example opt-out of the new MH-based impl using `-Djdk.reflect.useDirectMethodHandle=false` and get the old behavior. I've checked using a minimal reproducer I extracted from the Wicket sources that this works.
>
Sure, but I don't think that would be enough as Wicket would also need
to open java.lang and java.lang.reflect to allow it continue to access
private members of Class and Field. I assume the test started emitting
"Illegal reflective access ..." warnings in JDK 9 and it stopped working
in JDK 16, and somewhere along the line the maintainers must have added
--add-opens to get it to work. It's just not tenable, hopefully the
project will find a way to re-write that test.
-Alan
More information about the core-libs-dev
mailing list