--- a/jdk/src/share/classes/com/sun/crypto/provider/SunJCE.java Mon Jan 07 14:40:07 2013 -0800
+++ b/jdk/src/share/classes/com/sun/crypto/provider/SunJCE.java Tue Jan 08 11:55:21 2013 -0800
@@ -91,7 +91,12 @@
/* Are we debugging? -- for developers */
static final boolean debug = false;
- static final SecureRandom RANDOM = new SecureRandom();
+ // lazy initialize SecureRandom to avoid potential recursion if Sun
+ // provider has not been installed yet
+ private static class SecureRandomHolder {
+ static final SecureRandom RANDOM = new SecureRandom();
+ }
+ static SecureRandom getRandom() { return SecureRandomHolder.RANDOM; }
public SunJCE() {
/* We are the "SunJCE" provider */