added null check on setSecureRandom() to clear provider entry.
@@ -156,6 +156,12 @@ public static void setSecureRandom(final SecureRandom secureRandom)
checkPermission(CanSetDefaultRandom);
synchronized (cacheLock)
+ {
+ if (secureRandom == null)
+ {
+ defaultSecureRandomProvider = null;
+ }
+ else
{
defaultSecureRandomProvider = new SecureRandomProvider()
{
@@ -167,6 +173,7 @@ public SecureRandom get()
};
}
}
+ }
/**
* Set a default secure random provider to be used where none is otherwise provided.
