Skip to content
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

Disallow Random/SplittableRandom in the image heap and initialize relevant classes at runtime #2993

Closed
wants to merge 7 commits into from
Prev Previous commit
Move RandomNumbersFeature into JDKInitializationFeature
  • Loading branch information
pivovarit committed Nov 23, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 46b3397ab1923f45dc3862cf2430c71a7f66114d

This file was deleted.

Original file line number Diff line number Diff line change
@@ -121,5 +121,10 @@ public void afterRegistration(AfterRegistrationAccess access) {
RuntimeClassInitialization.initializeAtRunTime(com.sun.jndi.dns.DnsClient.class);
RuntimeClassInitialization.initializeAtRunTime("sun.net.www.protocol.http.DigestAuthentication$Parameters");
RuntimeClassInitialization.initializeAtRunTime("sun.security.krb5.KrbServiceLocator");

// The random number provider classes should be reinitialized at runtime to reset their
// values properly. Otherwise the numbers generated will be fixed for each generated image.
RuntimeClassInitialization.initializeAtRunTime("java.lang.Math$RandomNumberGeneratorHolder");
RuntimeClassInitialization.initializeAtRunTime("java.lang.StrictMath$RandomNumberGeneratorHolder");
}
}