New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Unsafe to set final static fields, support JDK12+ #1026
Use Unsafe to set final static fields, support JDK12+ #1026
Conversation
Test are falling org.powermock.reflect.WhiteBoxTest > testSetInternalStateWithInvalidArgumentType FAILED
org.powermock.reflect.WhiteBoxTest > testStaticFinalStringState FAILED |
I will fix them. |
423ffce
to
bd92bcc
Compare
@thekingn0thing I have fixes the test. |
Hi @thekingn0thing thanks |
@eolivelli Merged. Thank you a lot for a pull request and sorry for such long delay. |
@thekingn0thing thanks to you that you are maintaining this great project ! I hope we can get a release out soon, this patch brings back WhiteBox to full powers in modern jdks land |
@eolivelli the library was automated released by pipline after the PR had been merged. |
From JDK12+ is it no more possible to set a value to final static fields.
With this patch we are going to use Unsafe, that works on every JDK up to 13.
We are now also allowing to write to 'static final fields'